Re: Newbie: report of first experience with git-rebase.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sergei Organov, Wed, Oct 31, 2007 20:39:06 +0100:
> $ git rebase --continue
> You must edit all merge conflicts and then
> mark them as resolved using git add
> 
> me> Nice helpful message, -- need to do git-add
> 
> $ git add Documentation/core-tutorial.txt
> $ git rebase --continue
> 
> Applying Use new syntax (-m option) for git-merge.
> 
> No changes - did you forget to use 'git add'?

This "No changes" was meant as a hint

> When you have resolved this problem run "git rebase --continue".
> If you would prefer to skip this patch, instead run "git rebase --skip".
> To restore the original branch and stop rebasing run "git rebase --abort".
> 
> me> What?! I just did the git-add! Moreover, before I did git-add, the
> me> error was different and helpful. Something went wrong? 

Well, you edited you tree to look exactly like it already is.

> me> No luck :( A few seconds of thinking... Hmm... no-op patch, do I
> me> need to skip it? Let's try the --skip:
> 
> $ git rebase --skip

Exactly.

> Applying Fix SYNOPSIS.
> 
> error: patch failed: Documentation/git-merge.txt:10
> error: Documentation/git-merge.txt: patch does not apply
> Using index info to reconstruct a base tree...
> Falling back to patching base and 3-way merge...
> Auto-merged Documentation/git-merge.txt
> CONFLICT (content): Merge conflict in Documentation/git-merge.txt
> Failed to merge in the changes.
> Patch failed at 0003.
> 
> When you have resolved this problem run "git rebase --continue".
> If you would prefer to skip this patch, instead run "git rebase --skip".
> To restore the original branch and stop rebasing run "git rebase --abort".
> 
> me> Aha, that's it! But why git didn't just skip the no-op patch
> me> automatically? Well, anyway , now I have a new expected conflict,

it was not a noop patch before you resolved the conflict.

> me> and I'm sure I just want to skip this patch, so let's try exactly
> me> that:
> 
> $ git rebase --skip
> Dirty index: cannot apply patches (dirty: Documentation/git-merge.txt)

Well... This one kind of hard: git-rebase _cannot_ know whether it is
safe to just drop all changes in the index and work tree (you could
have made the changes on purpose). It was decided not to drop
anything. You always can do

    $ git reset --hard # kills all changes in index and work tree
    $ git rebase --skip

(or maybe git-rebase is just too careful...)

> me> No luck :( Well, let's go the long way, -- edit conflicting
> me> Documentation/git-merge.txt (so that it matches upstream),
> 
> $ git add Documentation/git-merge.txt
> $ git rebase --skip
> Nothing to do.
> 
> me> Well, I already knew this will work, but why should I edit the file
> me> and then git-add it just to skip the patch? Is there better way?
> me> Anyway, the "Nothing to do." above is slightly confusing, -- did it
> me> actually skip the patch? So let's check the result:

Yes. It was the last commit. You were just too unlucky to hit all the
hard cases your first day.

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux