[BUG] rebase should desambiguate abbreviated hashes before starting

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

[BUG] rebase should desambiguate abbreviated hashes before starting

From: Yann Dirson <hidden>
Date: 2016-06-15 22:57:56

I just ran into a funny edge-case when doing a long rebase: one of
the rewritten commits got a sha1 starting with one of the abbreviated
sha1's of a commit still to be applied.

As a result, the rebase stopped with a funny-looking "short SHA1 ... was
ambiguous", which would not have occured if the shortened sha1's presented
to the user were expanded to full sha1's before starting the rebase.

-- 
Yann Dirson - Bertin Technologies

Re: [BUG] rebase should desambiguate abbreviated hashes before starting

From: David <hidden>
Date: 2016-06-15 22:57:56

On 27 June 2013 18:55, Yann Dirson [off-list ref] wrote:
I just ran into a funny edge-case when doing a long rebase: one of
the rewritten commits got a sha1 starting with one of the abbreviated
sha1's of a commit still to be applied.

As a result, the rebase stopped with a funny-looking "short SHA1 ... was
ambiguous", which would not have occured if the shortened sha1's presented
to the user were expanded to full sha1's before starting the rebase.
I do many large rebases, and I have experienced this about a dozen times
in the last few years.

I'm not sure that rebase could predict the new hashes without actually creating
the prior commits? So maybe the "short" SHA1 is "too short"?

When the rebase stops with this message, my workaround is:

The last (failed) entry is in .git/rebase-merge/done
The next todo is the top entry in .git/rebase-merge/git-rebase-todo
I enter the short SHA1 in gitk to find the long SHA1.
I edit both the above files to move the failed entry back into the top
of the todo file, with the long SHA1
And then git rebase --continue
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help