Request for D core devs: git pull --rebase

Jonathan M Davis jmdavisProg at gmx.com
Sat Nov 5 19:16:01 PDT 2011


On Sunday, November 06, 2011 01:37:52 Jesse Phillips wrote:
> On Sat, 05 Nov 2011 15:15:37 -0700, Jonathan M Davis wrote:
> > So, I should probably add the question more explicitly, what exactly
> > does using --rebase gain other than not having the extra commit message?
> > Why is it better?
> > 
> > - Jonathan M Davis
> 
> My quick search:
> 
> http://book.git-scm.com/4_rebasing.html
> 
> Suggests that it will recreate all the changes at the point of merge
> rather than having a commit with two parents. This would mean the history
> shows all changes of a branch at the point of merge rather intermixed
> based on date.
> 
> One downside to this is that it is a form of history rewrite. And if I
> understand how git works, this means that the branch in SomeOnes
> repository will not correspond to any commits in the rebased master.
> Meaning pulling the latest Phobos into said branch wouldn't work. Usually
> after a merge the branch would be dead anyway.
> 
> I don't know if it is done elsewhere but the general rule is not to
> rewrite history in a published repository, this would be doing just that,
> so I would not recommend it.

Rebasing, I understand. Rebasing happens often enough in pull requests. It 
affects branches that way, not master, so I don't think that it's really all 
that big a deal - particularly when such branchs frequently created just for 
that pull request and are deleted aftewards. It's rebasing master in the main 
repository that definitely should _never_ happen without a _very_, _very_, 
_very_ good reason.

However, what the OP is looking for specifically, is that a rebase be done when 
merging into the main repository, and I don't see what the real benefit of that 
is. The commits lose their original date and are no longer interspersed, which 
could be good or bad, depending on what you're looking for. It gets rid of the 
extra commit for the merge, which is nice, but not worth the extra effort of 
doing the merge manually IMHO. So, while I understand rebasing, I don't 
understand why the OP thinks that using --rebase with merge is such an 
improvement.

- Jonathan M Davis


More information about the Digitalmars-d mailing list