Re: git interactive rebase 'consume' command

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: git interactive rebase 'consume' command

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:55:49

Stephen Kelly [off-list ref] writes:
Hi there,

I find the fixup command during an interactive rebase useful.

Sometimes when cleaning up a branch, I end up in a situation like this:

 pick 07bc3c9 Good commit.
 pick 1313a5e Commit to fixup into c2f62a3.
 pick c2f62a3 Another commit.


So, I have to reorder the commits, and change 1313a5e to 'f'. An alternative 
would be to squash 's' c2f62a3 into 1313a5e and clean up the commit message. 
The problem with that is it ends up with the wrong author time information.

So, I usually reorder and then fixup, but that can also be problematic if I 
get a conflict during the re-order (which is quite likely).

I would prefer to be able to mark a commit as 'should be consumed', so that:

 pick 07bc3c9 Good commit.
 consume 1313a5e Commit to fixup into c2f62a3.
 pick c2f62a3 Another commit.

will result in 

 pick 07bc3c9 Good commit.
 pick 62a3c2f Another commit.

directly.

Any thoughts on that? 
Sorry, but I do not understand what you are trying to solve.

How can 1313a5e, which fixes misakes made in c2f62a3, come before
that commit in the first place?

Re: git interactive rebase 'consume' command

From: Stephen Kelly <hidden>
Date: 2016-06-15 22:55:49

Junio C Hamano wrote:
Sorry, but I do not understand what you are trying to solve.

How can 1313a5e, which fixes misakes made in c2f62a3, come before
that commit in the first place?
One scenario is something like this:

 Start with a clean HEAD (always a good idea :) )
 hack hack hack
 make multiple commits
 realize that a hunk you committed in an early patch belongs in a later one.
 use git rebase -i to fix it.


Is that more clear?

Thanks,

Steve.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help