Skip to content

Add mailmap support to ref-filter

Kousik Sanagavarapu git 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 0 repliesNew
  2. v12 patches 4 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3t/t6300: cleanup test_atomt/t6300-for-each-ref.sh+10 -60 replies
2/3t/t6300: introduce test_bad_atomt/t6300-for-each-ref.sh+24 -00 replies
3/3ref-filter: add mailmap supportDocumentation/git-for-each-ref.txt ref-filter.c t/t6300-for-each-ref.sh+206 -370 replies

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by.

PatchJunio C HamanoChristian CouderHariom Verma
1/3Helped-by Mentored-by Mentored-by
2/3Mentored-by Mentored-by
3/3Mentored-by Mentored-by

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH v2 0/3] Add mailmap support to ref-filter

Thanks Junio for review on the previous round.

PATCH 1/3 - Cleanup test_atom to be less error-prone

PATCH 2/3 - Fix hidden breakage

PATCH 3/3 - Unchanged

Kousik Sanagavarapu (3):
t/t6300: cleanup test_atom
t/t6300: introduce test_bad_atom
ref-filter: add mailmap support

 Documentation/git-for-each-ref.txt |   6 +-
 ref-filter.c                       | 152 ++++++++++++++++++++++-------
 t/t6300-for-each-ref.sh            | 123 +++++++++++++++++++++--
 3 files changed, 239 insertions(+), 42 deletions(-)

Range-diff against v1:

-:  ---------- > 1:  b28e858e35 t/t6300: cleanup test_atom
1:  0a90b67889 ! 2:  ee90d017d5 t/t6300: introduce test_bad_atom()

@@ Metadata
Author: Kousik Sanagavarapu <[email protected]>

## Commit message ##
- t/t6300: introduce test_bad_atom()
+ t/t6300: introduce test_bad_atom

- Introduce a new function "test_bad_atom()", which is similar to
+ Introduce a new function "test_bad_atom", which is similar to
"test_atom()" but should be used to check whether the correct error message is shown on stderr.

- Like "test_atom()", the new function takes three arguments. The three
+ Like "test_atom", the new function takes three arguments. The three
arguments specify the ref, the format and the expected error message respectively, with an optional fourth argument for tweaking "test_expect_*" (which is by default "success").
@@ t/t6300-for-each-ref.sh: test_expect_success 'arguments to %(objectname:short=)
test_must_fail git for-each-ref --format="%(objectname:short=foo)"
'

-+test_bad_atom() {
++test_bad_atom () {
+ case "$1" in
+ head) ref=refs/heads/main ;;
+ tag) ref=refs/tags/testtag ;;
+ sym) ref=refs/heads/sym ;;
+ *) ref=$1 ;;
+ esac
-+ printf '%s\n' "$3">expect
-+ test_expect_${4:-success} $PREREQ "err basic atom: $1 $2" "
-+ test_must_fail git for-each-ref --format='%($2)' $ref 2>actual &&
-+ test_cmp expect actual
-+ "
++ format=$2
++ test_do=test_expect_${4:-success}
++
++ printf '%s\n' "$3" >expect
++ $test_do $PREREQ "err basic atom: $ref $format" '
++ test_must_fail git for-each-ref \
++ --format="%($format)" "$ref" 2>error &&
++ test_cmp expect error
++ '
+}
+
+test_bad_atom head 'authoremail:foo' \
+ 'fatal: unrecognized %(authoremail) argument: foo' +
+test_bad_atom tag 'taggeremail:localpart trim' \
-+ 'fatal: unrecognized %(taggeremail) argument: trim' ++ 'fatal: unrecognized %(taggeremail) argument: localpart trim'
+
test_date () {
f=$1 &&
2: 63fc69f4dc ! 3: fdc14fe80b ref-filter: add mailmap support

    @@ t/t6300-for-each-ref.sh: test_atom tag '*objectname' $(git rev-parse refs/tags/t
      test_atom tag taggerdate 'Tue Jul 4 01:18:45 2006 +0200'
      test_atom tag creator 'C O Mitter <[email protected]> 1151968725 +0200'
      test_atom tag creatordate 'Tue Jul 4 01:18:45 2006 +0200'
    -@@ t/t6300-for-each-ref.sh: test_bad_atom() {
    +@@ t/t6300-for-each-ref.sh: test_bad_atom () {
      test_bad_atom head 'authoremail:foo' \
        'fatal: unrecognized %(authoremail) argument: foo'

    @@ t/t6300-for-each-ref.sh: test_bad_atom() {
     +  'fatal: unrecognized %(taggeremail) argument: ;localpart trim'
     +
      test_bad_atom tag 'taggeremail:localpart trim' \
    -   'fatal: unrecognized %(taggeremail) argument:  trim'
    -
    +-  'fatal: unrecognized %(taggeremail) argument: localpart trim'
    ++  'fatal: unrecognized %(taggeremail) argument:  trim'
    ++
     +test_bad_atom tag 'taggeremail:mailmap,mailmap,trim,qux,localpart,trim' \
     +  'fatal: unrecognized %(taggeremail) argument: qux,localpart,trim'
    -+
    +
      test_date () {
        f=$1 &&
    -   committer_date=$2 &&
Signature · 1 line
2.42.0.273.ge948a9aaf4