{"thread":{"id":"14872","subject":"git svn rebase - could not detach HEAD","startedAt":"2008-08-07T06:49:29Z","lastAt":"2008-08-07T14:24:06Z","messageCount":7,"participants":["Tony Stubbs","Junio C Hamano","Björn Steinbrink","Daniel Barkalow"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"86391","messageId":"f7d8f60b0808062349q92fffb9l33de5550250e4e13@mail.gmail.com","threadId":"14872","inReplyTo":null,"subject":"git svn rebase - could not detach HEAD","fromName":"Tony Stubbs","fromEmail":"antony.stubbs@gmail.com","sentAt":"2008-08-07T06:49:29Z","receivedAt":"2008-08-07T06:49:29Z","isPatch":false,"sender":{"key":"antony.stubbs@gmail.com","avatar":"https://gravatar.com/avatar/c5404b8c9bc4a7eea80a093cbab861fc087b6ff46cf5fd9f719e4860302fd69b?d=mp&s=160"},"body":"Having trouble rebasing against svn off a clean repo.\n\nI am using windows / cygwin.\n\nHere's the output:\n\nstubbsa@VFNZV95336 /cygdrive/c/dev\n$ git status\n# On branch master\nnothing to commit (working directory clean)\n\nstubbsa@VFNZV95336 /cygdrive/c/dev\n$ git svn rebase\nFirst, rewinding head to replay your work on top of it...\ncould not detach HEAD\nrebase refs/remotes/git-svn: command returned error: 1\n\n\nstubbsa@VFNZV95336 /cygdrive/c/dev\n$\n\nI already tried asking on the channel...\nAny ideas? I'm kind of stuck as I have commits I need to dcommit.\n\np.s. git stash also shows:\nstubbsa@VFNZV95336 /cygdrive/c/dev\n$ git stash\nNo local changes to save\n"},{"id":"86394","messageId":"f7d8f60b0808070019v2850f493md9d75df03f98dc3b@mail.gmail.com","threadId":"14872","inReplyTo":"f7d8f60b0808062349q92fffb9l33de5550250e4e13@mail.gmail.com","subject":"Re: git svn rebase - could not detach HEAD","fromName":"Tony Stubbs","fromEmail":"antony.stubbs@gmail.com","sentAt":"2008-08-07T07:19:36Z","receivedAt":"2008-08-07T07:19:36Z","isPatch":false,"sender":{"key":"antony.stubbs@gmail.com","avatar":"https://gravatar.com/avatar/c5404b8c9bc4a7eea80a093cbab861fc087b6ff46cf5fd9f719e4860302fd69b?d=mp&s=160"},"body":"Some more info...:\n\nstubbsa@VFNZV95336 /cygdrive/c/dev\n$ git merge-base HEAD git-svn\n5bfad5dee44fd18f7c3a39e7dcb234828c840c24\n\ncommit 5bfad5dee44fd18f7c3a39e7dcb234828c840c24\nAuthor: boses <boses@c07779a9-5238-0410-8e60-f4d13a72d009>\nDate:   Thu Aug 7 01:28:44 2008 +0000\n\n    Siebel Java Interface Merged\n\n    git-svn-id:\nhttp://10.107.6.150/repos/portal/oasis/branches/oasis-cr@3273\nc07779a9-5238-0410-8e60-f4d13a72d009\n\n$ git branch -a\n  emailTemplateWork\n  hibernate\n  integration\n* master\n  git-svn\n  git-svn@1775\n  git-svn@2473\n  laptop/emailTemplateWork\n  laptop/hibernate\n  laptop/master\n  temp/master\n\n\nstubbsa@VFNZV95336 /cygdrive/c/dev\n$ git checkout hibernate\nSwitched to branch \"hibernate\"\n\nstubbsa@VFNZV95336 /cygdrive/c/dev\n$ git checkout master\nChecking out files: 100% (295/295), done.\nSwitched to branch \"master\"\n\nstubbsa@VFNZV95336 /cygdrive/c/dev\n$ git svn rebase\nFirst, rewinding head to replay your work on top of it...\ncould not detach HEAD\nrebase refs/remotes/git-svn: command returned error: 1\n\nstubbsa@VFNZV95336 /cygdrive/c/dev\n$ git rebase\nfatal: Needed a single revision\ninvalid upstream\n\nstubbsa@VFNZV95336 /cygdrive/c/dev\n$ git rebase git-svn\nFirst, rewinding head to replay your work on top of it...\ncould not detach HEAD\n\n2008/8/7 Tony Stubbs <antony.stubbs@gmail.com>:\n> Having trouble rebasing against svn off a clean repo.\n>\n> I am using windows / cygwin.\n>\n> Here's the output:\n>\n> stubbsa@VFNZV95336 /cygdrive/c/dev\n> $ git status\n> # On branch master\n> nothing to commit (working directory clean)\n>\n> stubbsa@VFNZV95336 /cygdrive/c/dev\n> $ git svn rebase\n> First, rewinding head to replay your work on top of it...\n> could not detach HEAD\n> rebase refs/remotes/git-svn: command returned error: 1\n>\n>\n> stubbsa@VFNZV95336 /cygdrive/c/dev\n> $\n>\n> I already tried asking on the channel...\n> Any ideas? I'm kind of stuck as I have commits I need to dcommit.\n>\n> p.s. git stash also shows:\n> stubbsa@VFNZV95336 /cygdrive/c/dev\n> $ git stash\n> No local changes to save\n>\n\n\n\n-- \n___________________________\nhttp://stubbisms.wordpress.com/\n"},{"id":"86395","messageId":"7vd4kljnpn.fsf@gitster.siamese.dyndns.org","threadId":"14872","inReplyTo":"f7d8f60b0808062349q92fffb9l33de5550250e4e13@mail.gmail.com","subject":"Re: git svn rebase - could not detach HEAD","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-07T07:20:20Z","receivedAt":"2008-08-07T07:20:20Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Tony Stubbs\" <antony.stubbs@gmail.com> writes:\n\n> $ git svn rebase\n> First, rewinding head to replay your work on top of it...\n> could not detach HEAD\n> rebase refs/remotes/git-svn: command returned error: 1\n\nIt is somewhat unfortunate that git-svn does not say anything about what\nref it is trying to rebase onto here.  I do not use git-svn nor know much\nabout the code myself, but here are some ideas.\n\n * Try \"rebase --dry-run\" and see what you see from this part of the code:\n\n        sub cmd_rebase {\n                ...\n                if ($_dry_run) {\n                        print \"Remote Branch: \" . $gs->refname . \"\\n\";\n                        print \"SVN URL: \" . $url . \"\\n\";\n                        return;\n                }\n\n   Most interesting is what $gs->refname is;\n\n * If you are using recent enough git (I think 1.5.2 is Ok), update your\n   copy of git-rebase like this, so that you would at least see *why* you\n   cannot detach HEAD.  It is possible that git-svn is giving a nonsense\n   ref to detach to.\n\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex e2d85ee..7825f88 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -376,9 +376,7 @@ fi\n \n # Detach HEAD and reset the tree\n echo \"First, rewinding head to replay your work on top of it...\"\n-git checkout \"$onto^0\" >/dev/null 2>&1 ||\n-\tdie \"could not detach HEAD\"\n-# git reset --hard \"$onto^0\"\n+git checkout -q \"$onto^0\" || die \"could not detach HEAD\"\n \n # If the $onto is a proper descendant of the tip of the branch, then\n # we just fast forwarded.\n"},{"id":"86396","messageId":"f7d8f60b0808070033g7a322ee4w9147dd51e41850c6@mail.gmail.com","threadId":"14872","inReplyTo":"7vd4kljnpn.fsf@gitster.siamese.dyndns.org","subject":"Re: git svn rebase - could not detach HEAD","fromName":"Tony Stubbs","fromEmail":"antony.stubbs@gmail.com","sentAt":"2008-08-07T07:33:36Z","receivedAt":"2008-08-07T07:33:36Z","isPatch":false,"sender":{"key":"antony.stubbs@gmail.com","avatar":"https://gravatar.com/avatar/c5404b8c9bc4a7eea80a093cbab861fc087b6ff46cf5fd9f719e4860302fd69b?d=mp&s=160"},"body":"Ok, woah. that's really weird... note the strange behaviour of\ngit-clean (i had my ide open, then clossed it. but it still acted\nstrange)\n\nthat seems to have got it. so are you going to apply that patch to git proper?\n\nstubbsa@VFNZV95336 /cygdrive/c/dev\n$ git --version\ngit version 1.5.6.4\n\nstubbsa@VFNZV95336 /cygdrive/c/dev\n$ git svn rebase --dry-run\nRemote Branch: refs/remotes/git-svn\nSVN URL: http://10.107.6.150/repos/portal/oasis/branches/oasis-cr\n\nstubbsa@VFNZV95336 /cygdrive/c/dev\n$ git rebase git-svn\nFirst, rewinding head to replay your work on top of it...\nerror: Untracked working tree file\n'webnonline-db-access/target/hanson-db-access-1.0.jar' would be\noverwritten by merge.\ncould not detach HEAD\n\nstubbsa@VFNZV95336 /cygdrive/c/dev\n$ git clean -df\nRemoving .temp/\nRemoving Libraries/release/\nRemoving SiebelJavaInterface/release/\nRemoving SiebelJavaInterface/src/generated/\nRemoving SiebelJavaInterface/tmp/\nRemoving Utilities/.apt_src/\nRemoving Utilities/build/\nRemoving VFSecurityProviders/build/\nRemoving VFSecurityProviders/vfSecurityProviders.jar\nRemoving VFSecurityProviders/vfSecurityProviders_r1_00_01.jar\n\nstubbsa@VFNZV95336 /cygdrive/c/dev\n$ git rebase git-svn\nFirst, rewinding head to replay your work on top of it...\nerror: Untracked working tree file\n'webnonline-db-access/target/hanson-db-access-1.0.jar' would be\noverwritten by merge.\ncould not detach HEAD\n\nstubbsa@VFNZV95336 /cygdrive/c/dev\n$ git clean -df\nRemoving Utilities/.apt_src/\nRemoving Utilities/build/\n\nstubbsa@VFNZV95336 /cygdrive/c/dev\n$ git clean -df\nRemoving Utilities/.apt_src/\nRemoving Utilities/build/\n\nstubbsa@VFNZV95336 /cygdrive/c/dev\n$ git clean -df\n\nstubbsa@VFNZV95336 /cygdrive/c/dev\n$ git rebase git-svn\nFirst, rewinding head to replay your work on top of it...\nerror: Untracked working tree file\n'webnonline-db-access/target/hanson-db-access-1.0.jar' would be\noverwritten by merge.\ncould not detach HEAD\n\n<manually deleted \"untracked file\" here>\n\nstubbsa@VFNZV95336 /cygdrive/c/dev\n$ git rebase git-svn\nFirst, rewinding head to replay your work on top of it...\nApplying removed generated files\nApplying Changed maven call method\nApplying Switched dependency to project from jar\nApplying Added dependency build\nApplying Updated notification service build target\n\n2008/8/7 Junio C Hamano <gitster@pobox.com>:\n> \"Tony Stubbs\" <antony.stubbs@gmail.com> writes:\n>\n>> $ git svn rebase\n>> First, rewinding head to replay your work on top of it...\n>> could not detach HEAD\n>> rebase refs/remotes/git-svn: command returned error: 1\n>\n> It is somewhat unfortunate that git-svn does not say anything about what\n> ref it is trying to rebase onto here.  I do not use git-svn nor know much\n> about the code myself, but here are some ideas.\n>\n>  * Try \"rebase --dry-run\" and see what you see from this part of the code:\n>\n>        sub cmd_rebase {\n>                ...\n>                if ($_dry_run) {\n>                        print \"Remote Branch: \" . $gs->refname . \"\\n\";\n>                        print \"SVN URL: \" . $url . \"\\n\";\n>                        return;\n>                }\n>\n>   Most interesting is what $gs->refname is;\n>\n>  * If you are using recent enough git (I think 1.5.2 is Ok), update your\n>   copy of git-rebase like this, so that you would at least see *why* you\n>   cannot detach HEAD.  It is possible that git-svn is giving a nonsense\n>   ref to detach to.\n>\n> diff --git a/git-rebase.sh b/git-rebase.sh\n> index e2d85ee..7825f88 100755\n> --- a/git-rebase.sh\n> +++ b/git-rebase.sh\n> @@ -376,9 +376,7 @@ fi\n>\n>  # Detach HEAD and reset the tree\n>  echo \"First, rewinding head to replay your work on top of it...\"\n> -git checkout \"$onto^0\" >/dev/null 2>&1 ||\n> -       die \"could not detach HEAD\"\n> -# git reset --hard \"$onto^0\"\n> +git checkout -q \"$onto^0\" || die \"could not detach HEAD\"\n>\n>  # If the $onto is a proper descendant of the tip of the branch, then\n>  # we just fast forwarded.\n>\n\n\n\n-- \n___________________________\nhttp://stubbisms.wordpress.com/\n"},{"id":"86397","messageId":"20080807074117.GA7648@atjola.homenet","threadId":"14872","inReplyTo":"f7d8f60b0808070033g7a322ee4w9147dd51e41850c6@mail.gmail.com","subject":"Re: git svn rebase - could not detach HEAD","fromName":"Björn Steinbrink","fromEmail":"b.steinbrink@gmx.de","sentAt":"2008-08-07T07:41:17Z","receivedAt":"2008-08-07T07:41:17Z","isPatch":false,"sender":{"key":"b.steinbrink@gmx.de","avatar":"https://avatars.githubusercontent.com/u/230962?v=4"},"body":"On 2008.08.07 19:33:36 +1200, Tony Stubbs wrote:\n> Ok, woah. that's really weird... note the strange behaviour of\n> git-clean (i had my ide open, then clossed it. but it still acted\n> strange)\n> \n> that seems to have got it. so are you going to apply that patch to git proper?\n\nIt already is.\n\n> stubbsa@VFNZV95336 /cygdrive/c/dev\n> $ git clean -df\n> Removing Utilities/.apt_src/\n> Removing Utilities/build/\n> \n> stubbsa@VFNZV95336 /cygdrive/c/dev\n> $ git clean -df\n> \n> stubbsa@VFNZV95336 /cygdrive/c/dev\n> $ git rebase git-svn\n> First, rewinding head to replay your work on top of it...\n> error: Untracked working tree file\n> 'webnonline-db-access/target/hanson-db-access-1.0.jar' would be\n> overwritten by merge.\n> could not detach HEAD\n> \n> <manually deleted \"untracked file\" here>\n\nMaybe you're ignoring that file? git clean deletes ignored files only if\nyou use -x/-X.\n\nBjörn\n"},{"id":"86410","messageId":"f7d8f60b0808070553o6f709445j9dd036f380763f6e@mail.gmail.com","threadId":"14872","inReplyTo":"20080807074117.GA7648@atjola.homenet","subject":"Re: git svn rebase - could not detach HEAD","fromName":"Tony Stubbs","fromEmail":"antony.stubbs@gmail.com","sentAt":"2008-08-07T12:53:41Z","receivedAt":"2008-08-07T12:53:41Z","isPatch":false,"sender":{"key":"antony.stubbs@gmail.com","avatar":"https://gravatar.com/avatar/c5404b8c9bc4a7eea80a093cbab861fc087b6ff46cf5fd9f719e4860302fd69b?d=mp&s=160"},"body":"2008/8/7 Björn Steinbrink <B.Steinbrink@gmx.de>:\n>> that seems to have got it. so are you going to apply that patch to git proper?\n>\n> It already is.\n\nGreat!\n\n>> <manually deleted \"untracked file\" here>\n>\n> Maybe you're ignoring that file? git clean deletes ignored files only if\n> you use -x/-X.\n>\n> Björn\n>\n\nThat's probably it, I'll try it tomorrow. However, that could be a\nproblem. There's ignored files I don't want to keep (build artifacts),\nand there's ignored files I do want to keep (i.e. .metadata).\nIs there a good solution?\n\n-- \n___________________________\nhttp://stubbisms.wordpress.com/\n"},{"id":"86417","messageId":"alpine.LNX.1.00.0808071013190.19665@iabervon.org","threadId":"14872","inReplyTo":"f7d8f60b0808070553o6f709445j9dd036f380763f6e@mail.gmail.com","subject":"Re: git svn rebase - could not detach HEAD","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2008-08-07T14:24:06Z","receivedAt":"2008-08-07T14:24:06Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Fri, 8 Aug 2008, Tony Stubbs wrote:\n\n> >> <manually deleted \"untracked file\" here>\n> >\n> > Maybe you're ignoring that file? git clean deletes ignored files only if\n> > you use -x/-X.\n> >\n> > Björn\n> >\n> \n> That's probably it, I'll try it tomorrow. However, that could be a\n> problem. There's ignored files I don't want to keep (build artifacts),\n> and there's ignored files I do want to keep (i.e. .metadata).\n> Is there a good solution?\n\nThere's only a problem if there's some reason you specifically want to not \nkeep an ignored file; this is usually only an issue when you're trying to \nmerge/rebase with a branch that has it tracked, at which point you have to \ndecide whether to add your version and merge or remove your version. \nIdeally, git would tell you when the file that's in the way is ignored, \nwhich would probably help you know what's going on, but it's tricky to get \nthat information there.\n\n\t-Daniel\n*This .sig left intentionally blank*"}]}