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

Re: Confusing inconsistent option syntax

From
Jeff King <peff@peff.net>
Date
Dec 3, 2018, 22:14 UTC
Message-ID
<20181203221441.GB11883@sigill.intra.peff.net>
In-Reply-To
<20181202100747.GA5019@laptop>
On Sun, Dec 02, 2018 at 09:07:47PM +1100, Robert White wrote:
Show 6 quoted lines
> `git log --pretty short` gives the error message "ambiguous argument
> 'short'". To get the expected result, you need to use `git log
> --pretty=short`. However, `git log --since yesterday` and `git log
> --since=yesterday` both work as expected.
> 
> When is an = needed? What is the reason for these inconsistencies?

As Duy mentioned, this has to do with optional arguments for some flags. This is discussed in more detail in "git help cli". Notably (and as advised in that manpage), you should always use the "stuck" form (with the "=") in scripts, in case a flag grows an optional value later.

-Peff
Previous: Duy Nguyen
Message 3 of 3 in “Confusing inconsistent option syntax”
  1. Robert WhiteDec 2, 2018
  2. Duy NguyenDec 2, 2018
  3. Jeff KingDec 3, 2018

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.