# Format for %d includes unwanted preceding space

2 messages from 2016-10-06 to 2016-10-06. Participants: Ravi (Tom) Hale, Junio C Hamano.
Thread: https://gitlist.dev/t/44232

## Ravi (Tom) Hale, 2016-10-06 09:22

Subject: Format for %d includes unwanted preceding space
Message-ID: <a3eed8fb-505c-e9c1-6fb6-944d9df2f15d@hale.ee>
URL: https://gitlist.dev/e/a3eed8fb-505c-e9c1-6fb6-944d9df2f15d%40hale.ee

```
The log --format="%d" includes preceding space:

$ git log -n1 --format="XX%dXX" HEAD
XX (HEAD -> master)XX

I know of no other %<token> that is output in this way.

Is there a way of removing this preceding space through the format 
string, or will it need to be a code change?

-- 
Tom Hale

```

## Junio C Hamano, 2016-10-06 18:49

Subject: Re: Format for %d includes unwanted preceding space
Message-ID: <xmqq1sztl3d1.fsf@gitster.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqq1sztl3d1.fsf%40gitster.mtv.corp.google.com
In-Reply-To: <a3eed8fb-505c-e9c1-6fb6-944d9df2f15d@hale.ee>

```
"Ravi (Tom) Hale" <ravi@hale.ee> writes:

> The log --format="%d" includes preceding space:
>
> $ git log -n1 --format="XX%dXX" HEAD
> XX (HEAD -> master)XX
>
> I know of no other %<token> that is output in this way.

That is primarily because %d predates %[-+ ]<placeholder> mechanism,
I think.  It is too late to redefine what "%d" means and force all
users to update their script to use "% d" instead, unfortunately.



```
