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

Re: [PATCH] log: add %S option (like --source) to log --format

From
Jeff King <peff@peff.net>
Date
Dec 17, 2018, 15:59 UTC
Message-ID
<20181217155915.GA914@sigill.intra.peff.net>
In-Reply-To
<CANdyxMwxPqTMfLsoK-2JT3Wf3hXZnQNCPRS04aSHzsMbYJZo-Q@mail.gmail.com>
On Sun, Dec 16, 2018 at 10:25:14PM -0800, Issac Trotts wrote:
Show 6 quoted lines
> Make it possible to write for example
> 
>         git log --format="%H,%S"
> 
> where the %S at the end is a new placeholder that prints out the ref
> (tag/branch) for each commit.
Seems like a reasonable thing to want.

One curious thing about "--source" is that it requires cooperation from the actual traversal. So if you did:

  git rev-list | git diff-tree --format="%H %S"

we don't have the %S information in the latter command. I think that's probably acceptable as long as it does something sane when we don't have that information (e.g., replace it with an empty string). It might also be worth calling out in the documentation.

-Peff
Previous: Issac TrottsNext: Issac Trotts
Message 4 of 8 in “log: add %S option (like --source) to log --format”
  1. log: add %S option (like --source) to log --formatIssac Trotts, Dec 17, 2018
  2. Junio C HamanoDec 17, 2018
  3. Issac TrottsDec 18, 2018
  4. Jeff KingDec 17, 2018
  5. Issac TrottsDec 18, 2018
  6. Issac TrottsDec 19, 2018
  7. Issac TrottsDec 19, 2018
  8. Issac TrottsDec 19, 2018

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.