When rebasing, we often want to do a "dummy rebase" whereby we are not rebasing over an updated master. This is because rebases can be confusing enough already, and we don't want to resolve upstream conflicts together with our local rebase conflicts due to fixup commits, commit rearrangements, and such. This productivity section details how to do such "dummy rebase"s.
docs: Add productivity notes for dummy rebases #15820
pull dongcarl wants to merge 1 commits into bitcoin:master from dongcarl:2019-04-more-productive changing 1 files +16 −0-
dongcarl commented at 5:19 PM on April 15, 2019: member
- dongcarl added the label Docs on Apr 15, 2019
-
in doc/productivity.md:97 in bc9eef012e outdated
93 | @@ -93,6 +94,21 @@ To simply check out a commit-ish under a new working directory without disruptin 94 | git worktree add --checkout ../where-my-checkout-commit-ish-will-live my-checkout-commit-ish 95 | ``` 96 | 97 | +### Dummy rebases for fixups and execs with `git merge-base`
MarcoFalke commented at 5:32 PM on April 15, 2019:I think this is called interactive rebase?
### Interactive rebases for fixups and execs with `git merge-base`
dongcarl commented at 5:35 PM on April 15, 2019:Well, they're interactive dummy rebases... Interactive rebases are normally over an updated master if you give it
masterinstead of"$(git merge-base master HEAD)".
MarcoFalke commented at 6:20 PM on April 15, 2019:Why would you do an interactive rebase if it is to rebase on an updated master?
dummy rebase returns no results for me btw: https://duckduckgo.com/?q=Dummy+rebase
dongcarl commented at 6:37 PM on April 15, 2019:You're right, an interactive rebase is not needed at all on an un-updated master (I hope that's what you meant). I just thought it'd be nice for people to see what the flags do to the rebase TODO list and understand what's going on, but we can remove it for sure. "Dummy rebase" is not a proper term, but I've had a use for this trick quite often when working on my git tree so I thought to add it.
instagibbs commented at 3:17 PM on April 16, 2019:I like the "last common commit" trick but this really is exactly what I think most people think "interactive rebases" are, including me :P
dongcarl commented at 3:27 PM on April 16, 2019:@instagibbs Well I did think about just adding a "How to find the last common commit" trick, but it doesn't really make sense without these two motivating invocations that I find myself doing often... I can remove the
-iif that makes it more clear?
instagibbs commented at 3:32 PM on April 16, 2019:No it's clear, I just have never heard of "dummy rebase". I'm agreeing with @MarcoFalke
sipa commented at 5:10 PM on April 16, 2019:I found the term "dummy rebase" confusing as well, but perhaps that's because almost all rebases I do don't actually change the base, so what you're calling a dummy rebase is just what I'd call a git rebase.
dongcarl commented at 5:19 PM on April 16, 2019:I found the term "dummy rebase" confusing as well, but perhaps that's because almost all rebases I do don't actually change the base, so what you're calling a dummy rebase is just what I'd call a git rebase. @sipa Curious: how do you achieve "not changing the base" without using
git merge-base? Maybe there's something simpler I'm missing.
instagibbs commented at 5:23 PM on April 16, 2019:git rebase -i @~3for last 3 commits
MarcoFalke commented at 6:48 PM on April 15, 2019: memberConcept ACK either way
in doc/productivity.md:99 in bc9eef012e outdated
93 | @@ -93,6 +94,21 @@ To simply check out a commit-ish under a new working directory without disruptin 94 | git worktree add --checkout ../where-my-checkout-commit-ish-will-live my-checkout-commit-ish 95 | ``` 96 | 97 | +### Dummy rebases for fixups and execs with `git merge-base` 98 | + 99 | +When rebasing, we often want to do a "dummy rebase," whereby we are not rebasing over an updated master. We can use `git merge-base` to identify the last common commit with master, and rebase off of that.
merland commented at 7:38 AM on April 16, 2019:Thanks for adding this, always nice to take part of useful productivity tips! Maybe just me, but could you add something about why we "often want to do a dummy rebase"? (What is the context and which specific problem is this solving?)
dongcarl force-pushed on Apr 16, 2019dongcarl commented at 6:23 PM on April 16, 2019: memberAdded a little more rationale. And reluctantly added "interactive" since people seem to like that more and the goal is to be clear and educate. :roll_eyes:
MarcoFalke commented at 6:26 PM on April 16, 2019: memberACK 744980d4e88dd8ef06782c6fbebe6d1a80fff344
in doc/productivity.md:109 in 744980d4e8 outdated
104 | +git rebase -i --autosquash "$(git merge-base master HEAD)" 105 | +``` 106 | + 107 | +To execute `make test` on every commit since last diverged from master, but without rebasing over an updated master, we can do the following: 108 | +```sh 109 | +git rebase -i --exec "make test" "$(git merge-base master HEAD)"
MarcoFalke commented at 6:29 PM on April 16, 2019:git rebase -i --exec "make check" "$(git merge-base master HEAD)"Eh, is it make test or make check?
dongcarl commented at 6:51 PM on April 16, 2019:My bad
dongcarl force-pushed on Apr 16, 2019dongcarl commented at 6:51 PM on April 16, 2019: members/make test/make check/gdongcarl force-pushed on May 15, 2019docs: Add productivity notes for "dummy rebases" 01971da9bdMarcoFalke referenced this in commit fd7d97decb on May 16, 2019MarcoFalke merged this on May 16, 2019MarcoFalke closed this on May 16, 2019PastaPastaPasta referenced this in commit 1ea7035396 on Jun 27, 2021PastaPastaPasta referenced this in commit 376dec5148 on Jun 28, 2021PastaPastaPasta referenced this in commit 7013832ecb on Jun 29, 2021PastaPastaPasta referenced this in commit a2fdbf763a on Jul 1, 2021PastaPastaPasta referenced this in commit f20c7fef9b on Jul 1, 2021PastaPastaPasta referenced this in commit 9fdb82c2b3 on Jul 8, 2021PastaPastaPasta referenced this in commit 26d618df99 on Jul 10, 2021DrahtBot locked this on Dec 16, 2021ContributorsLabels
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-22 18:14 UTC
More mirrored repositories can be found on mirror.b10c.me