git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Jacob Keller <jacob.e.keller@intel.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v2] tag: support configuring --sort via .gitconfig
Date: Thu, 10 Jul 2014 00:00:19 -0400	[thread overview]
Message-ID: <20140710040019.GC28401@sigill.intra.peff.net> (raw)
In-Reply-To: <1404945412-10197-1-git-send-email-jacob.e.keller@intel.com>

On Wed, Jul 09, 2014 at 03:36:51PM -0700, Jacob Keller wrote:

> Add support for configuring default sort ordering for git tags. Command
> line option will override this configured value, using the exact same
> syntax.

Thanks, this version looks pretty good to me. A few minor comments:

> +	if (!strcmp(var, "tag.sort")) {
> +		tag_sort = parse_sort_string(value);
> +	}

Our style is to usually avoid braces for a one-liner. However, I think
would actually make sense to "return 0" from this conditional.

> +test_expect_success 'configured lexical sort' '
> +	git config tag.sort "v:refname" &&
> +	git tag -l "foo*" >actual &&
> [...]

Please use:

  test_config tag.sort "v:refname"

here, which will clean up the config value after the test ends (and thus
not pollute any later tests).

Though you will need to add an extra "test_config" to the following
test:

> +test_expect_success 'option override configured sort' '
> +	git tag -l --sort=-refname "foo*" >actual &&
> [...]

I think that's a good thing, though (it makes it more clear in the
second test what is being tested, rather than relying on the state left
by the previous test).

-Peff

  reply	other threads:[~2014-07-10  4:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-09 22:36 [PATCH v2] tag: support configuring --sort via .gitconfig Jacob Keller
2014-07-10  4:00 ` Jeff King [this message]
2014-07-10  4:07 ` Jeff King
2014-07-10 17:59   ` Junio C Hamano
2014-07-10 19:34     ` Jeff King
2014-07-10 21:50       ` Keller, Jacob E
2014-07-10 22:46         ` Junio C Hamano
2014-07-10 20:38   ` Keller, Jacob E

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=20140710040019.GC28401@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=jacob.e.keller@intel.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).