git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Confusing inconsistent option syntax
@ 2018-12-02 10:07 Robert White
  2018-12-02 10:18 ` Duy Nguyen
  2018-12-03 22:14 ` Jeff King
  0 siblings, 2 replies; 3+ messages in thread
From: Robert White @ 2018-12-02 10:07 UTC (permalink / raw)
  To: git

`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?

---
Robert White

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Confusing inconsistent option syntax
  2018-12-02 10:07 Confusing inconsistent option syntax Robert White
@ 2018-12-02 10:18 ` Duy Nguyen
  2018-12-03 22:14 ` Jeff King
  1 sibling, 0 replies; 3+ messages in thread
From: Duy Nguyen @ 2018-12-02 10:18 UTC (permalink / raw)
  To: rjwhite2453; +Cc: Git Mailing List

On Sun, Dec 2, 2018 at 11:13 AM Robert White <rjwhite2453@gmail.com> wrote:
>
> `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?

--pretty can take no arguments. --pretty alone is the same as
--pretty=medium. --since always needs an argument.
-- 
Duy

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Confusing inconsistent option syntax
  2018-12-02 10:07 Confusing inconsistent option syntax Robert White
  2018-12-02 10:18 ` Duy Nguyen
@ 2018-12-03 22:14 ` Jeff King
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff King @ 2018-12-03 22:14 UTC (permalink / raw)
  To: Robert White; +Cc: git

On Sun, Dec 02, 2018 at 09:07:47PM +1100, Robert White wrote:

> `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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-12-03 22:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-02 10:07 Confusing inconsistent option syntax Robert White
2018-12-02 10:18 ` Duy Nguyen
2018-12-03 22:14 ` Jeff King

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).