[BUG] git rebase is confuse if conflict resolution doesn't produce diff

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

[BUG] git rebase is confuse if conflict resolution doesn't produce diff

From: Guillaume Desmottes <hidden>
Date: 2016-06-15 22:45:10

To reproduce:
- Rebase a branch "foo" on a branch "bar" in a way that there is a
conflict that you have to manually resolve.
- Run git diff and see the conflict
- Edit the conflicted file and remove all the conflicting bits (that
could be a valid resolution of the conflict)
- Now git diff produces an empty diff
- git add $CONFLICTED_FILE  as you have resolve the conflict
- git rebase --continue

You get the following error:
No changes - did you forget to use 'git add'?

git status is empty as the conflict was resolved.

A simple workaround is to add a dummy blank line in the conflicted file
so the diff is not empty.


	G.

Re: [BUG] git rebase is confuse if conflict resolution doesn't produce diff

From: Stephan Beyer <hidden>
Date: 2016-06-15 22:45:10

Hi,

Guillaume Desmottes wrote:
To reproduce:
- Rebase a branch "foo" on a branch "bar" in a way that there is a
conflict that you have to manually resolve.
- Run git diff and see the conflict
- Edit the conflicted file and remove all the conflicting bits (that
could be a valid resolution of the conflict)
- Now git diff produces an empty diff
- git add $CONFLICTED_FILE  as you have resolve the conflict
- git rebase --continue

You get the following error:
No changes - did you forget to use 'git add'?

git status is empty as the conflict was resolved.

A simple workaround is to add a dummy blank line in the conflicted file
so the diff is not empty.
I think this is no bug, since you would generate an empty commit, i.e
a commit with no changes at all. Usually you do not want such commits.
So git rebase --skip is perhaps what you want.

Regards,
  Stephan

-- 
Stephan Beyer [off-list ref], PGP 0x6EDDD207FCC5040F

Re: [BUG] git rebase is confuse if conflict resolution doesn't produce diff

From: Guillaume Desmottes <hidden>
Date: 2016-06-15 22:45:10

Le vendredi 15 août 2008 à 20:24 +0200, Stephan Beyer a écrit :
Hi,

Guillaume Desmottes wrote:
quoted
To reproduce:
- Rebase a branch "foo" on a branch "bar" in a way that there is a
conflict that you have to manually resolve.
- Run git diff and see the conflict
- Edit the conflicted file and remove all the conflicting bits (that
could be a valid resolution of the conflict)
- Now git diff produces an empty diff
- git add $CONFLICTED_FILE  as you have resolve the conflict
- git rebase --continue

You get the following error:
No changes - did you forget to use 'git add'?

git status is empty as the conflict was resolved.

A simple workaround is to add a dummy blank line in the conflicted file
so the diff is not empty.
I think this is no bug, since you would generate an empty commit, i.e
a commit with no changes at all. Usually you do not want such commits.
So git rebase --skip is perhaps what you want.
Yeah, I know, that's what I did when I finally understood the problem.
But that took me more than 20 minutes before understanding what I did
wrong (I just manually resolved the conflict and wasn't aware that what
I actually wanted was to remove the commit).

Maybe in that case git rebase should suggest something like that "Seems
you want to skip this commit. Do you want to --skip it ?".


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