tag, branch, for-each-ref: add --ignore-case for sorting and filtering

This options makes sorting ignore case, which is great when you have
branches named bug-12-do-something, Bug-12-do-some-more and
BUG-12-do-what and want to group them together. Sorting externally may
not be an option because we lose coloring and column layout from
git-branch and git-tag.

The same could be said for filtering, but it's probably less important
because you can always go with the ugly pattern [bB][uU][gG]-* if you're
desperate.

You can't have case-sensitive filtering and case-insensitive sorting (or
the other way around) with this though. For branch and tag, that should
be no problem. for-each-ref, as a plumbing, might want finer control.
But we can always add --{filter,sort}-ignore-case when there is a need
for it.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Nguyễn Thái Ngọc Duy
2016-12-04 09:52:25 +07:00
committed by Junio C Hamano
parent 454cb6bd52
commit 3bb16a8bf2
10 changed files with 112 additions and 17 deletions

View File

@ -118,6 +118,10 @@ OPTIONS
default to color output.
Same as `--color=never`.
-i::
--ignore-case::
Sorting and filtering branches are case insensitive.
--column[=<options>]::
--no-column::
Display branch listing in columns. See configuration variable

View File

@ -79,6 +79,9 @@ OPTIONS
Only list refs which contain the specified commit (HEAD if not
specified).
--ignore-case::
Sorting and filtering refs are case insensitive.
FIELD NAMES
-----------

View File

@ -108,6 +108,10 @@ OPTIONS
variable if it exists, or lexicographic order otherwise. See
linkgit:git-config[1].
-i::
--ignore-case::
Sorting and filtering tags are case insensitive.
--column[=<options>]::
--no-column::
Display tag listing in columns. See configuration variable