From: Junio C Hamano Date: Mon, 25 Jan 2021 22:19:19 +0000 (-0800) Subject: Merge branch 'ab/mailmap' X-Git-Tag: v2.31.0-rc0~99 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=42342b3ee6223201c92493043b78cc79b555abdc;p=thirdparty%2Fgit.git Merge branch 'ab/mailmap' 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 ... --- 42342b3ee6223201c92493043b78cc79b555abdc diff --cc t/t2012-checkout-last.sh index 028a00d6ba,c95aa3e78f..0e7d47ab31 --- a/t/t2012-checkout-last.sh +++ b/t/t2012-checkout-last.sh @@@ -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' ' diff --cc t/t4203-mailmap.sh index 3f82c651b4,89cb300f28..6fb18a34b0 --- a/t/t4203-mailmap.sh +++ b/t/t4203-mailmap.sh @@@ -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 - 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 " -m second + test_expect_success 'setup commits and contacts file' ' + test_commit initial one one && + test_commit --author "nick1 " --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 EOF - cat >both <<- EOF && + cat >both <<-EOF && Blob Guy <$GIT_AUTHOR_EMAIL> Blob Guy EOF