diff options
author | Jacob Keller <jacob.e.keller@intel.com> | 2014-07-16 14:48:02 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-07-17 09:22:20 -0700 |
commit | b150794dafb0a7a1c5caba6fdf7d517a1a15cb59 (patch) | |
tree | c9be5e6f007751afc160a475fa96040ea048f471 /t | |
parent | dc662d449f56cb969025db4fe54fa3374777495c (diff) | |
download | git-b150794dafb0a7a1c5caba6fdf7d517a1a15cb59.tar.gz git-b150794dafb0a7a1c5caba6fdf7d517a1a15cb59.tar.xz |
tag: support configuring --sort via .gitconfig
Add support for configuring default sort ordering for git tags. Command
line option will override this configured value, using the exact same
syntax.
Cc: Jeff King <peff@peff.net>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t7004-tag.sh | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh index 66010b0e7..036665308 100755 --- a/t/t7004-tag.sh +++ b/t/t7004-tag.sh @@ -1423,6 +1423,42 @@ test_expect_success 'reverse lexical sort' ' test_cmp expect actual ' +test_expect_success 'configured lexical sort' ' + git config tag.sort "v:refname" && + git tag -l "foo*" >actual && + cat >expect <<-\EOF && + foo1.3 + foo1.6 + foo1.10 + EOF + test_cmp expect actual +' + +test_expect_success 'option override configured sort' ' + git tag -l --sort=-refname "foo*" >actual && + cat >expect <<-\EOF && + foo1.6 + foo1.3 + foo1.10 + EOF + test_cmp expect actual +' + +test_expect_success 'invalid sort parameter on command line' ' + test_must_fail git tag -l --sort=notvalid "foo*" >actual +' + +test_expect_success 'invalid sort parameter in configuratoin' ' + git config tag.sort "v:notvalid" && + git tag -l "foo*" >actual && + cat >expect <<-\EOF && + foo1.10 + foo1.3 + foo1.6 + EOF + test_cmp expect actual +' + run_with_limited_stack () { (ulimit -s 64 && "$@") } |