Jeff King <peff@xxxxxxxx> writes: > would sort the primary key (taggername) case-insensitively, but sort the > refname case-sensitively. We have two options here: > > - teach callers to set ignore_case on the whole list > > - replace the ref_sorting list with a struct that contains both the > list of sorting keys, as well as options that apply to _all_ > keys > > I went with the first one here, as it gives more flexibility if we later > want to let the users set the flag per-key (presumably through some > special syntax when defining the key; for now it's all or nothing > through --ignore-case). A good design decision I would fully support. > +test_expect_success 'for-each-ref --ignore-case works on multiple sort keys' ' > + # name refs numerically to avoid case-insensitive filesystem conflicts Very considerate. If I were writing these nested loops, I am sure I would have used "tag-$email-$subject" to be cute. Queued. Thanks. > + nr=0 && > + for email in a A b B > + do > + for subject in a A b B > + do > + GIT_COMMITTER_EMAIL="$email@xxxxxxxxxxx" \ > + git tag -m "tag $subject" icase-$(printf %02d $nr) && > + nr=$((nr+1))|| > + return 1 > + done > + done && > + git for-each-ref --ignore-case \ > + --format="%(taggeremail) %(subject) %(refname)" \ > + --sort=refname \ > + --sort=subject \ > + --sort=taggeremail \ > + refs/tags/icase-* >actual && > + cat >expect <<-\EOF && > + <a@xxxxxxxxxxx> tag a refs/tags/icase-00 > + <a@xxxxxxxxxxx> tag A refs/tags/icase-01 > + <A@xxxxxxxxxxx> tag a refs/tags/icase-04 > + <A@xxxxxxxxxxx> tag A refs/tags/icase-05 > + <a@xxxxxxxxxxx> tag b refs/tags/icase-02 > + <a@xxxxxxxxxxx> tag B refs/tags/icase-03 > + <A@xxxxxxxxxxx> tag b refs/tags/icase-06 > + <A@xxxxxxxxxxx> tag B refs/tags/icase-07 > + <b@xxxxxxxxxxx> tag a refs/tags/icase-08 > + <b@xxxxxxxxxxx> tag A refs/tags/icase-09 > + <B@xxxxxxxxxxx> tag a refs/tags/icase-12 > + <B@xxxxxxxxxxx> tag A refs/tags/icase-13 > + <b@xxxxxxxxxxx> tag b refs/tags/icase-10 > + <b@xxxxxxxxxxx> tag B refs/tags/icase-11 > + <B@xxxxxxxxxxx> tag b refs/tags/icase-14 > + <B@xxxxxxxxxxx> tag B refs/tags/icase-15 > + EOF > + test_cmp expect actual > +' > + > test_done