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

Re: [GSoC Project RFC] "git log --oneline" improvements

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 20, 2020, 23:36 UTC
Message-ID
<xmqqwo7ea99z.fsf@gitster.c.googlers.com>
In-Reply-To
<28aee28c-8e8d-763a-66c7-d365025e56a2@gmail.com>
Parth Gala <parthpgala@gmail.com> writes:
Show 29 quoted lines
> I went through the discussions here[1] and here[2] and what I could
> conclude from [1] is, the 'git log --oneline' command currently shows the
> decorations of a commit before the commit message but after the shortened
> hash due to which the alignment of the messages is disturbed like this,
>
>     3f07dac29 (HEAD -> master) pathspec: don't error out on all-excl...
>     ca4a562f2 pathspec magic: add '^' as alias for '!'
>     02555c1b2 ls-remote: add "--diff" option to show only refs that differ
>     6e3a7b339 (tag: v2.12.0-rc0, origin/master, origin/HEAD) Git 2.12-rc0
>     fafca0f72 Merge branch 'cw/log-updates-for-all-refs-really'
>     74dee5cfa Merge branch 'pl/complete-diff-submodule-diff'
>     36acf4123 Merge branch 'rs/object-id'
>
> And if the decorations were to be shown after the message and you were
> checking the logs just to see the status of a branch rather than the
> contents then you would again be at a disadvantage, since you would want
> to have them visible right next to the hashes. Besides decorations at the
> end would have the inconvenience of being truncated at the end of the line
> on smaller screens.
>
> This format for --oneline with decorations was decided upon,
>
>   b9df16a4c (HEAD -> master)
>             pathspec: don't error out on all-exclusionary pathspec patterns
>   91a491f05 pathspec magic: add '^' as alias for '!'
>   c8e05fd6d ls-remote: add "--diff" option to show only refs that differ
>   20769079d (tag: v2.12.0-rc2, origin/master, origin/HEAD)
>             Git 2.12-rc2
>   076c05393 Hopefully the final batch of mini-topics before the final

Hmph. Who decided that such a format is a good idea? I do not see anything decided positively in the thread [1] you referred to.

Show 17 quoted lines
> In [2] such formats with date and timestamp are discussed along with
> compatibility for --graph option as well,
>
>   === 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
>
> So these are the two main formats to be enhanced along with as many options
> of log as possible. What are your views on this ?
>

Making the "--oneline" format to consume more than one line for a commit is probably not what we want anyway.

Coming up with a new format (say, "--pretty=concise"), or a new option that tweaks the behaviour of "--oneline", are possible ways to add a new feature without disrupting existing users' use cases, though.

Thanks.
Previous: Parth GalaNext: Parth Gala
Message 2 of 4 in “[GSoC Project RFC] "git log --oneline" improvements”
  1. Parth GalaMar 20, 2020
  2. Junio C HamanoMar 20, 2020
  3. Parth GalaMar 21, 2020
  4. Junio C HamanoMar 21, 2020

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.