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

Re: [PATCH] In `git log --graph`, default to --pretty=oneline --abbrev-commit

From
Rafael Ascensão <rafa.almas@gmail.com>
Date
Mar 25, 2019, 01:17 UTC
Message-ID
<20190325011717.GA5357@rigel>
In-Reply-To
<CAMMLpeQbz5qHyK8e4gZ0zKQ5na+zQCd49GZifKZ_iO-gXrs1Gg@mail.gmail.com>
Hi Alex,
On Sun, Mar 24, 2019 at 04:37:25PM -0600, Alex Henrie wrote:
> 
> Can we compromise and make --pretty=short the default for --graph?
> 

I agree that `pretty=medium` is sometimes hard to read and, as of now, `pretty=oneline` can be very misleading:

    $ git log --graph --oneline todo~2..todo master~2..master

This will look like you have a sequence of commits when in fact they are completely unrelated.

But If we make the default to 'short' (or anything else), what should be done if the user has `format.pretty=` defined to something? Is `--graph` special to be allowed to not follow said configuration?

It's inconsistent itself, and introduces inconsistencies on other things like the configuration above.

In my opinion, a better alternative could be having a configuration like log.graphFormat, similarly how we have log.graphColors for colors, to determine which format should be used with --graph.

This would still require user configuration which may be what you were trying to avoid by proposing the change in default behaviour.

Settling for a compromise feels like giving up on the strengths from both.

Cheers, Rafael Ascensão

Previous: Alex HenrieNext: Alex Henrie
Message 6 of 10 in “In `git log --graph`, default to --pretty=oneline --abbrev-commit”
  1. In `git log --graph`, default to --pretty=oneline --abbrev-commitAlex Henrie, Mar 23, 2019
  2. Abhisek Ghosh, Mar 23, 2019
  3. Junio C HamanoMar 24, 2019
  4. Ævar Arnfjörð BjarmasonMar 24, 2019
  5. Alex HenrieMar 24, 2019
  6. Rafael AscensãoMar 25, 2019
  7. Alex HenrieMar 25, 2019
  8. Alex HenrieMar 25, 2019
  9. Junio C HamanoApr 1, 2019
  10. Alex HenrieMar 27, 2019

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.