Re: when git-rebase -i fails to cherry-pick
Hello Johannes,
Johannes Schindelin wrote:
Show 10 quoted lines
> > - If a cherry-pick fails, it tells me to resolve my conflicts, 'git add
> > <paths>' and to do 'git commit -c $sha1id'.
> >
> > But it doesn't tell me, how I continue to rebase after that.
> >
> > 'git rebase -i --continue' works.
>
> Actually, even "git rebase --continue" works. And you do not really have
> to commit, either, just updating your index is fine. In fact, if you say
> "git reset --hard", it will skip the commit.
Show 14 quoted lines
> > - If a cherry-pick of a commit to be squashed fails, the instruction to
> > do 'git commit -c $sha1id' is wrong, because then I don't get both
> > message to squash.
>
> Yes, it is a leftover from the bad old days, when this script was called
> edit-patch-series, and I was a rebase hater.
>
> In the meantime, somebody on IRC explained to me how rebase works, and
> that rebase lovers were quite annoyed not to be able to just resolve the
> conflicts and "git rebase --continue".
>
> I'd appreciate if you prepared a patch with better explanations, and also
> reviewed the man page, if it is in good shape (and does not lie about the
> current behaviour).
It's on my todo list, but not the top item for git.
In the mean-time I found another nuisance:
After doing:
tmpdir=/tmp/repo
mkdir $tmpdir
cd $tmpdir
git init
for n in one two three four; do echo $n >> file; git add file;
git commit -m $n; done
git rebase -i HEAD~3 #squash four onto two
git rebase stops (as expected) when trying to apply four, at this stage two is already commited.
The conflicting file looks as follows:
one
two
<<<<<<< HEAD:file
=======
three
four
>>>>>>> e7fbd8f... four:file
I currently have no idea how to improve this, but I miss the information that the commit *adds* "four" and "three" is only context.
Resolving with:
echo one > file; echo two >> file; echo four >> file;
git add file; git rebase --continue
and typing a new log (e.g. two + four) git rebase stops once more (again as expected) when trying to apply three, OK, resolving the conflict is easy (one, two, three, four), git add file, git rebase --continue.
Looking at the resulting log, I have the following:
zeisberg@cassiopeia:/tmp/repo$ git log --pretty=oneline
145ce01e1cf3f4cb86cd0065c0d0d5b62b399ad4 three
cd082bca636efca17409be4d871d0971237df06c two + four
b6b985977db45e314509d94282597c2ff8029d3d two
15f8cbbb5a452b075b49f3dedbeaeb66668b8025 one
So the request to squash two + four was lost.
I will look at it when I'm done with git-sendemail ...
Best regards Uwe
--
Uwe Kleine-König
main(){char*a="main(){char*a=%c%s%c;printf(a,34,a,34%c";printf(a,34,a,34
,10);a=",10);a=%c%s%c;printf(a,34,a,34,10);}%c";printf(a,34,a,34,10);}