]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'ab/mailmap'
authorJunio C Hamano <gitster@pobox.com>
Mon, 25 Jan 2021 22:19:19 +0000 (14:19 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 25 Jan 2021 22:19:19 +0000 (14:19 -0800)
Clean-up docs, codepaths and tests around mailmap.

* ab/mailmap: (22 commits)
  shortlog: remove unused(?) "repo-abbrev" feature
  mailmap doc + tests: document and test for case-insensitivity
  mailmap tests: add tests for empty "<>" syntax
  mailmap tests: add tests for whitespace syntax
  mailmap tests: add a test for comment syntax
  mailmap doc + tests: add better examples & test them
  tests: refactor a few tests to use "test_commit --append"
  test-lib functions: add an --append option to test_commit
  test-lib functions: add --author support to test_commit
  test-lib functions: document arguments to test_commit
  test-lib functions: expand "test_commit" comment template
  mailmap: test for silent exiting on missing file/blob
  mailmap tests: get rid of overly complex blame fuzzing
  mailmap tests: add a test for "not a blob" error
  mailmap tests: remove redundant entry in test
  mailmap tests: improve --stdin tests
  mailmap tests: modernize syntax & test idioms
  mailmap tests: use our preferred whitespace syntax
  mailmap doc: start by mentioning the comment syntax
  check-mailmap doc: note config options
  ...

1  2 
builtin/blame.c
builtin/log.c
builtin/shortlog.c
t/t2012-checkout-last.sh
t/t4203-mailmap.sh
t/t7810-grep.sh
t/test-lib-functions.sh

diff --cc builtin/blame.c
Simple merge
diff --cc builtin/log.c
Simple merge
Simple merge
index 028a00d6baa2190974de155d71497693e7ccafc9,c95aa3e78fdc747f3703acbfe257f9cab9156038..0e7d47ab318338a211bf444f890176086b9fed5d
@@@ -96,27 -89,25 +92,25 @@@ test_expect_success 'switch to twelfth 
  
  test_expect_success 'merge base test setup' '
        git checkout -b another other &&
-       echo "hello again" >>world &&
-       git add world &&
-       git commit -m third
+       test_commit --append third world "hello again"
  '
  
 -test_expect_success 'another...master' '
 +test_expect_success 'another...main' '
        git checkout another &&
 -      git checkout another...master &&
 -      test "z$(git rev-parse --verify HEAD)" = "z$(git rev-parse --verify master^)"
 +      git checkout another...main &&
 +      test "z$(git rev-parse --verify HEAD)" = "z$(git rev-parse --verify main^)"
  '
  
 -test_expect_success '...master' '
 +test_expect_success '...main' '
        git checkout another &&
 -      git checkout ...master &&
 -      test "z$(git rev-parse --verify HEAD)" = "z$(git rev-parse --verify master^)"
 +      git checkout ...main &&
 +      test "z$(git rev-parse --verify HEAD)" = "z$(git rev-parse --verify main^)"
  '
  
 -test_expect_success 'master...' '
 +test_expect_success 'main...' '
        git checkout another &&
 -      git checkout master... &&
 -      test "z$(git rev-parse --verify HEAD)" = "z$(git rev-parse --verify master^)"
 +      git checkout main... &&
 +      test "z$(git rev-parse --verify HEAD)" = "z$(git rev-parse --verify main^)"
  '
  
  test_expect_success '"checkout -" works after a rebase A' '
index 3f82c651b4522e83d507a8f6efbf573dd9ee95df,89cb300f28262810fb7c6944fdc61d82b91658c4..6fb18a34b05a306134434f6d3279071363d660ed
@@@ -2,33 -2,11 +2,14 @@@
  
  test_description='.mailmap configurations'
  
 +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
 +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 +
  . ./test-lib.sh
  
- fuzz_blame () {
-       sed "
-               s/$_x05[0-9a-f][0-9a-f][0-9a-f]/OBJID/g
-               s/$_x05[0-9a-f][0-9a-f]/OBJI/g
-               s/[-0-9]\{10\} [:0-9]\{8\} [-+][0-9]\{4\}/DATE/g
-       " "$@"
- }
- test_expect_success setup '
-       cat >contacts <<- EOF &&
-       $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>
-       nick1 <bugs@company.xx>
-       EOF
-       echo one >one &&
-       git add one &&
-       test_tick &&
-       git commit -m initial &&
-       echo two >>one &&
-       git add one &&
-       test_tick &&
-       git commit --author "nick1 <bugs@company.xx>" -m second
+ test_expect_success 'setup commits and contacts file' '
+       test_commit initial one one &&
+       test_commit --author "nick1 <bugs@company.xx>" --append second one two
  '
  
  test_expect_success 'check-mailmap no arguments' '
@@@ -197,11 -254,11 +257,11 @@@ test_expect_success 'No mailmap files, 
  
  test_expect_success 'setup mailmap blob tests' '
        git checkout -b map &&
 -      test_when_finished "git checkout master" &&
 +      test_when_finished "git checkout main" &&
-       cat >just-bugs <<- EOF &&
+       cat >just-bugs <<-\EOF &&
        Blob Guy <bugs@company.xx>
        EOF
-       cat >both <<- EOF &&
+       cat >both <<-EOF &&
        Blob Guy <$GIT_AUTHOR_EMAIL>
        Blob Guy <bugs@company.xx>
        EOF
diff --cc t/t7810-grep.sh
Simple merge
Simple merge