Re: [PATCH] In `git log --graph`, default to --pretty=oneline --abbrev-commit
- From
Alex Henrie <alexhenrie24@gmail.com>
- Date
- Mar 25, 2019, 05:10 UTC
- Message-ID
- <CAMMLpeQGz85ogLgKX6DBMyz0wpRvW9fXCpK87m+JoT9i7hw1Kw@mail.gmail.com>
- In-Reply-To
- <20190325011717.GA5357@rigel>
On Sun, Mar 24, 2019 at 7:18 PM Rafael Ascensão <rafa.almas@gmail.com> wrote:
Show 11 quoted lines
> > 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.
The way that I wrote the patch, if format.pretty is not defined then `git log` will default to one format and `git log --graph` will default to another. I admit that it is a bit of a hack.
On Sun, Mar 24, 2019 at 12:58 PM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
Show 5 quoted lines
> > But maybe a built-in "git-graph" is in order? E.g. one can imagine that > once we have a dedicated command for that (similar to range-diff) you > could really focus on the UX of that, e.g. going further than --oneline > and truncating a N+ divergence as "...and N more.." or something.
I like the idea of a completely separate `git graph` command. This command would simply be a builtin alias for `git log --abbrev-commit --pretty=oneline`, like how `git reflog` is a builtin alias for `git log -g --abbrev-commit --pretty=oneline`. Junio, would you be on board with that?
-Alex