Thread (9 messages) flat view 9 messages, 5 authors, 2016-06-15

Re: rebase --continue confusion

From: Tim Visher <hidden>
Date: 2016-06-15 22:48:52

On Sat, May 29, 2010 at 8:59 PM, Dale Rowley [off-list ref] wrote:
I ran into a conflict while running 'git rebase branch1 branch2'. So I edited
the file and resolved the conflicts, and then ran 'git add <file>; git rebase
--continue'. This printed out a message 'No changes - did you forget to use git
add?'. I thought 'No, I'm pretty sure I ran git add' and I assumed I had run
into a bug in git because I didn't see how this conflict was different than any
others I had successfully resolved. The next time this problem came up, the
light finally came on and I realized that I should just run 'git rebase --skip'
because when I resolved the conflicts, I had basically undone all changes that
the patch would introduce.

OK, so there isn't a bug in git, but since then I've seen co-workers stumped by
this same problem. So maybe it would help to clarify the message? Maybe
something like "The index is in the same state as it was before the patch was
applied - refusing to make an empty commit. Did you forget to use 'git add'? Or
maybe you should use 'git rebase --skip'?"
2 things.

1. I agree that the message could be more informative, especially
given the context.  If the the patch looks exactly like the last patch
applied now that you've edited it during a rebase, it would _almost_
be safe to assume that you meant to skip and just didn't know you were
going to before hand.

2. `git status` should show you that you had nothing to commit, which
would completely explain why `git rebase --continue` threw out the
message it did.  I'm in the habit of running `git st` continually and
it often helps me catch this sort of thing where I thought I'd added
something to the index or forgot that I'd changed some file between
the last time I'd updated the index or something along those lines.
This is just sort of a recommendation on a way to modify your work
flow that may help you and your coworkers in the future.  YMMV.

-- 

In Christ,

Timmy V.

http://burningones.com/
http://five.sentenc.es/ - Spend less time on e-mail
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help