Git development
 help / color / mirror / Atom feed
* git svn rebase - could not detach HEAD
@ 2008-08-07  6:49 Tony Stubbs
  2008-08-07  7:19 ` Tony Stubbs
  2008-08-07  7:20 ` Junio C Hamano
  0 siblings, 2 replies; 7+ messages in thread
From: Tony Stubbs @ 2008-08-07  6:49 UTC (permalink / raw)
  To: git

Having trouble rebasing against svn off a clean repo.

I am using windows / cygwin.

Here's the output:

stubbsa@VFNZV95336 /cygdrive/c/dev
$ git status
# On branch master
nothing to commit (working directory clean)

stubbsa@VFNZV95336 /cygdrive/c/dev
$ git svn rebase
First, rewinding head to replay your work on top of it...
could not detach HEAD
rebase refs/remotes/git-svn: command returned error: 1


stubbsa@VFNZV95336 /cygdrive/c/dev
$

I already tried asking on the channel...
Any ideas? I'm kind of stuck as I have commits I need to dcommit.

p.s. git stash also shows:
stubbsa@VFNZV95336 /cygdrive/c/dev
$ git stash
No local changes to save

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

* Re: git svn rebase - could not detach HEAD
  2008-08-07  6:49 git svn rebase - could not detach HEAD Tony Stubbs
@ 2008-08-07  7:19 ` Tony Stubbs
  2008-08-07  7:20 ` Junio C Hamano
  1 sibling, 0 replies; 7+ messages in thread
From: Tony Stubbs @ 2008-08-07  7:19 UTC (permalink / raw)
  To: git

Some more info...:

stubbsa@VFNZV95336 /cygdrive/c/dev
$ git merge-base HEAD git-svn
5bfad5dee44fd18f7c3a39e7dcb234828c840c24

commit 5bfad5dee44fd18f7c3a39e7dcb234828c840c24
Author: boses <boses@c07779a9-5238-0410-8e60-f4d13a72d009>
Date:   Thu Aug 7 01:28:44 2008 +0000

    Siebel Java Interface Merged

    git-svn-id:
http://10.107.6.150/repos/portal/oasis/branches/oasis-cr@3273
c07779a9-5238-0410-8e60-f4d13a72d009

$ git branch -a
  emailTemplateWork
  hibernate
  integration
* master
  git-svn
  git-svn@1775
  git-svn@2473
  laptop/emailTemplateWork
  laptop/hibernate
  laptop/master
  temp/master


stubbsa@VFNZV95336 /cygdrive/c/dev
$ git checkout hibernate
Switched to branch "hibernate"

stubbsa@VFNZV95336 /cygdrive/c/dev
$ git checkout master
Checking out files: 100% (295/295), done.
Switched to branch "master"

stubbsa@VFNZV95336 /cygdrive/c/dev
$ git svn rebase
First, rewinding head to replay your work on top of it...
could not detach HEAD
rebase refs/remotes/git-svn: command returned error: 1

stubbsa@VFNZV95336 /cygdrive/c/dev
$ git rebase
fatal: Needed a single revision
invalid upstream

stubbsa@VFNZV95336 /cygdrive/c/dev
$ git rebase git-svn
First, rewinding head to replay your work on top of it...
could not detach HEAD

2008/8/7 Tony Stubbs <antony.stubbs@gmail.com>:
> Having trouble rebasing against svn off a clean repo.
>
> I am using windows / cygwin.
>
> Here's the output:
>
> stubbsa@VFNZV95336 /cygdrive/c/dev
> $ git status
> # On branch master
> nothing to commit (working directory clean)
>
> stubbsa@VFNZV95336 /cygdrive/c/dev
> $ git svn rebase
> First, rewinding head to replay your work on top of it...
> could not detach HEAD
> rebase refs/remotes/git-svn: command returned error: 1
>
>
> stubbsa@VFNZV95336 /cygdrive/c/dev
> $
>
> I already tried asking on the channel...
> Any ideas? I'm kind of stuck as I have commits I need to dcommit.
>
> p.s. git stash also shows:
> stubbsa@VFNZV95336 /cygdrive/c/dev
> $ git stash
> No local changes to save
>



-- 
___________________________
http://stubbisms.wordpress.com/

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

* Re: git svn rebase - could not detach HEAD
  2008-08-07  6:49 git svn rebase - could not detach HEAD Tony Stubbs
  2008-08-07  7:19 ` Tony Stubbs
@ 2008-08-07  7:20 ` Junio C Hamano
  2008-08-07  7:33   ` Tony Stubbs
  1 sibling, 1 reply; 7+ messages in thread
From: Junio C Hamano @ 2008-08-07  7:20 UTC (permalink / raw)
  To: Tony Stubbs; +Cc: git

"Tony Stubbs" <antony.stubbs@gmail.com> writes:

> $ git svn rebase
> First, rewinding head to replay your work on top of it...
> could not detach HEAD
> rebase refs/remotes/git-svn: command returned error: 1

It is somewhat unfortunate that git-svn does not say anything about what
ref it is trying to rebase onto here.  I do not use git-svn nor know much
about the code myself, but here are some ideas.

 * Try "rebase --dry-run" and see what you see from this part of the code:

        sub cmd_rebase {
                ...
                if ($_dry_run) {
                        print "Remote Branch: " . $gs->refname . "\n";
                        print "SVN URL: " . $url . "\n";
                        return;
                }

   Most interesting is what $gs->refname is;

 * If you are using recent enough git (I think 1.5.2 is Ok), update your
   copy of git-rebase like this, so that you would at least see *why* you
   cannot detach HEAD.  It is possible that git-svn is giving a nonsense
   ref to detach to.

diff --git a/git-rebase.sh b/git-rebase.sh
index e2d85ee..7825f88 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -376,9 +376,7 @@ fi
 
 # Detach HEAD and reset the tree
 echo "First, rewinding head to replay your work on top of it..."
-git checkout "$onto^0" >/dev/null 2>&1 ||
-	die "could not detach HEAD"
-# git reset --hard "$onto^0"
+git checkout -q "$onto^0" || die "could not detach HEAD"
 
 # If the $onto is a proper descendant of the tip of the branch, then
 # we just fast forwarded.

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

* Re: git svn rebase - could not detach HEAD
  2008-08-07  7:20 ` Junio C Hamano
@ 2008-08-07  7:33   ` Tony Stubbs
  2008-08-07  7:41     ` Björn Steinbrink
  0 siblings, 1 reply; 7+ messages in thread
From: Tony Stubbs @ 2008-08-07  7:33 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Ok, woah. that's really weird... note the strange behaviour of
git-clean (i had my ide open, then clossed it. but it still acted
strange)

that seems to have got it. so are you going to apply that patch to git proper?

stubbsa@VFNZV95336 /cygdrive/c/dev
$ git --version
git version 1.5.6.4

stubbsa@VFNZV95336 /cygdrive/c/dev
$ git svn rebase --dry-run
Remote Branch: refs/remotes/git-svn
SVN URL: http://10.107.6.150/repos/portal/oasis/branches/oasis-cr

stubbsa@VFNZV95336 /cygdrive/c/dev
$ git rebase git-svn
First, rewinding head to replay your work on top of it...
error: Untracked working tree file
'webnonline-db-access/target/hanson-db-access-1.0.jar' would be
overwritten by merge.
could not detach HEAD

stubbsa@VFNZV95336 /cygdrive/c/dev
$ git clean -df
Removing .temp/
Removing Libraries/release/
Removing SiebelJavaInterface/release/
Removing SiebelJavaInterface/src/generated/
Removing SiebelJavaInterface/tmp/
Removing Utilities/.apt_src/
Removing Utilities/build/
Removing VFSecurityProviders/build/
Removing VFSecurityProviders/vfSecurityProviders.jar
Removing VFSecurityProviders/vfSecurityProviders_r1_00_01.jar

stubbsa@VFNZV95336 /cygdrive/c/dev
$ git rebase git-svn
First, rewinding head to replay your work on top of it...
error: Untracked working tree file
'webnonline-db-access/target/hanson-db-access-1.0.jar' would be
overwritten by merge.
could not detach HEAD

stubbsa@VFNZV95336 /cygdrive/c/dev
$ git clean -df
Removing Utilities/.apt_src/
Removing Utilities/build/

stubbsa@VFNZV95336 /cygdrive/c/dev
$ git clean -df
Removing Utilities/.apt_src/
Removing Utilities/build/

stubbsa@VFNZV95336 /cygdrive/c/dev
$ git clean -df

stubbsa@VFNZV95336 /cygdrive/c/dev
$ git rebase git-svn
First, rewinding head to replay your work on top of it...
error: Untracked working tree file
'webnonline-db-access/target/hanson-db-access-1.0.jar' would be
overwritten by merge.
could not detach HEAD

<manually deleted "untracked file" here>

stubbsa@VFNZV95336 /cygdrive/c/dev
$ git rebase git-svn
First, rewinding head to replay your work on top of it...
Applying removed generated files
Applying Changed maven call method
Applying Switched dependency to project from jar
Applying Added dependency build
Applying Updated notification service build target

2008/8/7 Junio C Hamano <gitster@pobox.com>:
> "Tony Stubbs" <antony.stubbs@gmail.com> writes:
>
>> $ git svn rebase
>> First, rewinding head to replay your work on top of it...
>> could not detach HEAD
>> rebase refs/remotes/git-svn: command returned error: 1
>
> It is somewhat unfortunate that git-svn does not say anything about what
> ref it is trying to rebase onto here.  I do not use git-svn nor know much
> about the code myself, but here are some ideas.
>
>  * Try "rebase --dry-run" and see what you see from this part of the code:
>
>        sub cmd_rebase {
>                ...
>                if ($_dry_run) {
>                        print "Remote Branch: " . $gs->refname . "\n";
>                        print "SVN URL: " . $url . "\n";
>                        return;
>                }
>
>   Most interesting is what $gs->refname is;
>
>  * If you are using recent enough git (I think 1.5.2 is Ok), update your
>   copy of git-rebase like this, so that you would at least see *why* you
>   cannot detach HEAD.  It is possible that git-svn is giving a nonsense
>   ref to detach to.
>
> diff --git a/git-rebase.sh b/git-rebase.sh
> index e2d85ee..7825f88 100755
> --- a/git-rebase.sh
> +++ b/git-rebase.sh
> @@ -376,9 +376,7 @@ fi
>
>  # Detach HEAD and reset the tree
>  echo "First, rewinding head to replay your work on top of it..."
> -git checkout "$onto^0" >/dev/null 2>&1 ||
> -       die "could not detach HEAD"
> -# git reset --hard "$onto^0"
> +git checkout -q "$onto^0" || die "could not detach HEAD"
>
>  # If the $onto is a proper descendant of the tip of the branch, then
>  # we just fast forwarded.
>



-- 
___________________________
http://stubbisms.wordpress.com/

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

* Re: git svn rebase - could not detach HEAD
  2008-08-07  7:33   ` Tony Stubbs
@ 2008-08-07  7:41     ` Björn Steinbrink
  2008-08-07 12:53       ` Tony Stubbs
  0 siblings, 1 reply; 7+ messages in thread
From: Björn Steinbrink @ 2008-08-07  7:41 UTC (permalink / raw)
  To: Tony Stubbs; +Cc: Junio C Hamano, git

On 2008.08.07 19:33:36 +1200, Tony Stubbs wrote:
> Ok, woah. that's really weird... note the strange behaviour of
> git-clean (i had my ide open, then clossed it. but it still acted
> strange)
> 
> that seems to have got it. so are you going to apply that patch to git proper?

It already is.

> stubbsa@VFNZV95336 /cygdrive/c/dev
> $ git clean -df
> Removing Utilities/.apt_src/
> Removing Utilities/build/
> 
> stubbsa@VFNZV95336 /cygdrive/c/dev
> $ git clean -df
> 
> stubbsa@VFNZV95336 /cygdrive/c/dev
> $ git rebase git-svn
> First, rewinding head to replay your work on top of it...
> error: Untracked working tree file
> 'webnonline-db-access/target/hanson-db-access-1.0.jar' would be
> overwritten by merge.
> could not detach HEAD
> 
> <manually deleted "untracked file" here>

Maybe you're ignoring that file? git clean deletes ignored files only if
you use -x/-X.

Björn

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

* Re: git svn rebase - could not detach HEAD
  2008-08-07  7:41     ` Björn Steinbrink
@ 2008-08-07 12:53       ` Tony Stubbs
  2008-08-07 14:24         ` Daniel Barkalow
  0 siblings, 1 reply; 7+ messages in thread
From: Tony Stubbs @ 2008-08-07 12:53 UTC (permalink / raw)
  To: Björn Steinbrink; +Cc: Junio C Hamano, git

2008/8/7 Björn Steinbrink <B.Steinbrink@gmx.de>:
>> that seems to have got it. so are you going to apply that patch to git proper?
>
> It already is.

Great!

>> <manually deleted "untracked file" here>
>
> Maybe you're ignoring that file? git clean deletes ignored files only if
> you use -x/-X.
>
> Björn
>

That's probably it, I'll try it tomorrow. However, that could be a
problem. There's ignored files I don't want to keep (build artifacts),
and there's ignored files I do want to keep (i.e. .metadata).
Is there a good solution?

-- 
___________________________
http://stubbisms.wordpress.com/

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

* Re: git svn rebase - could not detach HEAD
  2008-08-07 12:53       ` Tony Stubbs
@ 2008-08-07 14:24         ` Daniel Barkalow
  0 siblings, 0 replies; 7+ messages in thread
From: Daniel Barkalow @ 2008-08-07 14:24 UTC (permalink / raw)
  To: Tony Stubbs; +Cc: Björn Steinbrink, Junio C Hamano, git

[-- Attachment #1: Type: TEXT/PLAIN, Size: 958 bytes --]

On Fri, 8 Aug 2008, Tony Stubbs wrote:

> >> <manually deleted "untracked file" here>
> >
> > Maybe you're ignoring that file? git clean deletes ignored files only if
> > you use -x/-X.
> >
> > Björn
> >
> 
> That's probably it, I'll try it tomorrow. However, that could be a
> problem. There's ignored files I don't want to keep (build artifacts),
> and there's ignored files I do want to keep (i.e. .metadata).
> Is there a good solution?

There's only a problem if there's some reason you specifically want to not 
keep an ignored file; this is usually only an issue when you're trying to 
merge/rebase with a branch that has it tracked, at which point you have to 
decide whether to add your version and merge or remove your version. 
Ideally, git would tell you when the file that's in the way is ignored, 
which would probably help you know what's going on, but it's tricky to get 
that information there.

	-Daniel
*This .sig left intentionally blank*

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

end of thread, other threads:[~2008-08-07 14:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-07  6:49 git svn rebase - could not detach HEAD Tony Stubbs
2008-08-07  7:19 ` Tony Stubbs
2008-08-07  7:20 ` Junio C Hamano
2008-08-07  7:33   ` Tony Stubbs
2008-08-07  7:41     ` Björn Steinbrink
2008-08-07 12:53       ` Tony Stubbs
2008-08-07 14:24         ` Daniel Barkalow

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox