# Confusing inconsistent option syntax

3 messages from 2018-12-02 to 2018-12-03. Participants: Robert White, Duy Nguyen, Jeff King.
Thread: https://gitlist.dev/t/49935

## Robert White, 2018-12-02 10:07

Subject: Confusing inconsistent option syntax
Message-ID: <20181202100747.GA5019@laptop>
URL: https://gitlist.dev/e/20181202100747.GA5019%40laptop

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

```

## Duy Nguyen, 2018-12-02 10:18

Subject: Re: Confusing inconsistent option syntax
Message-ID: <CACsJy8Ct3YY1TPD=pFoBGX-0woMNvM0JHYC1iRDGxWLJR51Esg@mail.gmail.com>
URL: https://gitlist.dev/e/CACsJy8Ct3YY1TPD%3DpFoBGX-0woMNvM0JHYC1iRDGxWLJR51Esg%40mail.gmail.com
In-Reply-To: <20181202100747.GA5019@laptop>

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

```

## Jeff King, 2018-12-03 22:14

Subject: Re: Confusing inconsistent option syntax
Message-ID: <20181203221441.GB11883@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20181203221441.GB11883%40sigill.intra.peff.net
In-Reply-To: <20181202100747.GA5019@laptop>

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

```
