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

Re: [PATCH v2] doc: use 'rev' instead of 'commit' for merge-base arguments

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 4, 2020, 17:26 UTC
Message-ID
<xmqqzhcw3uc7.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<xmqqd09s5atg.fsf@gitster-ct.c.googlers.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 5 quoted lines
> ... another important
> point (i.e. when a command wants to take a commit but a user gives
> it a tag that points at a commit, the command almost always accepts
> the tag, finds the commit the tag points at, and uses that commit
> instead of the tag ...

A side note I forgot to add. A few commands take both commit and tag but want to do different things depending on the kind of object they get, and for them, <commit> and <commit-ish> should be used carefully in the documentation.

For example, "git cat-file commit v2.25.0" and "git cat-file tag v2.25.0" do two different things. They should be described as

	$ git cat-file commit <commit-ish>
	$ git cat-file tag <tag>

"git merge <commit>" and "git merge <tag>" do different things, even though <tag> must be a <commit-ish>.

But most of the Git subcommands (including the "cat-file commit" case) peel a tag as needed, so these special cases are minority.

Previous: Junio C Hamano
Message 9 of 9 in “doc: use 'ref' instead of 'commit' for merge-base arguments”
  1. doc: use 'ref' instead of 'commit' for merge-base argumentsTakuya N via GitGitGadget, Mar 3, 2020
  2. Bryan TurnerMar 3, 2020
  3. Johannes SchindelinMar 3, 2020
  4. Junio C HamanoMar 3, 2020
  5. Johannes SchindelinMar 3, 2020
  6. Junio C HamanoMar 3, 2020
  7. doc: use 'rev' instead of 'commit' for merge-base argumentsTakuya N via GitGitGadget, Mar 4, 2020
  8. Junio C HamanoMar 4, 2020
  9. Junio C HamanoMar 4, 2020

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.