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

Re: [PATCH/RFC] git log --oneline alternative with dates, times and initials

From
Jeff King <peff@peff.net>
Date
Sep 29, 2016, 08:33 UTC
Message-ID
<20160929083315.vwb3aurwbyjwlkjn@sigill.intra.peff.net>
In-Reply-To
<git-log-times@mackyle-at-gmail-com>
On Wed, Sep 28, 2016 at 10:34:51PM -0700, Kyle J. McKay wrote:
Show 11 quoted lines
> git log-times --graph --date-order --decorate --no-merges -n 5 v2.5.3
> 
>     === 2015-09-17 ===
>   * ee6ad5f4 12:16 jch (tag: v2.5.3) Git 2.5.3
>     === 2015-09-09 ===
>   * b9d66899 14:22 js  am --skip/--abort: merge HEAD/ORIG_HEAD tree into index
>   |   === 2015-09-04 ===
>   | * 27ea6f85 10:46 jch (tag: v2.5.2) Git 2.5.2
>   * 74b67638 10:36 jch (tag: v2.4.9) Git 2.4.9
>                        ..........
>   * ecad27cf 10:32 jch (tag: v2.3.9) Git 2.3.9

I was surprised to see this as a separate script, but it is true that we cannot quite pull it off with --format. I think we are very close, though. With the patches below I think you can do:

  git log \
    --commit-header='%C(auto,bold blue)== %as ==%C(auto,reset)'
    --format='%C(auto)%h %C(auto,green)%ad %C(auto,red)%aS/%cS%C(auto)%d%C(auto,reset) %s' \
    --graph --no-merges --author-date-order --date=format:%H:%M
and get the same (or very similar) output.
  [1/5]: pretty: allow formatting DATE_SHORT
  [2/5]: pretty: allow formatting names as initials
  [3/5]: graph: fix extra spaces in graph_padding_line
  [4/5]: graph: helper functions for printing commit header
  [5/5]: log: add --commit-header option

Each of those commits[1] needs some minor polish, and as I'm not really that interested in fancy log output myself, I don't plan on working on them further. I was mostly curious just how close we were. But if you'd like to pursue it, feel free to use them as a starting point.

-Peff
[1] Actually, I think patch 3 is a legitimate bug fix on its own but I
    do not think there is any way to actually trigger it in practice
    without the rest of this series.
Previous: Kyle J. McKayNext: Jeff King
Message 2 of 20 in “git log --oneline alternative with dates, times and initials”
  1. git log --oneline alternative with dates, times and initialsKyle J. McKay, Sep 29, 2016
  2. Jeff KingSep 29, 2016
  3. 1/5 pretty: allow formatting DATE_SHORTJeff King, Sep 29, 2016
  4. Jacob KellerSep 30, 2016
  5. SZEDER GáborSep 30, 2016
  6. Jacob KellerSep 30, 2016
  7. Jeff KingOct 1, 2016
  8. 3/5 graph: fix extra spaces in graph_padding_lineJeff King, Sep 29, 2016
  9. 4/5 graph: helper functions for printing commit headerJeff King, Sep 29, 2016
  10. 2/5 pretty: allow formatting names as initialsJeff King, Sep 29, 2016
  11. Junio C HamanoSep 29, 2016
  12. Jeff KingSep 29, 2016
  13. 5/5 log: add --commit-header optionJeff King, Sep 29, 2016
  14. Junio C HamanoSep 29, 2016
  15. Jeff KingSep 29, 2016
  16. Kyle J. McKaySep 29, 2016
  17. Jeff KingSep 29, 2016
  18. Junio C HamanoSep 29, 2016
  19. Jeff KingSep 29, 2016
  20. Junio C HamanoSep 29, 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.