{"thread":{"id":"22492","subject":"Question about git rebase --onto","startedAt":"2010-02-02T17:49:29Z","lastAt":"2010-02-17T11:18:37Z","messageCount":12,"participants":["Pascal Obry","Junio C Hamano","Tay Ray Chuan"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"133368","messageId":"4B6865A9.60603@obry.net","threadId":"22492","inReplyTo":null,"subject":"Question about git rebase --onto","fromName":"Pascal Obry","fromEmail":"pascal@obry.net","sentAt":"2010-02-02T17:49:29Z","receivedAt":"2010-02-02T17:49:29Z","isPatch":false,"sender":{"key":"pascal@obry.net","avatar":"https://avatars.githubusercontent.com/u/467069?v=4"},"body":"\nIt seems to me that:\n\n   $ git co topic\n   $ git rebase --onto master topic~2 topic\n\nUsed to do the job and rebase the topic branch as expected. Today when I\ntried with 1.7.0.rc1.10.gb8bb after the rebase above I was left on a\ndetached head.\n\nIs my recollection wrong? Has this been changed recently?\n\nThanks,\nPascal.\n\n-- \n\n--|------------------------------------------------------\n--| Pascal Obry                           Team-Ada Member\n--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE\n--|------------------------------------------------------\n--|    http://www.obry.net  -  http://v2p.fr.eu.org\n--| \"The best way to travel is by means of imagination\"\n--|\n--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B\n"},{"id":"133369","messageId":"7v636f7biw.fsf@alter.siamese.dyndns.org","threadId":"22492","inReplyTo":"4B6865A9.60603@obry.net","subject":"Re: Question about git rebase --onto","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-02-02T18:11:51Z","receivedAt":"2010-02-02T18:11:51Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pascal Obry <pascal@obry.net> writes:\n\n> It seems to me that:\n>\n>    $ git co topic\n>    $ git rebase --onto master topic~2 topic\n>\n> Used to do the job and rebase the topic branch as expected. Today when I\n> tried with 1.7.0.rc1.10.gb8bb after the rebase above I was left on a\n> detached head.\n>\n> Is my recollection wrong? Has this been changed recently?\n\nEither a recent bug or a user error, I think, as we didn't intend to\nchange.  My quick manual test didn't show such a bug but rebase is one\nof the areas that acquired new code recently.\n\nPossible user errors I can think of are:\n\n - If 'topic' is not a local branch, the result will be on a detached\n   HEAD, as you are starting from a detached HEAD (i.e. 'topic' could be a\n   tag);\n\n - Until you resolved and said \"rebase --continue\" (or --skip) to allow it\n   to conclude the rebase when the operation conflicted, you would be on a\n   detached HEAD.\n"},{"id":"133371","messageId":"7vd40n5wry.fsf@alter.siamese.dyndns.org","threadId":"22492","inReplyTo":"7v636f7biw.fsf@alter.siamese.dyndns.org","subject":"Re: Question about git rebase --onto","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-02-02T18:15:45Z","receivedAt":"2010-02-02T18:15:45Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Possible user errors I can think of are:\n>\n>  - If 'topic' is not a local branch, the result will be on a detached\n>    HEAD, as you are starting from a detached HEAD (i.e. 'topic' could be a\n>    tag);\n>\n>  - Until you resolved and said \"rebase --continue\" (or --skip) to allow it\n>    to conclude the rebase when the operation conflicted, you would be on a\n>    detached HEAD.\n\nJust to clarify, these things are _not_ errors at all.  What I meant by\n\"user error\" was to notice that the HEAD is detached in these cases (which\nis not an error) and panicking (which is).  Both of these are normal\nprocedures and sane states.\n"},{"id":"133372","messageId":"4B686CAC.7020103@obry.net","threadId":"22492","inReplyTo":"7v636f7biw.fsf@alter.siamese.dyndns.org","subject":"Re: Question about git rebase --onto","fromName":"Pascal Obry","fromEmail":"pascal@obry.net","sentAt":"2010-02-02T18:19:24Z","receivedAt":"2010-02-02T18:19:24Z","isPatch":false,"sender":{"key":"pascal@obry.net","avatar":"https://avatars.githubusercontent.com/u/467069?v=4"},"body":"Junio,\n\n> Possible user errors I can think of are:\n> \n>  - If 'topic' is not a local branch, the result will be on a detached\n>    HEAD, as you are starting from a detached HEAD (i.e. 'topic' could be a\n>    tag);\n\nI'm not on this case.\n\n>  - Until you resolved and said \"rebase --continue\" (or --skip) to allow it\n>    to conclude the rebase when the operation conflicted, you would be on a\n>    detached HEAD.\n\nI'm not in this case either.\n\nPascal.\n\n-- \n\n--|------------------------------------------------------\n--| Pascal Obry                           Team-Ada Member\n--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE\n--|------------------------------------------------------\n--|    http://www.obry.net  -  http://v2p.fr.eu.org\n--| \"The best way to travel is by means of imagination\"\n--|\n--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B\n"},{"id":"133559","messageId":"7vhbpx3it2.fsf@alter.siamese.dyndns.org","threadId":"22492","inReplyTo":"4B686CAC.7020103@obry.net","subject":"Re: Question about git rebase --onto","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-02-04T01:12:41Z","receivedAt":"2010-02-04T01:12:41Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pascal Obry <pascal@obry.net> writes:\n\n>> Possible user errors I can think of are:\n>> ...\n> I'm not on this case.\n> ...\n> I'm not in this case either.\n\nThenk there are some _other_ differences between your situation and what I\ncan construct from your problem description:\n\n    It seems to me that:\n\n       $ git co topic\n       $ git rebase --onto master topic~2 topic\n\n    Used to do the job and rebase the topic branch as expected....\n\nwhich I tried myself before giving you a reply, and I didn't end up on a\ndetached HEAD.  But I cannot guess what that difference you are not\ntelling us is (and you probably don't know it either, I suspect).\n\nWriting reproducible test case would be a great way to diagnose this.\n"},{"id":"133613","messageId":"4B6AF9EE.3000205@obry.net","threadId":"22492","inReplyTo":"7vhbpx3it2.fsf@alter.siamese.dyndns.org","subject":"Re: Question about git rebase --onto","fromName":"Pascal Obry","fromEmail":"pascal@obry.net","sentAt":"2010-02-04T16:46:38Z","receivedAt":"2010-02-04T16:46:38Z","isPatch":false,"sender":{"key":"pascal@obry.net","avatar":"https://avatars.githubusercontent.com/u/467069?v=4"},"body":"Junio,\n\n> Writing reproducible test case would be a great way to diagnose this.\n\nI just can't reproduce now! I've tried on a second machine starting from\nthe same repository state and still can't reproduce! So either I was in\nreally bad shape last night or it was some kind of transient problem on\nmy Cygwin/Git system.\n\nSorry for the noise.\n\nPascal.\n\n-- \n\n--|------------------------------------------------------\n--| Pascal Obry                           Team-Ada Member\n--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE\n--|------------------------------------------------------\n--|    http://www.obry.net  -  http://v2p.fr.eu.org\n--| \"The best way to travel is by means of imagination\"\n--|\n--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B\n"},{"id":"133615","messageId":"7vr5p1gd2t.fsf@alter.siamese.dyndns.org","threadId":"22492","inReplyTo":"4B6AF9EE.3000205@obry.net","subject":"Re: Question about git rebase --onto","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-02-04T16:50:18Z","receivedAt":"2010-02-04T16:50:18Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pascal Obry <pascal@obry.net> writes:\n\n>> Writing reproducible test case would be a great way to diagnose this.\n>\n> I just can't reproduce now! I've tried on a second machine starting from\n> the same repository state and still can't reproduce! So either I was in\n> really bad shape last night or it was some kind of transient problem on\n> my Cygwin/Git system.\n>\n> Sorry for the noise.\n\nDon't be sorry.  We need to know about issues, and sporadic failures, if\nthey are real, are the ones that affects people the worst way.\n\nThanks for spending time to reproduce---and please do report (and preserve\nthe reproducible state if possible) when you see a breakage (like this\none, or some other form) next time.\n"},{"id":"134853","messageId":"4B7BB604.20205@obry.net","threadId":"22492","inReplyTo":"7vr5p1gd2t.fsf@alter.siamese.dyndns.org","subject":"Re: Question about git rebase --onto","fromName":"Pascal Obry","fromEmail":"pascal@obry.net","sentAt":"2010-02-17T09:25:24Z","receivedAt":"2010-02-17T09:25:24Z","isPatch":false,"sender":{"key":"pascal@obry.net","avatar":"https://avatars.githubusercontent.com/u/467069?v=4"},"body":"Junio,\n\n> Thanks for spending time to reproduce---and please do report (and preserve\n> the reproducible state if possible) when you see a breakage (like this\n> one, or some other form) next time.\n\nI have a reproducer this time.\n\n$ git --version\ngit version 1.7.0.14.g7e948\n\n$ git clone http://git.sv.gnu.org/r/v2p.git\n$ cd v2p/\n\n$ git branch v3.1 origin/v3.1\n\n$ git co -b po/new-context-support origin/po/new-context-support\n\n$ git cherry -v master po/new-context-support\n+ bb8647179385ecf2a5053da9a4af9e24437a5b34 Modifications to use the new\nAWS's context implementation.\n+ 12db018f5a448869b1679550cb2fd0e33336a6c9 Minor reformatting.\n+ f7888edb7572ca6d62f35e594d231c7974bc9515 Fix testsuite to pass with\nthe new context support.\n\n$ git rebase --onto v3.1 HEAD~3 HEAD\n\nAt this point I'm on a detached HEAD.\n\n$ git status\n# Not currently on any branch.\nnothing to commit (working directory clean)\n\nLet me know if you need additional information.\n\nPascal.\n\n-- \n\n--|------------------------------------------------------\n--| Pascal Obry                           Team-Ada Member\n--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE\n--|------------------------------------------------------\n--|    http://www.obry.net  -  http://v2p.fr.eu.org\n--| \"The best way to travel is by means of imagination\"\n--|\n--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B\n"},{"id":"134856","messageId":"be6fef0d1002170219j27c79877k830f8d853719ea2e@mail.gmail.com","threadId":"22492","inReplyTo":"4B7BB604.20205@obry.net","subject":"Re: Question about git rebase --onto","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2010-02-17T10:19:42Z","receivedAt":"2010-02-17T10:19:42Z","isPatch":false,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"Hi,\n\nOn Wed, Feb 17, 2010 at 5:25 PM, Pascal Obry <pascal@obry.net> wrote:\n> $ git clone http://git.sv.gnu.org/r/v2p.git\n\nin case anyone is wondering, the equivalent git:// url is\n\n  git://git.sv.gnu.org/v2p.git\n\n> $ git rebase --onto v3.1 HEAD~3 HEAD\n\nWhy do you add the last parameter (\"HEAD\")? If I run the rebase\nwithout it, it works fine (ie. not on a detached HEAD).\n\n-- \nCheers,\nRay Chuan\n"},{"id":"134858","messageId":"4B7BC4A7.5070902@obry.net","threadId":"22492","inReplyTo":"be6fef0d1002170219j27c79877k830f8d853719ea2e@mail.gmail.com","subject":"Re: Question about git rebase --onto","fromName":"Pascal Obry","fromEmail":"pascal@obry.net","sentAt":"2010-02-17T10:27:51Z","receivedAt":"2010-02-17T10:27:51Z","isPatch":false,"sender":{"key":"pascal@obry.net","avatar":"https://avatars.githubusercontent.com/u/467069?v=4"},"body":"Tay,\n\n> Why do you add the last parameter (\"HEAD\")? If I run the rebase\n> without it, it works fine (ie. not on a detached HEAD).\n\nRight, without the final HEAD it is working. But it ought to work with\nit too. Hence my report.\n\nPascal.\n\n-- \n\n--|------------------------------------------------------\n--| Pascal Obry                           Team-Ada Member\n--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE\n--|------------------------------------------------------\n--|    http://www.obry.net  -  http://v2p.fr.eu.org\n--| \"The best way to travel is by means of imagination\"\n--|\n--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B\n"},{"id":"134861","messageId":"be6fef0d1002170246r2b5c444cpdfce0678531564dd@mail.gmail.com","threadId":"22492","inReplyTo":"4B7BC4A7.5070902@obry.net","subject":"Re: Question about git rebase --onto","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2010-02-17T10:46:08Z","receivedAt":"2010-02-17T10:46:08Z","isPatch":false,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"Hi,\n\nOn Wed, Feb 17, 2010 at 6:27 PM, Pascal Obry <pascal@obry.net> wrote:\n>> Why do you add the last parameter (\"HEAD\")? If I run the rebase\n>> without it, it works fine (ie. not on a detached HEAD).\n>\n> Right, without the final HEAD it is working. But it ought to work with\n> it too. Hence my report.\n\nIn your original report though, you didn't say \"HEAD\"; you used a\nbranch. I quote:\n\nOn Wed, Feb 3, 2010 at 1:49 AM, Pascal Obry <pascal@obry.net> wrote:\n>\n> It seems to me that:\n>\n>   $ git co topic\n>   $ git rebase --onto master topic~2 topic\n\nI'm not trying to nit-pick, but it does matter - \"git rebase --onto\nfoo baz~x baz\" and \"git rebase --onto foo HEAD~x HEAD\" are quite\ndifferent.\n\nAccording to the docs, the last parameter <branch> specifies the\nbranch to checkout to first before the rebasing takes place.\nTherefore, I believe the behaviour you're experiencing when you\nspecify \"HEAD\" for the <branch> parameter is correct - git does a \"git\ncheckout $(git rev-parse HEAD)\", so you start the rebase on a detached\nHEAD.\n\n-- \nCheers,\nRay Chuan\n"},{"id":"134862","messageId":"4B7BD08D.4090408@obry.net","threadId":"22492","inReplyTo":"be6fef0d1002170246r2b5c444cpdfce0678531564dd@mail.gmail.com","subject":"Re: Question about git rebase --onto","fromName":"Pascal Obry","fromEmail":"pascal@obry.net","sentAt":"2010-02-17T11:18:37Z","receivedAt":"2010-02-17T11:18:37Z","isPatch":false,"sender":{"key":"pascal@obry.net","avatar":"https://avatars.githubusercontent.com/u/467069?v=4"},"body":"Tay,\n\n> I'm not trying to nit-pick, but it does matter - \"git rebase --onto\n> foo baz~x baz\" and \"git rebase --onto foo HEAD~x HEAD\" are quite\n> different.\n\nOk, so this was a misunderstanding on my side.\n\nIndeed using:\n\n$ git rebase --onto v3.1 po/new-context-support~3 po/new-context-support\n\nWorks fine! Obviously still learning Git :)\n\nThanks.\n\nPascal.\n\n-- \n\n--|------------------------------------------------------\n--| Pascal Obry                           Team-Ada Member\n--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE\n--|------------------------------------------------------\n--|    http://www.obry.net  -  http://v2p.fr.eu.org\n--| \"The best way to travel is by means of imagination\"\n--|\n--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B\n"}]}