Re: [PATCH] log: if --decorate is not given, default to --decorate=auto
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 21, 2017, 17:34 UTC
- Message-ID
- <xmqqinn2sfdw.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20170321055203.26488-1-alexhenrie24@gmail.com>
Alex Henrie <alexhenrie24@gmail.com> writes:
Show 7 quoted lines
> Git's branching and merging system can be confusing, especially to new > users. When teaching people Git, I tell them to set log.decorate=auto. > This preference greatly improves the user's awareness of the local and > remote branches. So for the sake of user friendliness, I'd like to > change the default from log.decorate=no to log.decorate=auto. > > Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
I guess this is an analog of making color.ui default to "auto" we did earlier. After having shipped with a more conservative default while letting willing users experiment/experience to help us get the kinks out of the "auto" setting, it probably is about time to flip the default.
Show 12 quoted lines
> diff --git a/t/t4202-log.sh b/t/t4202-log.sh > index 48b55bfd2..3aa8daba3 100755 > --- a/t/t4202-log.sh > +++ b/t/t4202-log.sh > @@ -520,7 +520,7 @@ test_expect_success 'log --graph with merge' ' > ' > > test_expect_success 'log.decorate configuration' ' > - git log --oneline >expect.none && > + git log --oneline --no-decorate >expect.none && > git log --oneline --decorate >expect.short && > git log --oneline --decorate=full >expect.full &&
This ensures that an explicit --no-decorate from the command line does give "none" output, which we failed to do so far, and is a good change. Don't we also need a _new_ test to ensure that "auto" kicks in without any explicit request? Knowing the implementation that pager-in-use triggers the "auto" behaviour, perhaps testing the output from "git -p log" would be sufficient?