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

Re: Format for %d includes unwanted preceding space

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 6, 2016, 18:49 UTC
Message-ID
<xmqq1sztl3d1.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<a3eed8fb-505c-e9c1-6fb6-944d9df2f15d@hale.ee>
"Ravi (Tom) Hale" <ravi@hale.ee> writes:
Show 6 quoted lines
> 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.

Previous: Ravi (Tom) Hale
Message 2 of 2 in “Format for %d includes unwanted preceding space”
  1. Ravi (Tom) HaleOct 6, 2016
  2. Junio C HamanoOct 6, 2016

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.