{"thread":{"id":"36205","subject":"[PATCH] git-rebase: Teach rebase \"-\" shorthand.","startedAt":"2014-03-18T08:44:28Z","lastAt":"2014-03-19T21:02:38Z","messageCount":12,"participants":["Brian Gesiak","Torsten Bögershausen","Junio C Hamano","John Keeping"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"236970","messageId":"1395132268-69488-1-git-send-email-modocache@gmail.com","threadId":"36205","inReplyTo":null,"subject":"[PATCH] git-rebase: Teach rebase \"-\" shorthand.","fromName":"Brian Gesiak","fromEmail":"modocache@gmail.com","sentAt":"2014-03-18T08:44:28Z","receivedAt":"2014-03-18T08:44:28Z","isPatch":true,"sender":{"key":"modocache@gmail.com","avatar":"https://avatars.githubusercontent.com/u/552921?v=4"},"body":"Teach rebase the same shorthand as checkout and merge; that is, that \"-\"\nmeans \"the branch we were previously on\".\n\nReported-by: Tim Chase <git@tim.thechases.com>\nSigned-off-by: Brian Gesiak <modocache@gmail.com>\n---\n git-rebase.sh     | 4 ++++\n t/t3400-rebase.sh | 6 ++++++\n 2 files changed, 10 insertions(+)\n\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex 5f6732b..2c75e9f 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -453,6 +453,10 @@ then\n \t\ttest \"$fork_point\" = auto && fork_point=t\n \t\t;;\n \t*)\tupstream_name=\"$1\"\n+\t\tif test \"$upstream_name\" = \"-\"\n+\t\tthen\n+\t\t\tupstream_name=\"@{-1}\"\n+\t\tfi\n \t\tshift\n \t\t;;\n \tesac\ndiff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh\nindex 6d94b1f..00aba9f 100755\n--- a/t/t3400-rebase.sh\n+++ b/t/t3400-rebase.sh\n@@ -88,6 +88,12 @@ test_expect_success 'rebase from ambiguous branch name' '\n \tgit rebase master\n '\n \n+test_expect_success 'rebase using shorthand' '\n+\tgit checkout master\n+\tgit checkout -b shorthand HEAD^\n+\tGIT_TRACE=1 git rebase -\n+'\n+\n test_expect_success 'rebase a single mode change' '\n \tgit checkout master &&\n \tgit branch -D topic &&\n-- \n1.8.5.2 (Apple Git-48)\n"},{"id":"237000","messageId":"53289DE8.2070104@web.de","threadId":"36205","inReplyTo":"1395132268-69488-1-git-send-email-modocache@gmail.com","subject":"Re: [PATCH] git-rebase: Teach rebase \"-\" shorthand.","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2014-03-18T19:26:32Z","receivedAt":"2014-03-18T19:26:32Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 03/18/2014 09:44 AM, Brian Gesiak wrote:\n> Teach rebase the same shorthand as checkout and merge; that is, that \"-\"\n> means \"the branch we were previously on\".\n>\n> Reported-by: Tim Chase <git@tim.thechases.com>\n> Signed-off-by: Brian Gesiak <modocache@gmail.com>\n> ---\n>   git-rebase.sh     | 4 ++++\n>   t/t3400-rebase.sh | 6 ++++++\n>   2 files changed, 10 insertions(+)\n>\n> diff --git a/git-rebase.sh b/git-rebase.sh\n> index 5f6732b..2c75e9f 100755\n> --- a/git-rebase.sh\n> +++ b/git-rebase.sh\n> @@ -453,6 +453,10 @@ then\n>   \t\ttest \"$fork_point\" = auto && fork_point=t\n>   \t\t;;\n>   \t*)\tupstream_name=\"$1\"\n> +\t\tif test \"$upstream_name\" = \"-\"\n> +\t\tthen\n> +\t\t\tupstream_name=\"@{-1}\"\n> +\t\tfi\n>   \t\tshift\n>   \t\t;;\n>   \tesac\n> diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh\n> index 6d94b1f..00aba9f 100755\n> --- a/t/t3400-rebase.sh\n> +++ b/t/t3400-rebase.sh\n> @@ -88,6 +88,12 @@ test_expect_success 'rebase from ambiguous branch name' '\n>   \tgit rebase master\n>   '\n>\n> +test_expect_success 'rebase using shorthand' '\n> +\tgit checkout master\nwe schould have the \"&&\"   ^^\n> +\tgit checkout -b shorthand HEAD^\n               we schould have the \"&&\"  ^^\n> +\tGIT_TRACE=1 git rebase -\nAnd why the GIT_TRACE ?\n> +'\n> +\n>   test_expect_success 'rebase a single mode change' '\n>   \tgit checkout master &&\n>   \tgit branch -D topic &&\n>\n"},{"id":"237003","messageId":"xmqq61nb8fap.fsf@gitster.dls.corp.google.com","threadId":"36205","inReplyTo":"1395132268-69488-1-git-send-email-modocache@gmail.com","subject":"Re: [PATCH] git-rebase: Teach rebase \"-\" shorthand.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-03-18T19:42:06Z","receivedAt":"2014-03-18T19:42:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Brian Gesiak <modocache@gmail.com> writes:\n\n> Teach rebase the same shorthand as checkout and merge; that is, that \"-\"\n> means \"the branch we were previously on\".\n>\n> Reported-by: Tim Chase <git@tim.thechases.com>\n> Signed-off-by: Brian Gesiak <modocache@gmail.com>\n> ---\n>  git-rebase.sh     | 4 ++++\n>  t/t3400-rebase.sh | 6 ++++++\n>  2 files changed, 10 insertions(+)\n>\n> diff --git a/git-rebase.sh b/git-rebase.sh\n> index 5f6732b..2c75e9f 100755\n> --- a/git-rebase.sh\n> +++ b/git-rebase.sh\n> @@ -453,6 +453,10 @@ then\n>  \t\ttest \"$fork_point\" = auto && fork_point=t\n>  \t\t;;\n>  \t*)\tupstream_name=\"$1\"\n> +\t\tif test \"$upstream_name\" = \"-\"\n> +\t\tthen\n> +\t\t\tupstream_name=\"@{-1}\"\n> +\t\tfi\n>  \t\tshift\n>  \t\t;;\n>  \tesac\n> diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh\n> index 6d94b1f..00aba9f 100755\n> --- a/t/t3400-rebase.sh\n> +++ b/t/t3400-rebase.sh\n> @@ -88,6 +88,12 @@ test_expect_success 'rebase from ambiguous branch name' '\n>  \tgit rebase master\n>  '\n>  \n> +test_expect_success 'rebase using shorthand' '\n> +\tgit checkout master\n> +\tgit checkout -b shorthand HEAD^\n> +\tGIT_TRACE=1 git rebase -\n\nI'd rather not to see that TRACE there.  We would also want to make\nsure the result is what we expect to see, not only the command does\nnot error out, no?\n\n> +'\n> +\n>  test_expect_success 'rebase a single mode change' '\n>  \tgit checkout master &&\n>  \tgit branch -D topic &&\n"},{"id":"237058","messageId":"1395226935-53044-1-git-send-email-modocache@gmail.com","threadId":"36205","inReplyTo":"xmqq61nb8fap.fsf@gitster.dls.corp.google.com","subject":"[PATCH v2] git-rebase: Teach rebase \"-\" shorthand.","fromName":"Brian Gesiak","fromEmail":"modocache@gmail.com","sentAt":"2014-03-19T11:02:15Z","receivedAt":"2014-03-19T11:02:15Z","isPatch":true,"sender":{"key":"modocache@gmail.com","avatar":"https://avatars.githubusercontent.com/u/552921?v=4"},"body":"Teach rebase the same shorthand as checkout and merge; that is, that \"-\"\nmeans \"the branch we were previously on\".\n\nReported-by: Tim Chase <git@tim.thechases.com>\nSigned-off-by: Brian Gesiak <modocache@gmail.com>\n---\n git-rebase.sh     |  4 ++++\n t/t3400-rebase.sh | 11 +++++++++++\n 2 files changed, 15 insertions(+)\n\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex 5f6732b..2c75e9f 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -453,6 +453,10 @@ then\n \t\ttest \"$fork_point\" = auto && fork_point=t\n \t\t;;\n \t*)\tupstream_name=\"$1\"\n+\t\tif test \"$upstream_name\" = \"-\"\n+\t\tthen\n+\t\t\tupstream_name=\"@{-1}\"\n+\t\tfi\n \t\tshift\n \t\t;;\n \tesac\ndiff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh\nindex 6d94b1f..6176754 100755\n--- a/t/t3400-rebase.sh\n+++ b/t/t3400-rebase.sh\n@@ -88,6 +88,17 @@ test_expect_success 'rebase from ambiguous branch name' '\n \tgit rebase master\n '\n \n+test_expect_success 'rebase using shorthand' '\n+\tgit checkout master &&\n+\tgit checkout -b shorthand HEAD^ &&\n+\tgit rebase - 1>shorthand.stdout &&\n+\tgit checkout master &&\n+\tgit branch -D shorthand &&\n+\tgit checkout -b shorthand HEAD^ &&\n+\tgit rebase @{-1} 1>without_shorthand.stdout &&\n+\ttest_i18ncmp without_shorthand.stdout shorthand.stdout\n+'\n+\n test_expect_success 'rebase a single mode change' '\n \tgit checkout master &&\n \tgit branch -D topic &&\n-- \n1.8.5.2 (Apple Git-48)\n"},{"id":"237094","messageId":"xmqqob123wjm.fsf@gitster.dls.corp.google.com","threadId":"36205","inReplyTo":"1395226935-53044-1-git-send-email-modocache@gmail.com","subject":"Re: [PATCH v2] git-rebase: Teach rebase \"-\" shorthand.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-03-19T17:53:01Z","receivedAt":"2014-03-19T17:53:01Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Brian Gesiak <modocache@gmail.com> writes:\n\n> diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh\n> index 6d94b1f..6176754 100755\n> --- a/t/t3400-rebase.sh\n> +++ b/t/t3400-rebase.sh\n> @@ -88,6 +88,17 @@ test_expect_success 'rebase from ambiguous branch name' '\n>  \tgit rebase master\n>  '\n>  \n> +test_expect_success 'rebase using shorthand' '\n> +\tgit checkout master &&\n> +\tgit checkout -b shorthand HEAD^ &&\n> +\tgit rebase - 1>shorthand.stdout &&\n> +\tgit checkout master &&\n> +\tgit branch -D shorthand &&\n> +\tgit checkout -b shorthand HEAD^ &&\n> +\tgit rebase @{-1} 1>without_shorthand.stdout &&\n> +\ttest_i18ncmp without_shorthand.stdout shorthand.stdout\n> +'\n\nA handful of issues here:\n\n * \"1>target\" looks unconventional and wastes readers' time, forcing\n   them to wonder if there is anything special going on, only to\n   realize there isn't anything noteworthy.  Saying \">target\" like\n   everybody else does avoids attracting unnecessary attention.\n\n * \"rebase using shorthand\" is somewhat a myopic title; it assumes\n   that the only short-hand relevant to rebase will be that a \"-\"\n   stands for \"@{-1}\" to specify the branch we rebase the current\n   branch off of.\n\n * The usual filename for the output from the command being tested\n   is 'actual', and the usual filename for the expected output is\n   'expect'.  In this case, you are verifying that the output from\n   \"rebase -\" is the same as the output from \"rebase @{-1}\", so it\n   is more conventional to call the former 'actual' and the latter\n   'expect'.\n\n * Is the eye-candy output to the standard output what is the most\n   interesting during the execution of a rebase?  Wouldn't we be\n   more interested to make sure that we did transplant the history\n   on the same commit between two cases?\n\n   \"rebase -\" with your change still says something like this:\n\n        First, rewinding head to replay your work on top of it...\n        Fast-forwarded HEAD to @{-1}.\n\n   instead of \"Fast-forwarded HEAD to -\".  Somebody may later want\n   to \"fix\" this, making these two eye-candy output to be different\n   from each other, and what your test expects will no longer hold\n   (not that I think it is better to say \"-\" instead of @{-1}\n   there).\n\n\nI'll tentatively queue it with a minor tweak (see below).\n\nThanks.\n\n-- >8 --\nFrom: Brian Gesiak <modocache@gmail.com>\nDate: Wed, 19 Mar 2014 20:02:15 +0900\nSubject: [PATCH] rebase: allow \"-\" short-hand for the previous branch\n\nTeach rebase the same shorthand as checkout and merge to name the\nbranch to rebase the current branch on; that is, that \"-\" means \"the\nbranch we were previously on\".\n\nRequested-by: Tim Chase <git@tim.thechases.com>\nSigned-off-by: Brian Gesiak <modocache@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n git-rebase.sh     |  4 ++++\n t/t3400-rebase.sh | 17 +++++++++++++++++\n 2 files changed, 21 insertions(+)\n\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex 8a3efa2..658c003 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -449,6 +449,10 @@ then\n \t\ttest \"$fork_point\" = auto && fork_point=t\n \t\t;;\n \t*)\tupstream_name=\"$1\"\n+\t\tif test \"$upstream_name\" = \"-\"\n+\t\tthen\n+\t\t\tupstream_name=\"@{-1}\"\n+\t\tfi\n \t\tshift\n \t\t;;\n \tesac\ndiff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh\nindex 6d94b1f..80e0a95 100755\n--- a/t/t3400-rebase.sh\n+++ b/t/t3400-rebase.sh\n@@ -88,6 +88,23 @@ test_expect_success 'rebase from ambiguous branch name' '\n \tgit rebase master\n '\n \n+test_expect_success 'rebase off of the previous branch using \"-\"' '\n+\tgit checkout master &&\n+\tgit checkout HEAD^ &&\n+\tgit rebase @{-1} >expect.messages &&\n+\tgit merge-base master HEAD >expect.forkpoint &&\n+\n+\tgit checkout master &&\n+\tgit checkout HEAD^ &&\n+\tgit rebase - >actual.messages &&\n+\tgit merge-base master HEAD >actual.forkpoint &&\n+\n+\ttest_cmp expect.forkpoint actual.forkpoint &&\n+\t# the next one is dubious---we may want to say \"-\",\n+\t# instead of @{-1}, in the message\n+\ttest_i18ncmp expect.messages actual.messages\n+'\n+\n test_expect_success 'rebase a single mode change' '\n \tgit checkout master &&\n \tgit branch -D topic &&\n-- \n1.9.1-423-g4596e3a\n"},{"id":"237095","messageId":"20140319180213.GB11018@serenity.lan","threadId":"36205","inReplyTo":"xmqqob123wjm.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH v2] git-rebase: Teach rebase \"-\" shorthand.","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2014-03-19T18:02:13Z","receivedAt":"2014-03-19T18:02:13Z","isPatch":true,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"On Wed, Mar 19, 2014 at 10:53:01AM -0700, Junio C Hamano wrote:\n>    \"rebase -\" with your change still says something like this:\n> \n>         First, rewinding head to replay your work on top of it...\n>         Fast-forwarded HEAD to @{-1}.\n> \n>    instead of \"Fast-forwarded HEAD to -\".  Somebody may later want\n>    to \"fix\" this, making these two eye-candy output to be different\n>    from each other, and what your test expects will no longer hold\n>    (not that I think it is better to say \"-\" instead of @{-1}\n>    there).\n\nI don't think either of these is correct.  When using \"-\" with the\ncommands that already support it, I have occasionally found that \"-\"\nisn't what I thought it was.\n\nCan we use `git name-rev` to put the actual name here, so that people\nwho have not done what they intended can hopefully notice sooner?\n"},{"id":"237096","messageId":"CAN7MxmVny80BYvYBZ=iBybx_ffVhOCfkP3pU6fYzHpxNu4QYHA@mail.gmail.com","threadId":"36205","inReplyTo":"20140319180213.GB11018@serenity.lan","subject":"Re: [PATCH v2] git-rebase: Teach rebase \"-\" shorthand.","fromName":"Brian Gesiak","fromEmail":"modocache@gmail.com","sentAt":"2014-03-19T18:09:05Z","receivedAt":"2014-03-19T18:09:05Z","isPatch":true,"sender":{"key":"modocache@gmail.com","avatar":"https://avatars.githubusercontent.com/u/552921?v=4"},"body":"Thank you for the feedback and tweaks!\n\n> Is the eye-candy output to the standard output what is the most\n> interesting during the execution of a rebase?  Wouldn't we be\n> more interested to make sure that we did transplant the history\n> on the same commit between two cases?\n\nI agree. I'll consult the other tests to see how to write such a test.\n\n> Can we use `git name-rev` to put the actual name here, so that people\n> who have not done what they intended can hopefully notice sooner?\n\nThis sounds like a great idea! Doing so would mirror how `git checkout`\nbehaves; checkout informs the user of which branch they have switched\nto when using the \"-\" shorthand: \"Switched to branch 'master'\".\n\nShould I submit a new patch, or reroll this one?\n\n- Brian Gesiak\n"},{"id":"237102","messageId":"xmqqsiqe2es6.fsf@gitster.dls.corp.google.com","threadId":"36205","inReplyTo":"20140319180213.GB11018@serenity.lan","subject":"Re: [PATCH v2] git-rebase: Teach rebase \"-\" shorthand.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-03-19T19:02:01Z","receivedAt":"2014-03-19T19:02:01Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"John Keeping <john@keeping.me.uk> writes:\n\n> On Wed, Mar 19, 2014 at 10:53:01AM -0700, Junio C Hamano wrote:\n>>    \"rebase -\" with your change still says something like this:\n>> \n>>         First, rewinding head to replay your work on top of it...\n>>         Fast-forwarded HEAD to @{-1}.\n>> \n>>    instead of \"Fast-forwarded HEAD to -\".  Somebody may later want\n>>    to \"fix\" this, making these two eye-candy output to be different\n>>    from each other, and what your test expects will no longer hold\n>>    (not that I think it is better to say \"-\" instead of @{-1}\n>>    there).\n>\n> I don't think either of these is correct.  When using \"-\" with the\n> commands that already support it, I have occasionally found that \"-\"\n> isn't what I thought it was.\n>\n> Can we use `git name-rev` to put the actual name here, so that people\n> who have not done what they intended can hopefully notice sooner?\n\nThat sounds like a right thing to do.  It however is totally\northogonal to the change we are discussing, and should be done as a\nseparate patch.\n\nThanks.\n"},{"id":"237103","messageId":"20140319191217.GC11018@serenity.lan","threadId":"36205","inReplyTo":"xmqqsiqe2es6.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH v2] git-rebase: Teach rebase \"-\" shorthand.","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2014-03-19T19:12:17Z","receivedAt":"2014-03-19T19:12:17Z","isPatch":true,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"On Wed, Mar 19, 2014 at 12:02:01PM -0700, Junio C Hamano wrote:\n> John Keeping <john@keeping.me.uk> writes:\n> \n> > On Wed, Mar 19, 2014 at 10:53:01AM -0700, Junio C Hamano wrote:\n> >>    \"rebase -\" with your change still says something like this:\n> >> \n> >>         First, rewinding head to replay your work on top of it...\n> >>         Fast-forwarded HEAD to @{-1}.\n> >> \n> >>    instead of \"Fast-forwarded HEAD to -\".  Somebody may later want\n> >>    to \"fix\" this, making these two eye-candy output to be different\n> >>    from each other, and what your test expects will no longer hold\n> >>    (not that I think it is better to say \"-\" instead of @{-1}\n> >>    there).\n> >\n> > I don't think either of these is correct.  When using \"-\" with the\n> > commands that already support it, I have occasionally found that \"-\"\n> > isn't what I thought it was.\n> >\n> > Can we use `git name-rev` to put the actual name here, so that people\n> > who have not done what they intended can hopefully notice sooner?\n> \n> That sounds like a right thing to do.  It however is totally\n> orthogonal to the change we are discussing, and should be done as a\n> separate patch.\n\nIs it not part of adding support for \"-\"?\n\nI'm not arguing for a change to any existing functionality, just to the\nbehaviour introduced by this patch, which is basically a change from\n\"@{-1}\" to \"$(git name-rev --name-only @{-1})\" in the patch.  (The error\nhandling of name-rev appears not to be very useful here when the\nprevious branch has been deleted, so I don't think it's quite that\nsimple, but that's the principle.)\n"},{"id":"237107","messageId":"xmqqk3bq2cyc.fsf@gitster.dls.corp.google.com","threadId":"36205","inReplyTo":"20140319191217.GC11018@serenity.lan","subject":"Re: [PATCH v2] git-rebase: Teach rebase \"-\" shorthand.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-03-19T19:41:31Z","receivedAt":"2014-03-19T19:41:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"John Keeping <john@keeping.me.uk> writes:\n\n> On Wed, Mar 19, 2014 at 12:02:01PM -0700, Junio C Hamano wrote:\n>> John Keeping <john@keeping.me.uk> writes:\n>> \n>> > On Wed, Mar 19, 2014 at 10:53:01AM -0700, Junio C Hamano wrote:\n>> >>    \"rebase -\" with your change still says something like this:\n>> >> \n>> >>         First, rewinding head to replay your work on top of it...\n>> >>         Fast-forwarded HEAD to @{-1}.\n>> >> \n>> >>    instead of \"Fast-forwarded HEAD to -\".  Somebody may later want\n>> >>    to \"fix\" this, making these two eye-candy output to be different\n>> >>    from each other, and what your test expects will no longer hold\n>> >>    (not that I think it is better to say \"-\" instead of @{-1}\n>> >>    there).\n>> >\n>> > I don't think either of these is correct.  When using \"-\" with the\n>> > commands that already support it, I have occasionally found that \"-\"\n>> > isn't what I thought it was.\n>> >\n>> > Can we use `git name-rev` to put the actual name here, so that people\n>> > who have not done what they intended can hopefully notice sooner?\n>> \n>> That sounds like a right thing to do.  It however is totally\n>> orthogonal to the change we are discussing, and should be done as a\n>> separate patch.\n>\n> Is it not part of adding support for \"-\"?\n\nI thought your suggestion was:\n\n    'rebase @{-1}' says 'Fast-fowarded HEAD to @{-1}'. It should say\n    'Fast-forwarded HEAD to 4f407407 (rebase: allow \"-\" short-hand\n    for the previous branch, 2014-03-19)' instead.\n\nOr it could be:\n\n    'rebase @{-1}' says 'Fast-fowarded HEAD to @{-1}'. It should say\n    'Fast-forwarded HEAD to master' instead.\n\nIn either case, it does not look like such a change is about\nteaching \"-\" as a synonym to \"@{-1}\".\n"},{"id":"237111","messageId":"20140319195503.GD11018@serenity.lan","threadId":"36205","inReplyTo":"xmqqk3bq2cyc.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH v2] git-rebase: Teach rebase \"-\" shorthand.","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2014-03-19T19:55:03Z","receivedAt":"2014-03-19T19:55:03Z","isPatch":true,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"On Wed, Mar 19, 2014 at 12:41:31PM -0700, Junio C Hamano wrote:\n> John Keeping <john@keeping.me.uk> writes:\n> \n> > On Wed, Mar 19, 2014 at 12:02:01PM -0700, Junio C Hamano wrote:\n> >> John Keeping <john@keeping.me.uk> writes:\n> >> \n> >> > On Wed, Mar 19, 2014 at 10:53:01AM -0700, Junio C Hamano wrote:\n> >> >>    \"rebase -\" with your change still says something like this:\n> >> >> \n> >> >>         First, rewinding head to replay your work on top of it...\n> >> >>         Fast-forwarded HEAD to @{-1}.\n> >> >> \n> >> >>    instead of \"Fast-forwarded HEAD to -\".  Somebody may later want\n> >> >>    to \"fix\" this, making these two eye-candy output to be different\n> >> >>    from each other, and what your test expects will no longer hold\n> >> >>    (not that I think it is better to say \"-\" instead of @{-1}\n> >> >>    there).\n> >> >\n> >> > I don't think either of these is correct.  When using \"-\" with the\n> >> > commands that already support it, I have occasionally found that \"-\"\n> >> > isn't what I thought it was.\n> >> >\n> >> > Can we use `git name-rev` to put the actual name here, so that people\n> >> > who have not done what they intended can hopefully notice sooner?\n> >> \n> >> That sounds like a right thing to do.  It however is totally\n> >> orthogonal to the change we are discussing, and should be done as a\n> >> separate patch.\n> >\n> > Is it not part of adding support for \"-\"?\n> \n> I thought your suggestion was:\n> \n>     'rebase @{-1}' says 'Fast-fowarded HEAD to @{-1}'. It should say\n>     'Fast-forwarded HEAD to 4f407407 (rebase: allow \"-\" short-hand\n>     for the previous branch, 2014-03-19)' instead.\n> \n> Or it could be:\n> \n>     'rebase @{-1}' says 'Fast-fowarded HEAD to @{-1}'. It should say\n>     'Fast-forwarded HEAD to master' instead.\n> \n> In either case, it does not look like such a change is about\n> teaching \"-\" as a synonym to \"@{-1}\".\n\nMy suggestion was specifically:\n\n    'rebase -' says 'Fast-forwarded HEAD to -'.  It should say\n    'Fast-forwarded HEAD to master' instead.\n\nI'm not sure it's desirable to attempt to canonicalise whatever the user\nwrites on the command line, but since we're special-casing '-' I think\nit is a good thing to print the branch name in that case.\n"},{"id":"237114","messageId":"xmqq7g7p3nrl.fsf@gitster.dls.corp.google.com","threadId":"36205","inReplyTo":"20140319195503.GD11018@serenity.lan","subject":"Re: [PATCH v2] git-rebase: Teach rebase \"-\" shorthand.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-03-19T21:02:38Z","receivedAt":"2014-03-19T21:02:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"John Keeping <john@keeping.me.uk> writes:\n\n>> I thought your suggestion was:\n>> \n>>     'rebase @{-1}' says 'Fast-fowarded HEAD to @{-1}'. It should say\n>>     'Fast-forwarded HEAD to 4f407407 (rebase: allow \"-\" short-hand\n>>     for the previous branch, 2014-03-19)' instead.\n>> \n>> Or it could be:\n>> \n>>     'rebase @{-1}' says 'Fast-fowarded HEAD to @{-1}'. It should say\n>>     'Fast-forwarded HEAD to master' instead.\n>> \n>> In either case, it does not look like such a change is about\n>> teaching \"-\" as a synonym to \"@{-1}\".\n>\n> My suggestion was specifically:\n>\n>     'rebase -' says 'Fast-forwarded HEAD to -'.  It should say\n>     'Fast-forwarded HEAD to master' instead.\n\nOK, it was closer to the latter.\n\nBut why is it OK to leave @{-1}, which is just as \"hmm, I do not\nremember what the previous branch was myself\" when the user says\n\"@{-1}\" in the output while it not OK to leave \"-\" in the output?\n\nI do not think of any sane reason, and that is why I think this\nimprovement is not part of \"teaching rebase that '-' can be used in\nplace of @{-1}\" topic.\n"}]}