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

Re: [PATCH] doc: add that '-' is the same as '@{-1}'

From
Rryicoh <ryicoh@gmail.com>
Date
Apr 1, 2023, 15:53 UTC
Message-ID
<20230401155342.21230-1-ryicoh@gmail.com>
In-Reply-To
<xmqqlejchpct.fsf@gitster.g>
Hi Oswald, Junio and Phillip.
Thank you for your reviews. Let me reply to each comments.
> i'd recommend quoting the dash as you do in the summary (or adding some markup?), as otherwise it's way too easy to misread.
That's good. I'll fix it.
> It is certainly *not* synonymous in general and I
> doubt we want to make it to.
That's correct. Your examples helped me understand.
> A few commands (checkout, merge, rebase and switch spring to mind) accept '-' as a shorthand for '@{-1}' but I don't think it is universally accepted.
That's correct too.
> for now we should
> update its documentation to mention "- can also be used in place of
> @{-1}".
Finally, How should I update the documentation? How about following changes?
- You may also specify `-` which is synonymous to `@{-1}`.
+ Only some commands (checkout, switch, etc,), you may also specify `-` which is synonymous to `@{-1}`.

Other commands also seem to accept '-', such as `cherry-pick`. It's not good idea to write all commands that accepted it.

Best Wishes
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 6 in “doc: add that '-' is the same as '@{-1}'”
  1. doc: add that '-' is the same as '@{-1}'ryicoh via GitGitGadget, Mar 31, 2023
  2. Oswald BuddenhagenMar 31, 2023
  3. Junio C HamanoMar 31, 2023
  4. ryicohApr 1, 2023
  5. Junio C HamanoApr 2, 2023
  6. Phillip WoodMar 31, 2023

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.