git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git-svn rebase can change branches during merge?
@ 2009-03-16 20:49 Kevin Williams
  2009-03-16 22:36 ` Jan Krüger
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Williams @ 2009-03-16 20:49 UTC (permalink / raw)
  To: git

I've outlined steps where I can reproduce this bug here:
http://gist.github.com/80058

When using "git svn rebase" and there is a conflict between a local
(git) change and an upstream (svn) change, the local git repository is
left in a ghost-branch. It shouldn't change branches during a rebase,
should it? I also seem to be unable to recover from the merge
conflict, but that may be just due to the noob at the keyboard (me).

I tried working through this with some folks in the #git channel last
week but they were stumped as well.

I'm using the latest Git build from MacPorts (1.6.2.1 as of today) on
a MacbookPro with OS X 10.5.6 (fully updated with all patches)

-- 
Cheers,

Kevin Williams

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: git-svn rebase can change branches during merge?
  2009-03-16 20:49 git-svn rebase can change branches during merge? Kevin Williams
@ 2009-03-16 22:36 ` Jan Krüger
  2009-03-17  4:34   ` Kevin Williams
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Krüger @ 2009-03-16 22:36 UTC (permalink / raw)
  To: Kevin Williams; +Cc: git

Hi Kevin,

> I've outlined steps where I can reproduce this bug here:
> http://gist.github.com/80058
> 
> When using "git svn rebase" and there is a conflict between a local
> (git) change and an upstream (svn) change, the local git repository is
> left in a ghost-branch. It shouldn't change branches during a rebase,
> should it? I also seem to be unable to recover from the merge
> conflict, but that may be just due to the noob at the keyboard (me).

rebase doesn't actually switch to another branch here, but it does
detach HEAD. To get back to a state you can work from, it's a simple
case of following the instructions rebase outputs:

1) edit conflicted files to fix the conflicts.
2) stage new versions of files (e.g. git add file.txt)
3) git rebase --continue

Here's what happens:

jast@perceptron 1% cat test.txt
<<<<<<< HEAD:test.txt
git svn rebase blows up here
=======
hello from svn
hello from git
>>>>>>> add to txt file from git:test.txt
jast@perceptron % git branch
* (no branch)
  master
jast@perceptron % vim test.txt
[...]
jast@perceptron % git add test.txt
jast@perceptron % git rebase --continue
Applying: add to txt file from git
jast@perceptron % git branch
* master
jast@perceptron %

Make sense?
-Jan

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: git-svn rebase can change branches during merge?
  2009-03-16 22:36 ` Jan Krüger
@ 2009-03-17  4:34   ` Kevin Williams
  0 siblings, 0 replies; 3+ messages in thread
From: Kevin Williams @ 2009-03-17  4:34 UTC (permalink / raw)
  To: Jan Krüger; +Cc: git

On Mon, Mar 16, 2009 at 4:36 PM, Jan Krüger <jk@jk.gs> wrote:
> Hi Kevin,
>
>> I've outlined steps where I can reproduce this bug here:
>> http://gist.github.com/80058
>>
>> When using "git svn rebase" and there is a conflict between a local
>> (git) change and an upstream (svn) change, the local git repository is
>> left in a ghost-branch. It shouldn't change branches during a rebase,
>> should it? I also seem to be unable to recover from the merge
>> conflict, but that may be just due to the noob at the keyboard (me).
>
> rebase doesn't actually switch to another branch here, but it does
> detach HEAD. To get back to a state you can work from, it's a simple
> case of following the instructions rebase outputs:
>
> 1) edit conflicted files to fix the conflicts.
> 2) stage new versions of files (e.g. git add file.txt)
> 3) git rebase --continue
>
> Here's what happens:
>
> jast@perceptron 1% cat test.txt
> <<<<<<< HEAD:test.txt
> git svn rebase blows up here
> =======
> hello from svn
> hello from git
>>>>>>>> add to txt file from git:test.txt
> jast@perceptron % git branch
> * (no branch)
>  master
> jast@perceptron % vim test.txt
> [...]
> jast@perceptron % git add test.txt
> jast@perceptron % git rebase --continue
> Applying: add to txt file from git
> jast@perceptron % git branch
> * master
> jast@perceptron %
>
> Make sense?
> -Jan
>

I think so. Thanks for the detailed examples.

I think sometimes I was committing after adding the fixed files, which
would seem to succeed but then the 'git rebase --continue' would blow
up and I couldn't get back to master without 'git rebase --abort'.

Thanks again!


-- 
Cheers,

Kevin Williams

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-03-17  4:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-16 20:49 git-svn rebase can change branches during merge? Kevin Williams
2009-03-16 22:36 ` Jan Krüger
2009-03-17  4:34   ` Kevin Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).