From: Eric Sunshine <sunshine@sunshineco.com>
To: samuel.maftoul@gmail.com
Cc: Git List <git@vger.kernel.org>, Jeff King <peff@peff.net>,
Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] branch: support configuring --sort via .gitconfig
Date: Thu, 16 Aug 2018 04:56:07 -0400 [thread overview]
Message-ID: <CAPig+cR5cu3cxtpdHsbSSK7xWRpMQh_sv5nvunZrojAOkFeedg@mail.gmail.com> (raw)
In-Reply-To: <20180816080549.33544-1-samuel.maftoul@gmail.com>
On Thu, Aug 16, 2018 at 4:06 AM <samuel.maftoul@gmail.com> wrote:
> Add support for configuring default sort ordering for git branches. Command
> line option will override this configured value, using the exact same
> syntax.
>
> Signed-off-by: Samuel Maftoul <samuel.maftoul@gmail.com>
> ---
> diff --git a/Documentation/config.txt b/Documentation/config.txt
> @@ -1034,6 +1034,12 @@ branch.autoSetupRebase::
> +branch.sort::
> + This variable controls the sort ordering of branches when displayed by
> + linkgit:git-branch[1]. Without the "--sort=<value>" option provided, the
> + value of this variable will be used as the default.
> + See linkgit:git-for-each-ref[1] field names for valid values.
Thanks for adding some information about what values are valid for
this config variable.
> diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt
> @@ -272,6 +272,9 @@ start-point is either a local or remote-tracking branch.
> full refname (including `refs/...` prefix). This lists
> detached HEAD (if present) first, then local branches and
> finally remote-tracking branches.
> + Sort order defaults to the value configured for the `branch.sort`
> + variable if it exists, or lexicographic order otherwise. See
> + linkgit:git-config[1].
This change still has problems pointed out by my earlier review[1].
The existing text in git-branch.txt says:
Sort order defaults to sorting based on the
full refname...
Which is both redundant with the new text you add and seems to say
something rather different.
> diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
> @@ -1305,4 +1305,51 @@ test_expect_success 'tracking with unexpected .fetch refspec' '
> +test_expect_success 'invalid sort parameter in configuration' '
> + (
> + cd sort &&
> + git config branch.sort "v:notvalid" &&
> + test_must_fail git branch
> +
> + )
> +'
See my earlier review[1] regarding the unnecessary blank line in this new test.
[1]: https://public-inbox.org/git/CAPig+cSUy7rFwhmJ1SFHsAjPkoWparfY6wAjV=6kJyUL3SLQUw@mail.gmail.com/
next prev parent reply other threads:[~2018-08-16 8:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-15 11:15 [PATCH] branch: support configuring --sort via .gitconfig samuel.maftoul
2018-08-15 16:59 ` Eric Sunshine
2018-08-16 8:05 ` samuel.maftoul
2018-08-16 8:56 ` Eric Sunshine [this message]
2018-08-16 9:35 ` samuel.maftoul
2018-08-16 18:16 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAPig+cR5cu3cxtpdHsbSSK7xWRpMQh_sv5nvunZrojAOkFeedg@mail.gmail.com \
--to=sunshine@sunshineco.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
--cc=samuel.maftoul@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).