git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] cherry-pick: allow "-" as abbreviation of '@{-1}'

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 5, 2013, 16:27 UTC
Message-ID
<7vmwowm7bc.fsf@alter.siamese.dyndns.org>
In-Reply-To
<87wqo33v4f.fsf@hexa.v.cablecom.net>
Thomas Rast <trast@inf.ethz.ch> writes:
Show 10 quoted lines
> Hiroshige Umino <hiroshige88@gmail.com> writes:
>
>> As "git cherry-pick -" or "git merge -" is convenient to
>> switch back to or merge the previous branch,
>> "git cherry-pick -" is abbreviation of "git cherry-pick @{-1}"
>> to pick up a commit from the previous branch conveniently.
>
> The first line is confusing.  Did you mean to invoke the existing 'git
> *checkout* -' and 'git merge -' functionality as a reason why 'git
> cherry-pick -' should exist?

I think that is what was meant. Just like "-" abbreviation is handy for users of "checkout" and "merge", "cherry-pick" might. I am not sure if you would often cherry-pick from the previous branch, but for the sake of completeness and uniformity, the guiding principle could be "at any point on the command line where a branch name is accepted, if a '-' could not possibly mean any other thing is wanted (e.g. doing something on the standard input), it should stand as the name of the previous branch".

I agree with everything you said in your review. The patch is going in the right direction, but it needs a bit more work.

Thanks.
Previous: Thomas RastNext: Hiroshige Umino
Message 3 of 4 in “cherry-pick: allow "-" as abbreviation of '@{-1}'”
  1. cherry-pick: allow "-" as abbreviation of '@{-1}'Hiroshige Umino, Aug 3, 2013
  2. Thomas RastAug 3, 2013
  3. Junio C HamanoAug 5, 2013
  4. Hiroshige UminoAug 16, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.