# log --pretty accepts incomplete pre-defined formats

4 messages from 2016-04-06 to 2016-04-06. Participants: Sidhant Sharma, Junio C Hamano, Eric Wong.
Thread: https://gitlist.dev/t/41941

## Sidhant Sharma, 2016-04-06 06:13

Subject: log --pretty accepts incomplete pre-defined formats
Message-ID: <5704A925.9030506@gmail.com>
URL: https://gitlist.dev/e/5704A925.9030506%40gmail.com

```
Hi,

Recently while playing around with git log, I realized that it is possible to
pass incomplete (pre-defined) format names. For example, it is possible to use
`git log --pretty=one` instead of oneline and it would still output the logs in
oneline formatting. Same goes for other formats such as 'raw', 'short' and others.
I looked at the code and it seems that it is intentionally kept so. It this so?
I'm curious to know the reason behind keeping this so.


Thanks and regards,
Sidhant Sharma

```

## Junio C Hamano, 2016-04-06 15:15

Subject: Re: log --pretty accepts incomplete pre-defined formats
Message-ID: <xmqqinzuzs3d.fsf@gitster.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqqinzuzs3d.fsf%40gitster.mtv.corp.google.com
In-Reply-To: <5704A925.9030506@gmail.com>

```
Sidhant Sharma <tigerkid001@gmail.com> writes:

> Recently while playing around with git log, I realized that it is possible to
> pass incomplete (pre-defined) format names. For example, it is possible to use
> `git log --pretty=one` instead of oneline and it would still output the logs in
> oneline formatting. Same goes for other formats such as 'raw', 'short' and others.
> I looked at the code and it seems that it is intentionally kept so. It this so?
> I'm curious to know the reason behind keeping this so.

I actually am curious why somebody wants to know, as more modern
parts of the system allow option names abbreviated to unique
prefixes.  "Why can't I say 'log --pret=oneline' when I can say
'commit --ame'?" might be a more plausible puzzlement (and the
answer is "hysterical raisins").  Anyway, this seems to come from
6cdfd179 (commit: allow --pretty= args to be abbreviated,
2006-05-14), which was slightly tightend by aacd404e (Fix some
documentation typos and grammar, 2007-02-02).

```

## Eric Wong, 2016-04-06 21:03

Subject: Re: log --pretty accepts incomplete pre-defined formats
Message-ID: <20160406210339.GA18799@dcvr.yhbt.net>
URL: https://gitlist.dev/e/20160406210339.GA18799%40dcvr.yhbt.net
In-Reply-To: <xmqqinzuzs3d.fsf@gitster.mtv.corp.google.com>

```
Junio C Hamano <gitster@pobox.com> wrote:
> Sidhant Sharma <tigerkid001@gmail.com> writes:
> 
> > Recently while playing around with git log, I realized that it is possible to
> > pass incomplete (pre-defined) format names. For example, it is possible to use
> > `git log --pretty=one` instead of oneline and it would still output the logs in
> > oneline formatting. Same goes for other formats such as 'raw', 'short' and others.
> > I looked at the code and it seems that it is intentionally kept so. It this so?
> > I'm curious to know the reason behind keeping this so.
> 
> I actually am curious why somebody wants to know, as more modern
> parts of the system allow option names abbreviated to unique
> prefixes.  "Why can't I say 'log --pret=oneline' when I can say
> 'commit --ame'?" might be a more plausible puzzlement (and the
> answer is "hysterical raisins").  Anyway, this seems to come from
> 6cdfd179 (commit: allow --pretty= args to be abbreviated,
> 2006-05-14),

Yes, being able to abbreviate 'raw', 'short', etc is intentional
to save keystrokes since I was suffering from RSI at the time.

Being able to do "--pret=r" would be nice nowadays if the
parsing in revision.c were modernized.  However, the completions
in contrib/ also expands "--pretty=" nowadays, so now I care
less about shorthand options.

> which was slightly tightend by aacd404e (Fix some
> documentation typos and grammar, 2007-02-02).

Huh?

```

## Junio C Hamano, 2016-04-06 21:07

Subject: Re: log --pretty accepts incomplete pre-defined formats
Message-ID: <CAPc5daVQwP2ZxpK6+57q+_EZLTU=CuHmcVT_VHmFH-KxrSKMog@mail.gmail.com>
URL: https://gitlist.dev/e/CAPc5daVQwP2ZxpK6%2B57q%2B_EZLTU%3DCuHmcVT_VHmFH-KxrSKMog%40mail.gmail.com
In-Reply-To: <20160406210339.GA18799@dcvr.yhbt.net>

```
On Wed, Apr 6, 2016 at 2:03 PM, Eric Wong <normalperson@yhbt.net> wrote:
>> which was slightly tightend by aacd404e (Fix some
>> documentation typos and grammar, 2007-02-02).
>
> Huh?

Huh indeed.

b6936205 (Disallow invalid --pretty= abbreviations, 2007-02-02)

was what I meant to name.

```
