Use main as default branch name
PATCH 19/28 t6[4-9]*: adjust the references to the default branch name "main"
In reply to Johannes Schindelin via GitGitGadgetFrom: Johannes Schindelin <[email protected]>
This trick was performed via
$ (cd t && sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \ -e 's/Master/Main/g' -- t6[4-9]*.sh)
This allows us to define GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main for those tests.
--- t/t6400-merge-df.sh | 6 +-- t/t6402-merge-rename.sh | 46 +++++++++++------------ t/t6404-recursive-merge.sh | 4 +- t/t6405-merge-symlinks.sh | 14 +++---- t/t6406-merge-attr.sh | 24 ++++++------ t/t6407-merge-binary.sh | 6 +-- t/t6409-merge-subtree.sh | 16 ++++---- t/t6411-merge-filemode.sh | 10 ++--- t/t6412-merge-large-rename.sh | 6 +-- t/t6413-merge-crlf.sh | 2 +- t/t6414-merge-rename-nocruft.sh | 2 +- t/t6415-merge-dir-to-symlink.sh | 22 +++++------ t/t6416-recursive-corner-cases.sh | 28 +++++++------- t/t6417-merge-ours-theirs.sh | 28 +++++++------- t/t6418-merge-text-auto.sh | 12 +++--- t/t6419-merge-ignorecase.sh | 10 ++--- t/t6422-merge-rename-corner-cases.sh | 12 +++--- t/t6425-merge-rename-delete.sh | 2 +- t/t6427-diff3-conflict-markers.sh | 14 +++---- t/t6430-merge-recursive.sh | 18 ++++----- t/t6432-merge-recursive-space-options.sh | 6 +-- t/t6433-merge-toplevel.sh | 8 ++-- t/t6434-merge-recursive-rename-options.sh | 6 +-- t/t6436-merge-overwrite.sh | 2 +- t/t6437-submodule-merge.sh | 14 +++---- t/t6439-merge-co-error-msgs.sh | 6 +-- t/t6501-freshen-objects.sh | 2 +- t/test-lib.sh | 2 +- 28 files changed, 164 insertions(+), 164 deletions(-)
t/t6400-merge-df.sh +3 -3
@@ -24,12 +24,12 @@ test_expect_success 'prepare repository' ' ' test_expect_success 'Merge with d/f conflicts' ' - test_expect_code 1 git merge -m "merge msg" master + test_expect_code 1 git merge -m "merge msg" main ' test_expect_success 'F/D conflict' ' git reset --hard && - git checkout master && + git checkout main && rm .git/index && mkdir before &&
@@ -47,7 +47,7 @@ test_expect_success 'F/D conflict' ' git add . && git commit -m para && - git merge master + git merge main ' test_expect_success 'setup modify/delete + directory/file conflict' '
t/t6402-merge-rename.sh +23 -23
164 lines not on this page · raw message
t/t6404-recursive-merge.sh +2 -2
@@ -19,11 +19,11 @@ test_expect_success 'setup tests' ' git add a1 && GIT_AUTHOR_DATE="2006-12-12 23:00:00" git commit -m 1 a1 && - git checkout -b A master && + git checkout -b A main && echo A >a1 && GIT_AUTHOR_DATE="2006-12-12 23:00:01" git commit -m A a1 && - git checkout -b B master && + git checkout -b B main && echo B >a1 && GIT_AUTHOR_DATE="2006-12-12 23:00:02" git commit -m B a1 &&
t/t6405-merge-symlinks.sh +7 -7
@@ -19,7 +19,7 @@ test_expect_success 'setup' ' git branch b-file && l=$(printf file | git hash-object -t blob -w --stdin) && echo "120000 $l symlink" | git update-index --index-info && - git commit -m master && + git commit -m main && git checkout b-symlink && l=$(printf file-different | git hash-object -t blob -w --stdin) && echo "120000 $l symlink" | git update-index --index-info &&
@@ -30,28 +30,28 @@ test_expect_success 'setup' ' git commit -m b-file ' -test_expect_success 'merge master into b-symlink, which has a different symbolic link' ' +test_expect_success 'merge main into b-symlink, which has a different symbolic link' ' git checkout b-symlink && - test_must_fail git merge master + test_must_fail git merge main ' test_expect_success 'the merge result must be a file' ' test_path_is_file symlink ' -test_expect_success 'merge master into b-file, which has a file instead of a symbolic link' ' +test_expect_success 'merge main into b-file, which has a file instead of a symbolic link' ' git reset --hard && git checkout b-file && - test_must_fail git merge master + test_must_fail git merge main ' test_expect_success 'the merge result must be a file' ' test_path_is_file symlink ' -test_expect_success 'merge b-file, which has a file instead of a symbolic link, into master' ' +test_expect_success 'merge b-file, which has a file instead of a symbolic link, into main' ' git reset --hard && - git checkout master && + git checkout main && test_must_fail git merge b-file '
t/t6406-merge-attr.sh +12 -12
@@ -19,10 +19,10 @@ test_expect_success setup ' git branch side && for f in text binary union do - echo Master >>$f && git add $f || return 1 + echo Main >>$f && git add $f || return 1 done && test_tick && - git commit -m Master && + git commit -m Main && git checkout side && for f in text binary union
@@ -64,7 +64,7 @@ test_expect_success merge ' echo "union merge=union" } >.gitattributes && - if git merge master + if git merge main then echo Gaah, should have conflicted false
@@ -87,7 +87,7 @@ test_expect_success 'check merge result in working tree' ' grep "<<<<<<<" text && cmp binary-orig binary && ! grep "<<<<<<<" union && - grep Master union && + grep Main union && grep Side union '
@@ -115,13 +115,13 @@ test_expect_success 'custom merge backend' ' git config --replace-all \ merge.custom.name "custom merge driver for testing" && - git merge master && + git merge main && cmp binary union && sed -e 1,3d text >check-1 && - o=$(git unpack-file master^:text) && + o=$(git unpack-file main^:text) && a=$(git unpack-file side^:text) && - b=$(git unpack-file master:text) && + b=$(git unpack-file main:text) && sh -c "./custom-merge $o $a $b 0 text" && sed -e 1,3d $a >check-2 && cmp check-1 check-2 &&
@@ -136,7 +136,7 @@ test_expect_success 'custom merge backend' ' git config --replace-all \ merge.custom.name "custom merge driver for testing" && - if git merge master + if git merge main then echo "Eh? should have conflicted" false
@@ -146,9 +146,9 @@ test_expect_success 'custom merge backend' ' cmp binary union && sed -e 1,3d text >check-1 && - o=$(git unpack-file master^:text) && + o=$(git unpack-file main^:text) && a=$(git unpack-file anchor:text) && - b=$(git unpack-file master:text) && + b=$(git unpack-file main:text) && sh -c "./custom-merge $o $a $b 0 text" && sed -e 1,3d $a >check-2 && cmp check-1 check-2 &&
@@ -176,7 +176,7 @@ test_expect_success 'up-to-date merge without common ancestor' ' test_tick && ( cd repo1 && - git fetch ../repo2 master && + git fetch ../repo2 main && git merge --allow-unrelated-histories FETCH_HEAD ) '
@@ -201,7 +201,7 @@ test_expect_success 'custom merge does not lock index' ' # By packaging the command in test_when_finished, we get both # the correctness check and the clean-up. test_when_finished "kill \$(cat sleep.pid)" && - git merge master + git merge main ' test_done
t/t6407-merge-binary.sh +3 -3
@@ -20,7 +20,7 @@ test_expect_success setup ' git ls-files -s a >E0 && git ls-files -s m | sed -e "s/ 0 / 3 /" >E3 && test_tick && - git commit -m "master adds some" && + git commit -m "main adds some" && git checkout side && echo rezrov >>m &&
@@ -39,7 +39,7 @@ test_expect_success resolve ' rm -f a* m* && git reset --hard anchor && - if git merge -s resolve master + if git merge -s resolve main then echo Oops, should not have succeeded false
@@ -54,7 +54,7 @@ test_expect_success recursive ' rm -f a* m* && git reset --hard anchor && - if git merge -s recursive master + if git merge -s recursive main then echo Oops, should not have succeeded false
t/t6409-merge-subtree.sh +8 -8
@@ -14,10 +14,10 @@ test_expect_success setup ' echo >>hello world && git add hello && git commit -m second && - git checkout master && + git checkout main && for i in mundo $s; do echo $i; done >hello && git add hello && - git commit -m master + git commit -m main '
@@ -36,7 +36,7 @@ test_expect_success 'setup branch sub' ' ' test_expect_success 'setup topic branch' ' - git checkout -b topic master && + git checkout -b topic main && git merge -s ours --no-commit --allow-unrelated-histories sub && git read-tree --prefix=dir/ -u sub && git commit -m "initial merge of sub into topic" &&
@@ -77,8 +77,8 @@ test_expect_success 'setup' ' test_expect_success 'initial merge' ' git remote add -f gui ../git-gui && - git merge -s ours --no-commit --allow-unrelated-histories gui/master && - git read-tree --prefix=git-gui/ -u gui/master && + git merge -s ours --no-commit --allow-unrelated-histories gui/main && + git read-tree --prefix=git-gui/ -u gui/main && git commit -m "Merge git-gui as our subdirectory" && git checkout -b work && git ls-files -s >actual &&
@@ -108,10 +108,10 @@ test_expect_success 'merge update' ' test_expect_success 'initial ambiguous subtree' ' cd ../git && - git reset --hard master && + git reset --hard main && git checkout -b topic_2 && - git merge -s ours --no-commit gui/master && - git read-tree --prefix=git-gui2/ -u gui/master && + git merge -s ours --no-commit gui/main && + git read-tree --prefix=git-gui2/ -u gui/main && git commit -m "Merge git-gui2 as our subdirectory" && git checkout -b work2 && git ls-files -s >actual &&
t/t6411-merge-filemode.sh +5 -5
@@ -7,11 +7,11 @@ test_expect_success 'set up mode change in one branch' ' : >file1 && git add file1 && git commit -m initial && - git checkout -b a1 master && + git checkout -b a1 main && : >dummy && git add dummy && git commit -m a && - git checkout -b b1 master && + git checkout -b b1 main && test_chmod +x file1 && git add file1 && git commit -m b1
@@ -39,12 +39,12 @@ do_one_mode resolve b1 a1 test_expect_success 'set up mode change in both branches' ' git reset --hard HEAD && - git checkout -b a2 master && + git checkout -b a2 main && : >file2 && H=$(git hash-object file2) && test_chmod +x file2 && git commit -m a2 && - git checkout -b b2 master && + git checkout -b b2 main && : >file2 && git add file2 && git commit -m b2 &&
@@ -76,7 +76,7 @@ do_both_modes resolve test_expect_success 'set up delete/modechange scenario' ' git reset --hard && - git checkout -b deletion master && + git checkout -b deletion main && git rm file1 && git commit -m deletion '
t/t6412-merge-large-rename.sh +3 -3
@@ -30,7 +30,7 @@ test_rename() { test_expect_success "rename ($1, $2)" ' n='$1' && expect='$2' && - git checkout -f master && + git checkout -f main && test_might_fail git branch -D test$n && git reset --hard initial && for i in $(count $n); do
@@ -50,8 +50,8 @@ test_rename() { git add . && git commit -m change+rename=$n && case "$expect" in - ok) git merge master ;; - *) test_must_fail git merge master ;; + ok) git merge main ;; + *) test_must_fail git merge main ;; esac ' }
t/t6413-merge-crlf.sh +1 -1
@@ -24,7 +24,7 @@ test_expect_success setup ' echo line from b | append_cr >file && git commit -m "add line from b" file && git tag b && - git checkout master + git checkout main ' test_expect_success 'Check "ours" is CRLF' '
t/t6414-merge-rename-nocruft.sh +1 -1
@@ -65,7 +65,7 @@ test_expect_success 'setup' ' git update-index A && git commit -m "blue modify A" && - git checkout master + git checkout main ' # This test broke in 65ac6e9c3f47807cb603af07a6a9e1a43bc119ae
t/t6415-merge-dir-to-symlink.sh +11 -11
@@ -19,7 +19,7 @@ test_expect_success 'create a commit where dir a/b changed to symlink' ' test_expect_success 'checkout does not clobber untracked symlink' ' git checkout HEAD^0 && - git reset --hard master && + git reset --hard main && git rm --cached a/b && git commit -m "untracked symlink remains" && test_must_fail git checkout start^0
@@ -27,7 +27,7 @@ test_expect_success 'checkout does not clobber untracked symlink' ' test_expect_success 'a/b-2/c/d is kept when clobbering symlink b' ' git checkout HEAD^0 && - git reset --hard master && + git reset --hard main && git rm --cached a/b && git commit -m "untracked symlink remains" && git checkout -f start^0 &&
@@ -36,7 +36,7 @@ test_expect_success 'a/b-2/c/d is kept when clobbering symlink b' ' test_expect_success 'checkout should not have deleted a/b-2/c/d' ' git checkout HEAD^0 && - git reset --hard master && + git reset --hard main && git checkout start^0 && test_path_is_file a/b-2/c/d '
@@ -53,7 +53,7 @@ test_expect_success 'setup for merge test' ' test_expect_success 'Handle D/F conflict, do not lose a/b-2/c/d in merge (resolve)' ' git reset --hard && git checkout baseline^0 && - git merge -s resolve master && + git merge -s resolve main && test_path_is_file a/b-2/c/d '
@@ -64,7 +64,7 @@ test_expect_success SYMLINKS 'a/b was resolved as symlink' ' test_expect_success 'Handle D/F conflict, do not lose a/b-2/c/d in merge (recursive)' ' git reset --hard && git checkout baseline^0 && - git merge -s recursive master && + git merge -s recursive main && test_path_is_file a/b-2/c/d '
@@ -74,7 +74,7 @@ test_expect_success SYMLINKS 'a/b was resolved as symlink' ' test_expect_success 'Handle F/D conflict, do not lose a/b-2/c/d in merge (resolve)' ' git reset --hard && - git checkout master^0 && + git checkout main^0 && git merge -s resolve baseline^0 && test_path_is_file a/b-2/c/d '
@@ -85,7 +85,7 @@ test_expect_success SYMLINKS 'a/b was resolved as symlink' ' test_expect_success 'Handle F/D conflict, do not lose a/b-2/c/d in merge (recursive)' ' git reset --hard && - git checkout master^0 && + git checkout main^0 && git merge -s recursive baseline^0 && test_path_is_file a/b-2/c/d '
@@ -98,7 +98,7 @@ test_expect_failure 'do not lose untracked in merge (resolve)' ' git reset --hard && git checkout baseline^0 && >a/b/c/e && - test_must_fail git merge -s resolve master && + test_must_fail git merge -s resolve main && test_path_is_file a/b/c/e && test_path_is_file a/b-2/c/d '
@@ -107,7 +107,7 @@ test_expect_success 'do not lose untracked in merge (recursive)' ' git reset --hard && git checkout baseline^0 && >a/b/c/e && - test_must_fail git merge -s recursive master && + test_must_fail git merge -s recursive main && test_path_is_file a/b/c/e && test_path_is_file a/b-2/c/d '
@@ -116,14 +116,14 @@ test_expect_success 'do not lose modifications in merge (resolve)' ' git reset --hard && git checkout baseline^0 && echo more content >>a/b/c/d && - test_must_fail git merge -s resolve master + test_must_fail git merge -s resolve main ' test_expect_success 'do not lose modifications in merge (recursive)' ' git reset --hard && git checkout baseline^0 && echo more content >>a/b/c/d && - test_must_fail git merge -s recursive master + test_must_fail git merge -s recursive main ' test_expect_success 'setup a merge where dir a/b-2 changed to symlink' '
t/t6416-recursive-corner-cases.sh +14 -14
@@ -385,7 +385,7 @@ test_expect_success 'git detects conflict merging criss-cross+modify/delete' ' test_line_count = 2 out && git rev-parse >expect \ - master:file B:file && + main:file B:file && git rev-parse >actual \ :1:file :2:file && test_cmp expect actual
@@ -407,7 +407,7 @@ test_expect_success 'git detects conflict merging criss-cross+modify/delete, rev test_line_count = 2 out && git rev-parse >expect \ - master:file B:file && + main:file B:file && git rev-parse >actual \ :1:file :3:file && test_cmp expect actual
@@ -1553,12 +1553,12 @@ test_expect_failure 'check conflicting modes for regular file' ' # Setup: # L1---L2 # / \ / \ -# master X ? +# main X ? # \ / \ / # R1---R2 # # Where: -# master has two files, named 'b' and 'a' +# main has two files, named 'b' and 'a' # branches L1 and R1 both modify each of the two files in conflicting ways # # L2 is a merge of R1 into L1; more on it later.
@@ -1663,7 +1663,7 @@ test_expect_success 'check nested conflicts' ' cd nested_conflicts && git clean -f && - MASTER=$(git rev-parse --short master) && + MAIN=$(git rev-parse --short main) && git checkout L2^0 && # Merge must fail; there is a conflict
@@ -1679,24 +1679,24 @@ test_expect_success 'check nested conflicts' ' test_line_count = 1 out && # Create a and b from virtual merge base X - git cat-file -p master:a >base && + git cat-file -p main:a >base && git cat-file -p L1:a >ours && git cat-file -p R1:a >theirs && test_must_fail git merge-file --diff3 \ -L "Temporary merge branch 1" \ - -L "$MASTER" \ + -L "$MAIN" \ -L "Temporary merge branch 2" \ ours \ base \ theirs && sed -e "s/^\([<|=>]\)/\1\1/" ours >vmb_a && - git cat-file -p master:b >base && + git cat-file -p main:b >base && git cat-file -p L1:b >ours && git cat-file -p R1:b >theirs && test_must_fail git merge-file --diff3 \ -L "Temporary merge branch 1" \ - -L "$MASTER" \ + -L "$MAIN" \ -L "Temporary merge branch 2" \ ours \ base \
@@ -1748,12 +1748,12 @@ test_expect_success 'check nested conflicts' ' # Setup: # L1---L2---L3 # / \ / \ / \ -# master X1 X2 ? +# main X1 X2 ? # \ / \ / \ / # R1---R2---R3 # # Where: -# master has one file named 'content' +# main has one file named 'content' # branches L1 and R1 both modify each of the two files in conflicting ways # # L<n> (n>1) is a merge of R<n-1> into L<n-1>
@@ -1834,7 +1834,7 @@ test_expect_success 'check virtual merge base with nested conflicts' ' ( cd virtual_merge_base_has_nested_conflicts && - MASTER=$(git rev-parse --short master) && + MAIN=$(git rev-parse --short main) && git checkout L3^0 && # Merge must fail; there is a conflict
@@ -1857,13 +1857,13 @@ test_expect_success 'check virtual merge base with nested conflicts' ' # Imitate X1 merge base, except without long enough conflict # markers because a subsequent sed will modify them. Put # result into vmb. - git cat-file -p master:content >base && + git cat-file -p main:content >base && git cat-file -p L:content >left && git cat-file -p R:content >right && cp left merged-once && test_must_fail git merge-file --diff3 \ -L "Temporary merge branch 1" \ - -L "$MASTER" \ + -L "$MAIN" \ -L "Temporary merge branch 2" \ merged-once \ base \
t/t6417-merge-ours-theirs.sh +14 -14
@@ -20,11 +20,11 @@ test_expect_success setup ' sed -e "s/9/nueve/" >file <elif && git commit -a -m theirs && - git checkout master^0 + git checkout main^0 ' test_expect_success 'plain recursive - should conflict' ' - git reset --hard master && + git reset --hard main && test_must_fail git merge -s recursive side && grep nine file && grep nueve file &&
@@ -34,7 +34,7 @@ test_expect_success 'plain recursive - should conflict' ' ' test_expect_success 'recursive favouring theirs' ' - git reset --hard master && + git reset --hard main && git merge -s recursive -Xtheirs side && ! grep nine file && grep nueve file &&
@@ -44,7 +44,7 @@ test_expect_success 'recursive favouring theirs' ' ' test_expect_success 'recursive favouring ours' ' - git reset --hard master && + git reset --hard main && git merge -s recursive -X ours side && grep nine file && ! grep nueve file &&
@@ -56,26 +56,26 @@ test_expect_success 'recursive favouring ours' ' test_expect_success 'binary file with -Xours/-Xtheirs' ' echo file binary >.gitattributes && - git reset --hard master && + git reset --hard main && git merge -s recursive -X theirs side && git diff --exit-code side HEAD -- file && - git reset --hard master && + git reset --hard main && git merge -s recursive -X ours side && - git diff --exit-code master HEAD -- file + git diff --exit-code main HEAD -- file ' test_expect_success 'pull passes -X to underlying merge' ' - git reset --hard master && git pull -s recursive -Xours . side && - git reset --hard master && git pull -s recursive -X ours . side && - git reset --hard master && git pull -s recursive -Xtheirs . side && - git reset --hard master && git pull -s recursive -X theirs . side && - git reset --hard master && test_must_fail git pull -s recursive -X bork . side + git reset --hard main && git pull -s recursive -Xours . side && + git reset --hard main && git pull -s recursive -X ours . side && + git reset --hard main && git pull -s recursive -Xtheirs . side && + git reset --hard main && git pull -s recursive -X theirs . side && + git reset --hard main && test_must_fail git pull -s recursive -X bork . side ' test_expect_success SYMLINKS 'symlink with -Xours/-Xtheirs' ' - git reset --hard master && - git checkout -b two master && + git reset --hard main && + git checkout -b two main && ln -s target-zero link && git add link && git commit -m "add link pointing to zero" &&
t/t6418-merge-text-auto.sh +6 -6
@@ -2,13 +2,13 @@ test_description='CRLF merge conflict across text=auto change -* [master] remove .gitattributes +* [main] remove .gitattributes ! [side] add line from b -- + [side] add line from b -* [master] remove .gitattributes -* [master^] add line from a -* [master~2] normalize file +* [main] remove .gitattributes +* [main^] add line from a +* [main~2] normalize file *+ [side^] Initial '
@@ -64,7 +64,7 @@ test_expect_success setup ' git commit -m "add line from b" && git tag b && - git checkout master + git checkout main ' test_expect_success 'set up fuzz_conflict() helper' '
@@ -195,7 +195,7 @@ test_expect_success 'Test delete/normalize conflict' ' git reset --hard initial && git rm file && git commit -m "remove file" && - git checkout master && + git checkout main && git reset --hard a^ && git merge side && test_path_is_missing file
t/t6419-merge-ignorecase.sh +5 -5
@@ -20,18 +20,18 @@ test_expect_success 'merge with case-changing rename' ' >foo && git add foo && git commit -m "intervening commit" && - git checkout master && + git checkout main && git rm TestCase && >testcase && git add testcase && git commit -m "rename to testcase" && git checkout with-camel && - git merge master -m "merge" && + git merge main -m "merge" && test_path_is_file testcase ' test_expect_success 'merge with case-changing rename on both sides' ' - git checkout master && + git checkout main && git reset --hard baseline && git branch -D with-camel && git checkout -b with-camel &&
@@ -40,13 +40,13 @@ test_expect_success 'merge with case-changing rename on both sides' ' >foo && git add foo && git commit -m "intervening commit" && - git checkout master && + git checkout main && git rm TestCase && >testcase && git add testcase && git commit -m "rename to testcase" && git checkout with-camel && - git merge master -m "merge" && + git merge main -m "merge" && test_path_is_file testcase '
t/t6422-merge-rename-corner-cases.sh +6 -6
@@ -1130,7 +1130,7 @@ test_conflicts_with_adds_and_renames() { # Setup: # L # / \ - # master ? + # main ? # \ / # R #
@@ -1260,7 +1260,7 @@ test_conflicts_with_adds_and_renames() { :2:three \ :3:three && git rev-parse >expected \ - master:irrelevant_file \ + main:irrelevant_file \ file_v2 \ file_v4 && test_cmp expected actual &&
@@ -1290,12 +1290,12 @@ test_conflicts_with_adds_and_renames add add # Setup: # L # / \ -# master ? +# main ? # \ / # R # # Where: -# master has two files, named 'one' and 'two'. +# main has two files, named 'one' and 'two'. # branches L and R both modify 'one', in conflicting ways. # branches L and R both modify 'two', in conflicting ways. # branch L also renames 'one' to 'three'.
@@ -1376,7 +1376,7 @@ test_expect_success 'check nested conflicts from rename/rename(2to1)' ' test_line_count = 1 out && # Compare :2:three to expected values - git cat-file -p master:one >base && + git cat-file -p main:one >base && git cat-file -p L:three >ours && git cat-file -p R:one >theirs && test_must_fail git merge-file \
@@ -1387,7 +1387,7 @@ test_expect_success 'check nested conflicts from rename/rename(2to1)' ' test_cmp expect L-three && # Compare :2:three to expected values - git cat-file -p master:two >base && + git cat-file -p main:two >base && git cat-file -p L:two >ours && git cat-file -p R:three >theirs && test_must_fail git merge-file \
t/t6425-merge-rename-delete.sh +1 -1
@@ -12,7 +12,7 @@ test_expect_success 'rename/delete' ' git mv A B && git commit -m "rename" && - git checkout master && + git checkout main && git rm A && git commit -m "delete" &&
t/t6427-diff3-conflict-markers.sh +7 -7
@@ -43,7 +43,7 @@ test_expect_success 'check no merge base' ' # Setup: # L1 # / \ -# master ? +# main ? # \ / # R1 #
@@ -90,18 +90,18 @@ test_expect_success 'check unique merge base' ' cd unique_merge_base && git checkout L^0 && - MASTER=$(git rev-parse --short master) && + MAIN=$(git rev-parse --short main) && test_must_fail git -c merge.conflictstyle=diff3 merge -s recursive R^0 && - grep "|||||| $MASTER:content" renamed + grep "|||||| $MAIN:content" renamed ) ' # Setup: # L1---L2--L3 # / \ / \ -# master X1 ? +# main X1 ? # \ / \ / # R1---R2--R3 #
@@ -191,10 +191,10 @@ test_expect_success 'rebase --merge describes parent of commit being picked' ' ( cd rebase && test_commit base file && - test_commit master file && + test_commit main file && git checkout -b side HEAD^ && test_commit side file && - test_must_fail git -c merge.conflictstyle=diff3 rebase --merge master && + test_must_fail git -c merge.conflictstyle=diff3 rebase --merge main && grep "||||||| parent of" file ) '
@@ -203,7 +203,7 @@ test_expect_success 'rebase --apply describes fake ancestor base' ' ( cd rebase && git rebase --abort && - test_must_fail git -c merge.conflictstyle=diff3 rebase --apply master && + test_must_fail git -c merge.conflictstyle=diff3 rebase --apply main && grep "||||||| constructed merge base" file ) '
t/t6430-merge-recursive.sh +9 -9
@@ -35,7 +35,7 @@ test_expect_success 'setup 1' ' git add a d/e && test_tick && - git commit -m "master modifies a and d/e" && + git commit -m "main modifies a and d/e" && c1=$(git rev-parse --verify HEAD) && ( git ls-tree -r HEAD && git ls-files -s ) >actual && (
@@ -466,7 +466,7 @@ test_expect_success SYMLINKS 'dir in working tree with symlink ancestor does not git checkout -b branch1 && git commit --allow-empty -m "empty commit" && - git checkout master && + git checkout main && git rm foo && mkdir foo && >foo/bar &&
@@ -475,7 +475,7 @@ test_expect_success SYMLINKS 'dir in working tree with symlink ancestor does not git checkout branch1 && - git cherry-pick master && + git cherry-pick main && test_path_is_dir foo && test_path_is_file foo/bar )
@@ -490,8 +490,8 @@ test_expect_success 'reset and 3-way merge' ' test_expect_success 'reset and bind merge' ' - git reset --hard master && - git read-tree --prefix=M/ master && + git reset --hard main && + git read-tree --prefix=M/ main && git ls-files -s >actual && ( echo "100644 $o1 0 M/a" &&
@@ -505,7 +505,7 @@ test_expect_success 'reset and bind merge' ' ) >expected && test_cmp expected actual && - git read-tree --prefix=a1/ master && + git read-tree --prefix=a1/ main && git ls-files -s >actual && ( echo "100644 $o1 0 M/a" &&
@@ -523,7 +523,7 @@ test_expect_success 'reset and bind merge' ' ) >expected && test_cmp expected actual && - git read-tree --prefix=z/ master && + git read-tree --prefix=z/ main && git ls-files -s >actual && ( echo "100644 $o1 0 M/a" &&
@@ -599,11 +599,11 @@ test_expect_success 'merge-recursive w/ empty work tree - theirs has rename' ' test_expect_success 'merge removes empty directories' ' - git reset --hard master && + git reset --hard main && git checkout -b rm && git rm d/e && git commit -mremoved-d/e && - git checkout master && + git checkout main && git merge -s recursive rm && test_path_is_missing d '
t/t6432-merge-recursive-space-options.sh +3 -3
@@ -2,11 +2,11 @@ test_description='merge-recursive space options -* [master] Clarify +* [main] Clarify ! [remote] Remove cruft -- + [remote] Remove cruft -* [master] Clarify +* [main] Clarify *+ [remote^] Initial revision * ok 1: setup '
@@ -87,7 +87,7 @@ test_expect_success 'setup' ' mv text.txt+ text.txt && git commit -a -m "Remove cruft" && - git checkout master && + git checkout main && sed -e " s/\(not in his right mind\),\(.*\)/\1;\2Q/ s/Quite correct\(.*\)/It is too correct\1Q/
t/t6433-merge-toplevel.sh +4 -4
@@ -5,7 +5,7 @@ test_description='"git merge" top-level frontend' . ./test-lib.sh t3033_reset () { - git checkout -B master two && + git checkout -B main two && git branch -f left three && git branch -f right four }
@@ -21,7 +21,7 @@ test_expect_success setup ' test_commit four && git checkout --orphan newroot && test_commit five && - git checkout master + git checkout main ' # Local branches
@@ -61,7 +61,7 @@ test_expect_success 'merge octopus, non-fast-forward (ff)' ' test_expect_success 'merge octopus, fast-forward (does not ff)' ' t3033_reset && git merge left right && - # two (master) is not an ancestor of three (left) and four (right) + # two (main) is not an ancestor of three (left) and four (right) test_must_fail git rev-parse --verify HEAD^4 && git rev-parse HEAD^1 HEAD^2 HEAD^3 | sort >actual && git rev-parse two three four | sort >expect &&
@@ -118,7 +118,7 @@ test_expect_success 'merge FETCH_HEAD octopus fast-forward (does not ff)' ' t3033_reset && git fetch . left right && git merge FETCH_HEAD && - # two (master) is not an ancestor of three (left) and four (right) + # two (main) is not an ancestor of three (left) and four (right) test_must_fail git rev-parse --verify HEAD^4 && git rev-parse HEAD^1 HEAD^2 HEAD^3 | sort >actual && git rev-parse two three four | sort >expect &&
t/t6434-merge-recursive-rename-options.sh +3 -3
@@ -5,11 +5,11 @@ test_description='merge-recursive rename options Test rename detection by examining rename/delete conflicts. * (HEAD -> rename) rename -| * (master) delete +| * (main) delete |/ * base -git diff --name-status base master +git diff --name-status base main D 0-old D 1-old D 2-old
@@ -118,7 +118,7 @@ test_expect_success 'setup repo' ' get_expected_stages 2 && get_expected_stages 3 && check_50="false" && - tail="HEAD^ -- HEAD master" + tail="HEAD^ -- HEAD main" ' test_expect_success 'setup thresholds' '
t/t6436-merge-overwrite.sh +1 -1
@@ -193,7 +193,7 @@ test_expect_success 'set up unborn branch and content' ' ' test_expect_success 'will not clobber WT/index when merging into unborn' ' - git merge master && + git merge main && grep foo tracked-file && git show :tracked-file >expect && grep foo expect &&
t/t6437-submodule-merge.sh +7 -7
@@ -27,7 +27,7 @@ test_expect_success setup ' test_tick && git commit -m root && - git checkout -b a master && + git checkout -b a main && (cd sub && echo A > file && git add file &&
@@ -37,7 +37,7 @@ test_expect_success setup ' test_tick && git commit -m a && - git checkout -b b master && + git checkout -b b main && (cd sub && echo B > file && git add file &&
@@ -254,22 +254,22 @@ test_expect_success 'setup for recursive merge with submodule' ' (cd sub && git init && test_commit a && - git checkout -b sub-b master && + git checkout -b sub-b main && test_commit b && - git checkout -b sub-c master && + git checkout -b sub-c main && test_commit c && git checkout -b sub-bc sub-b && git merge sub-c && git checkout -b sub-cb sub-c && git merge sub-b && - git checkout master) && + git checkout main) && git add sub && git commit -m a && - git checkout -b top-b master && + git checkout -b top-b main && (cd sub && git checkout sub-b) && git add sub && git commit -m b && - git checkout -b top-c master && + git checkout -b top-c main && (cd sub && git checkout sub-c) && git add sub && git commit -m c &&
t/t6439-merge-co-error-msgs.sh +3 -3
@@ -18,7 +18,7 @@ test_expect_success 'setup' ' git add two three four five && git commit -m Second && - git checkout master && + git checkout main && echo other >two && echo other >three && echo other >four &&
@@ -83,7 +83,7 @@ test_expect_success 'cannot switch branches because of local changes' ' echo two >rep/two && git add rep/one rep/two && git commit -m Fourth && - git checkout master && + git checkout main && echo uno >rep/one && echo dos >rep/two && test_must_fail git checkout branch 2>out &&
@@ -128,7 +128,7 @@ test_expect_success 'not_uptodate_dir porcelain checkout error' ' >rep2 && git add rep rep2 && git commit -m "added test as a file" && - git checkout master && + git checkout main && >rep/untracked-file && >rep2/untracked-file && test_must_fail git checkout branch 2>out &&
t/t6501-freshen-objects.sh +1 -1
@@ -67,7 +67,7 @@ for repack in '' true; do git checkout -b experiment && commit abandon && maybe_repack && - git checkout master && + git checkout main && git branch -D experiment '
t/test-lib.sh +1 -1
@@ -263,7 +263,7 @@ case "$TEST_NUMBER" in GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME ;; -[0-5]*|6[0-3]*) +[0-6]*) GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME ;;
Signature · 1 line
gitgitgadget
PATCH 20/28 t7[0-4]*: adjust the references to the default branch name "main"
In reply to Johannes Schindelin via GitGitGadgetFrom: Johannes Schindelin <[email protected]>
Carefully excluding t7064, which sees independent development elsewhere at the time of writing, we use main as the default branch name in t7[0-4]*. This trick was performed via
$ (cd t && sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \ -e 's/Master/Main/g' -- t7[0-4]*.sh && git checkout HEAD -- t7064\*)
This allows us to define GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main for those tests.
--- t/t7003-filter-branch.sh | 40 ++++----- t/t7004-tag.sh | 8 +- t/t7030-verify-tag.sh | 2 +- t/t7060-wtstatus.sh | 26 +++--- t/t7063-status-untracked-cache.sh | 14 +-- t/t7102-reset.sh | 6 +- t/t7113-post-index-change-hook.sh | 2 +- t/t7201-co.sh | 110 ++++++++++++------------ t/t7400-submodule-basic.sh | 20 ++--- t/t7403-submodule-sync.sh | 10 +-- t/t7406-submodule-update.sh | 38 ++++---- t/t7407-submodule-foreach.sh | 24 +++--- t/t7409-submodule-detached-work-tree.sh | 8 +- t/t7417-submodule-path-url.sh | 2 +- t/test-lib.sh | 4 +- 15 files changed, 157 insertions(+), 157 deletions(-)
t/t7003-filter-branch.sh +20 -20
@@ -13,7 +13,7 @@ test_expect_success 'setup' ' mkdir dir && test_commit dir/D && test_commit E && - git checkout master && + git checkout main && test_commit C && git checkout branch && git merge C &&
@@ -25,7 +25,7 @@ test_expect_success 'setup' ' # * G # * Merge commit 'C' into branch # |\ -# | * (master) C +# | * (main) C # * | E # * | dir/D # * | D
@@ -162,15 +162,15 @@ test_expect_success 'subdirectory filter result looks okay' ' ' test_expect_success 'more setup' ' - git checkout master && + git checkout main && mkdir subdir && echo A > subdir/new && git add subdir/new && test_tick && - git commit -m "subdir on master" subdir/new && + git commit -m "subdir on main" subdir/new && git rm A.t && test_tick && - git commit -m "again subdir on master" && + git commit -m "again subdir on main" && git merge branch '
@@ -199,7 +199,7 @@ test_expect_success 'author information is preserved' ' git branch preserved-author && (sane_unset GIT_AUTHOR_NAME && git filter-branch -f --msg-filter "cat; \ - test \$GIT_COMMIT != $(git rev-parse master) || \ + test \$GIT_COMMIT != $(git rev-parse main) || \ echo Hallo" \ preserved-author) && git rev-list --author="B V Uips" preserved-author >actual &&
@@ -218,7 +218,7 @@ test_expect_success "remove a certain author's commits" ' else\ git commit-tree \"\$@\";\ fi" removed-author && - cnt1=$(git rev-list master | wc -l) && + cnt1=$(git rev-list main | wc -l) && cnt2=$(git rev-list removed-author | wc -l) && test $cnt1 -eq $(($cnt2 + 1)) && git rev-list --author="B V Uips" removed-author >actual &&
@@ -226,7 +226,7 @@ test_expect_success "remove a certain author's commits" ' ' test_expect_success 'barf on invalid name' ' - test_must_fail git filter-branch -f master xy-problem && + test_must_fail git filter-branch -f main xy-problem && test_must_fail git filter-branch -f HEAD^ '
@@ -236,8 +236,8 @@ test_expect_success '"map" works in commit filter' ' mapped=\$(map \$parent) && actual=\$(echo \"\$@\" | sed \"s/^.*-p //\") && test \$mapped = \$actual && - git commit-tree \"\$@\";" master~2..master && - git rev-parse --verify master + git commit-tree \"\$@\";" main~2..main && + git rev-parse --verify main ' test_expect_success 'Name needing quotes' '
@@ -256,7 +256,7 @@ test_expect_success 'Name needing quotes' ' test_expect_success 'Subdirectory filter with disappearing trees' ' git reset --hard && - git checkout master && + git checkout main && mkdir foo && touch foo/bar &&
@@ -275,7 +275,7 @@ test_expect_success 'Subdirectory filter with disappearing trees' ' git commit -m "Re-adding foo" && git filter-branch -f --subdirectory-filter foo && - git rev-list master >actual && + git rev-list main >actual && test_line_count = 3 actual '
@@ -332,7 +332,7 @@ test_expect_success 'Tag name filtering allows slashes in tag names' ' test_cmp expect actual ' test_expect_success 'setup --prune-empty comparisons' ' - git checkout --orphan master-no-a && + git checkout --orphan main-no-a && git rm -rf . && unset test_tick && test_tick &&
@@ -343,7 +343,7 @@ test_expect_success 'setup --prune-empty comparisons' ' mkdir dir && test_commit dir/D dir/D.t dir/D dir/Dx && test_commit E E.t E Ex && - git checkout master-no-a && + git checkout main-no-a && test_commit C C.t C Cx && git checkout branch-no-a && git merge Cx -m "Merge tag '\''C'\'' into branch" &&
@@ -397,7 +397,7 @@ test_expect_success '--prune-empty is able to prune entire branch' ' ' test_expect_success '--remap-to-ancestor with filename filters' ' - git checkout master && + git checkout main && git reset --hard A && test_commit add-foo foo 1 && git branch moved-foo &&
@@ -407,15 +407,15 @@ test_expect_success '--remap-to-ancestor with filename filters' ' git branch moved-bar && test_commit change-foo foo 2 && git filter-branch -f --remap-to-ancestor \ - moved-foo moved-bar A..master \ + moved-foo moved-bar A..main \ -- -- foo && test $(git rev-parse moved-foo) = $(git rev-parse moved-bar) && - test $(git rev-parse moved-foo) = $(git rev-parse master^) && + test $(git rev-parse moved-foo) = $(git rev-parse main^) && test $orig_invariant = $(git rev-parse invariant) ' test_expect_success 'automatic remapping to ancestor with filename filters' ' - git checkout master && + git checkout main && git reset --hard A && test_commit add-foo2 foo 1 && git branch moved-foo2 &&
@@ -425,10 +425,10 @@ test_expect_success 'automatic remapping to ancestor with filename filters' ' git branch moved-bar2 && test_commit change-foo2 foo 2 && git filter-branch -f \ - moved-foo2 moved-bar2 A..master \ + moved-foo2 moved-bar2 A..main \ -- -- foo && test $(git rev-parse moved-foo2) = $(git rev-parse moved-bar2) && - test $(git rev-parse moved-foo2) = $(git rev-parse master^) && + test $(git rev-parse moved-foo2) = $(git rev-parse main^) && test $orig_invariant = $(git rev-parse invariant2) '
t/t7004-tag.sh +4 -4
@@ -1583,7 +1583,7 @@ test_expect_success 'checking that branch head with --no-contains lists all but " test_expect_success 'merging original branch into this branch' ' - git merge --strategy=ours master && + git merge --strategy=ours main && git tag v4.0 '
@@ -1944,15 +1944,15 @@ test_expect_success ULIMIT_STACK_SIZE '--contains and --no-contains work in a de i=1 && while test $i -lt 8000 do - echo "commit refs/heads/master + echo "commit refs/heads/main committer A U Thor <[email protected]> $((1000000000 + $i * 100)) +0200 data <<EOF commit #$i EOF" - test $i = 1 && echo "from refs/heads/master^0" + test $i = 1 && echo "from refs/heads/main^0" i=$(($i + 1)) done | git fast-import && - git checkout master && + git checkout main && git tag far-far-away HEAD^ && run_with_limited_stack git tag --contains HEAD >actual && test_must_be_empty actual &&
t/t7030-verify-tag.sh +1 -1
@@ -17,7 +17,7 @@ test_expect_success GPG 'create signed tags' ' echo 3 >elif && git add elif && test_tick && git commit -m "third on side" && - git checkout master && + git checkout main && test_tick && git merge -S side && git tag -s -m merge merge &&
t/t7060-wtstatus.sh +13 -13
@@ -51,7 +51,7 @@ EOF git checkout -b side HEAD^ && git rm foo && git commit -m delete && - test_must_fail git merge master && + test_must_fail git merge main && test_must_fail git commit --dry-run >../actual && test_i18ncmp ../expect ../actual && git status >../actual &&
@@ -124,18 +124,18 @@ test_expect_success 'git diff-index --cached -C shows 2 copies + 1 unmerged' ' test_expect_success 'status when conflicts with add and rm advice (deleted by them)' ' git reset --hard && - git checkout master && + git checkout main && test_commit init main.txt init && git checkout -b second_branch && git rm main.txt && git commit -m "main.txt deleted on second_branch" && test_commit second conflict.txt second && - git checkout master && + git checkout main && test_commit on_second main.txt on_second && - test_commit master conflict.txt master && + test_commit main conflict.txt main && test_must_fail git merge second_branch && cat >expected <<\EOF && -On branch master +On branch main You have unmerged paths. (fix conflicts and run "git commit") (use "git merge --abort" to abort the merge)
@@ -157,8 +157,8 @@ test_expect_success 'prepare for conflicts' ' git checkout -b conflict && test_commit one main.txt one && git branch conflict_second && - git mv main.txt sub_master.txt && - git commit -m "main.txt renamed in sub_master.txt" && + git mv main.txt sub_main.txt && + git commit -m "main.txt renamed in sub_main.txt" && git checkout conflict_second && git mv main.txt sub_second.txt && git commit -m "main.txt renamed in sub_second.txt"
@@ -176,7 +176,7 @@ You have unmerged paths. Unmerged paths: (use "git add/rm <file>..." as appropriate to mark resolution) both deleted: main.txt - added by them: sub_master.txt + added by them: sub_main.txt added by us: sub_second.txt no changes added to commit (use "git add" and/or "git commit -a")
@@ -189,7 +189,7 @@ EOF test_expect_success 'status when conflicts with only rm advice (both deleted)' ' git reset --hard conflict_second && test_must_fail git merge conflict && - git add sub_master.txt && + git add sub_main.txt && git add sub_second.txt && cat >expected <<\EOF && On branch conflict_second
@@ -198,7 +198,7 @@ You have unmerged paths. (use "git merge --abort" to abort the merge) Changes to be committed: - new file: sub_master.txt + new file: sub_main.txt Unmerged paths: (use "git rm <file>..." to mark resolution)
@@ -209,12 +209,12 @@ EOF git status --untracked-files=no >actual && test_i18ncmp expected actual && git reset --hard && - git checkout master + git checkout main ' test_expect_success 'status --branch with detached HEAD' ' git reset --hard && - git checkout master^0 && + git checkout main^0 && git status --branch --porcelain >actual && cat >expected <<-EOF && ## HEAD (no branch)
@@ -230,7 +230,7 @@ test_expect_success 'status --branch with detached HEAD' ' ## Duplicate the above test and verify --porcelain=v1 arg parsing. test_expect_success 'status --porcelain=v1 --branch with detached HEAD' ' git reset --hard && - git checkout master^0 && + git checkout main^0 && git status --branch --porcelain=v1 >actual && cat >expected <<-EOF && ## HEAD (no branch)
t/t7063-status-untracked-cache.sh +7 -7
@@ -475,7 +475,7 @@ EOF test_expect_success 'set up sparse checkout' ' echo "done/[a-z]*" >.git/info/sparse-checkout && test_config core.sparsecheckout true && - git checkout master && + git checkout main && git update-index --force-untracked-cache && git status --porcelain >/dev/null && # prime the cache test_path_is_missing done/.gitignore &&
@@ -734,13 +734,13 @@ test_expect_success 'test ident field is working' ' test_expect_success 'untracked cache survives a checkout' ' git commit --allow-empty -m empty && test-tool dump-untracked-cache >../before && - test_when_finished "git checkout master" && + test_when_finished "git checkout main" && git checkout -b other_branch && test-tool dump-untracked-cache >../after && test_cmp ../before ../after && test_commit test && test-tool dump-untracked-cache >../before && - git checkout master && + git checkout main && test-tool dump-untracked-cache >../after && test_cmp ../before ../after '
@@ -775,7 +775,7 @@ test_expect_success SYMLINKS '"status" after symlink replacement should be clean git checkout HEAD~ && status_is_clean && status_is_clean && - git checkout master && + git checkout main && avoid_racy && status_is_clean && status_is_clean
@@ -786,7 +786,7 @@ test_expect_success SYMLINKS '"status" after symlink replacement should be clean git checkout HEAD~ && status_is_clean && status_is_clean && - git checkout master && + git checkout main && avoid_racy && status_is_clean && status_is_clean
@@ -810,7 +810,7 @@ test_expect_success '"status" after file replacement should be clean with UC=tru git checkout HEAD~ && status_is_clean && status_is_clean && - git checkout master && + git checkout main && avoid_racy && status_is_clean && test-tool dump-untracked-cache >../actual &&
@@ -828,7 +828,7 @@ test_expect_success '"status" after file replacement should be clean with UC=fal git checkout HEAD~ && status_is_clean && status_is_clean && - git checkout master && + git checkout main && avoid_racy && status_is_clean && status_is_clean
t/t7102-reset.sh +3 -3
@@ -145,7 +145,7 @@ test_expect_success 'trying to do reset --soft with pending merge should fail' ' printf "1st line 2nd file\n2nd line 2nd file\n3rd line" >secondfile && git commit -a -m "the change in branch2" && - git checkout master && + git checkout main && git branch -D branch1 branch2 && check_changes $head5 '
@@ -167,7 +167,7 @@ test_expect_success 'trying to do reset --soft with pending checkout merge shoul printf "1st line 2nd file\n2nd line 2nd file\n3rd line" >secondfile && git commit -a -m "the line in branch3" && - git checkout master && + git checkout main && git branch -D branch3 branch4 && check_changes $head5 '
@@ -380,7 +380,7 @@ test_expect_success '--hard reset to ORIG_HEAD should clear a fast-forward merge git reset --hard ORIG_HEAD && check_changes $head5 && - git checkout master && + git checkout main && git branch -D branch1 branch2 && check_changes $head5 '
t/t7113-post-index-change-hook.sh +1 -1
@@ -85,7 +85,7 @@ test_expect_success 'test checkout and reset trigger the hook' ' EOF : force index to be dirty && test-tool chmtime +60 dir1/file1.txt && - git checkout master && + git checkout main && test_path_is_file testsuccess && rm -f testsuccess && test_path_is_missing testfailure && test-tool chmtime +60 dir1/file1.txt &&
t/t7201-co.sh +55 -55
334 lines not on this page · raw message
t/t7400-submodule-basic.sh +10 -10
@@ -124,7 +124,7 @@ inspect() { } test_expect_success 'submodule add' ' - echo "refs/heads/master" >expect && + echo "refs/heads/main" >expect && ( cd addtest &&
@@ -223,7 +223,7 @@ test_expect_success 'submodule add --branch' ' echo "refs/heads/initial" >expect-head && cat <<-\EOF >expect-heads && refs/heads/initial - refs/heads/master + refs/heads/main EOF (
@@ -241,7 +241,7 @@ test_expect_success 'submodule add --branch' ' ' test_expect_success 'submodule add with ./ in path' ' - echo "refs/heads/master" >expect && + echo "refs/heads/main" >expect && ( cd addtest &&
@@ -257,7 +257,7 @@ test_expect_success 'submodule add with ./ in path' ' ' test_expect_success 'submodule add with /././ in path' ' - echo "refs/heads/master" >expect && + echo "refs/heads/main" >expect && ( cd addtest &&
@@ -273,7 +273,7 @@ test_expect_success 'submodule add with /././ in path' ' ' test_expect_success 'submodule add with // in path' ' - echo "refs/heads/master" >expect && + echo "refs/heads/main" >expect && ( cd addtest &&
@@ -289,7 +289,7 @@ test_expect_success 'submodule add with // in path' ' ' test_expect_success 'submodule add with /.. in path' ' - echo "refs/heads/master" >expect && + echo "refs/heads/main" >expect && ( cd addtest &&
@@ -305,7 +305,7 @@ test_expect_success 'submodule add with /.. in path' ' ' test_expect_success 'submodule add with ./, /.. and // in path' ' - echo "refs/heads/master" >expect && + echo "refs/heads/main" >expect && ( cd addtest &&
@@ -335,7 +335,7 @@ test_expect_success !CYGWIN 'submodule add with \\ in path' ' ' test_expect_success 'submodule add in subdirectory' ' - echo "refs/heads/master" >expect && + echo "refs/heads/main" >expect && mkdir addtest/sub && (
@@ -557,7 +557,7 @@ test_expect_success 'status should be "up-to-date" after update' ' test_expect_success 'checkout superproject with subproject already present' ' git checkout initial && - git checkout master + git checkout main ' test_expect_success 'apply submodule diff' '
@@ -574,7 +574,7 @@ test_expect_success 'apply submodule diff' ' git checkout second && git apply --index P.diff && - git diff --cached master >staged && + git diff --cached main >staged && test_must_be_empty staged '
t/t7403-submodule-sync.sh +5 -5
@@ -78,7 +78,7 @@ test_expect_success 'change submodule url' ' ( cd super && cd submodule && - git checkout master && + git checkout main && git pull ) && mv submodule moved-submodule &&
@@ -112,7 +112,7 @@ test_expect_success '"git submodule sync" should update submodule URLs' ' )" && ( cd super-clone/submodule && - git checkout master && + git checkout main && git pull ) && (
@@ -140,7 +140,7 @@ test_expect_success '"git submodule sync --recursive" should update all submodul )" && ( cd super-clone/submodule/sub-submodule && - git checkout master && + git checkout main && git pull ) '
@@ -168,7 +168,7 @@ test_expect_success '"git submodule sync" should update submodule URLs - subdire )" && ( cd super-clone/submodule && - git checkout master && + git checkout main && git pull ) && (
@@ -199,7 +199,7 @@ test_expect_success '"git submodule sync --recursive" should update all submodul )" && ( cd super-clone/submodule/sub-submodule && - git checkout master && + git checkout main && git pull ) '
t/t7406-submodule-update.sh +19 -19
@@ -14,10 +14,10 @@ submodule and "git submodule update --rebase/--merge" does not detach the HEAD. compare_head() { - sha_master=$(git rev-list --max-count=1 master) + sha_main=$(git rev-list --max-count=1 main) sha_head=$(git rev-list --max-count=1 HEAD) - test "$sha_master" = "$sha_head" + test "$sha_main" = "$sha_head" }
@@ -262,14 +262,14 @@ test_expect_success 'submodule update --remote should fetch upstream changes wit cd super && git submodule update --remote --force submodule && git -C submodule log -1 --oneline >actual && - git -C ../submodule log -1 --oneline master >expect && + git -C ../submodule log -1 --oneline main >expect && test_cmp expect actual && git checkout -b test-branch && git submodule update --remote --force submodule && git -C submodule log -1 --oneline >actual && git -C ../submodule log -1 --oneline test-branch >expect && test_cmp expect actual && - git checkout master && + git checkout main && git branch -d test-branch && git reset --hard HEAD^ )
@@ -282,7 +282,7 @@ test_expect_success 'local config should override .gitmodules branch' ' git add file && test_tick && git commit -m "upstream line5" && - git checkout master + git checkout main ) && (cd super && git config submodule.submodule.branch test-branch &&
@@ -292,9 +292,9 @@ test_expect_success 'local config should override .gitmodules branch' ' ) ' -test_expect_success 'submodule update --rebase staying on master' ' +test_expect_success 'submodule update --rebase staying on main' ' (cd super/submodule && - git checkout master + git checkout main ) && (cd super && (cd submodule &&
@@ -306,7 +306,7 @@ test_expect_success 'submodule update --rebase staying on master' ' ) ' -test_expect_success 'submodule update --merge staying on master' ' +test_expect_success 'submodule update --merge staying on main' ' (cd super/submodule && git reset --hard HEAD~1 ) &&
@@ -609,7 +609,7 @@ test_expect_success 'submodule update - update=none in .git/config' ' (cd super && git config submodule.submodule.update none && (cd submodule && - git checkout master && + git checkout main && compare_head ) && git diff --name-only >out &&
@@ -629,7 +629,7 @@ test_expect_success 'submodule update - update=none in .git/config but --checkou (cd super && git config submodule.submodule.update none && (cd submodule && - git checkout master && + git checkout main && compare_head ) && git diff --name-only >out &&
@@ -689,7 +689,7 @@ test_expect_success 'submodule update continues after checkout error' ' test_expect_success 'submodule update continues after recursive checkout error' ' (cd super && git reset --hard HEAD && - git checkout master && + git checkout main && git submodule update && (cd submodule && git submodule add ../submodule subsubmodule &&
@@ -733,7 +733,7 @@ test_expect_success 'submodule update continues after recursive checkout error' test_expect_success 'submodule update exit immediately in case of merge conflict' ' (cd super && - git checkout master && + git checkout main && git reset --hard HEAD && (cd submodule && (cd subsubmodule &&
@@ -751,7 +751,7 @@ test_expect_success 'submodule update exit immediately in case of merge conflict git add submodule2 && git commit -m "two_new_submodule_commits" && (cd submodule && - git checkout master && + git checkout main && test_commit "conflict" file && echo "conflict" > file ) &&
@@ -770,7 +770,7 @@ test_expect_success 'submodule update exit immediately in case of merge conflict test_expect_success 'submodule update exit immediately after recursive rebase error' ' (cd super && - git checkout master && + git checkout main && git reset --hard HEAD && (cd submodule && git reset --hard HEAD &&
@@ -786,7 +786,7 @@ test_expect_success 'submodule update exit immediately after recursive rebase er git add submodule2 && git commit -m "two_new_submodule_commits" && (cd submodule && - git checkout master && + git checkout main && test_commit "conflict2" file && echo "conflict" > file ) &&
@@ -878,21 +878,21 @@ test_expect_success 'submodule update places git-dir in superprojects git-dir re git clone subsubsuper_update_r subsubsuper_update_r2 && (cd subsubsuper_update_r2 && test_commit "update_subsubsuper" file && - git push origin master + git push origin main ) && git clone subsuper_update_r subsuper_update_r2 && (cd subsuper_update_r2 && test_commit "update_subsuper" file && git submodule add ../subsubsuper_update_r subsubmodule && git commit -am "subsubmodule" && - git push origin master + git push origin main ) && git clone super_update_r super_update_r2 && (cd super_update_r2 && test_commit "update_super" file && git submodule add ../subsuper_update_r submodule && git commit -am "submodule" && - git push origin master + git push origin main ) && rm -rf super_update_r2 && git clone super_update_r super_update_r2 &&
@@ -911,7 +911,7 @@ test_expect_success 'submodule update places git-dir in superprojects git-dir re test_expect_success 'submodule add properly re-creates deeper level submodules' ' (cd super && - git reset --hard master && + git reset --hard main && rm -rf deeper/ && git submodule add --force ../submodule deeper/submodule )
t/t7407-submodule-foreach.sh +12 -12
@@ -277,13 +277,13 @@ sub1sha1_short=$(cd clone3/sub1 && git rev-parse --short HEAD) sub2sha1_short=$(cd clone3/sub2 && git rev-parse --short HEAD) cat > expect <<EOF - $nested1sha1 nested1 (heads/master) - $nested2sha1 nested1/nested2 (heads/master) - $nested3sha1 nested1/nested2/nested3 (heads/master) - $submodulesha1 nested1/nested2/nested3/submodule (heads/master) + $nested1sha1 nested1 (heads/main) + $nested2sha1 nested1/nested2 (heads/main) + $nested3sha1 nested1/nested2/nested3 (heads/main) + $submodulesha1 nested1/nested2/nested3/submodule (heads/main) $sub1sha1 sub1 ($sub1sha1_short) $sub2sha1 sub2 ($sub2sha1_short) - $sub3sha1 sub3 (heads/master) + $sub3sha1 sub3 (heads/main) EOF test_expect_success 'test "status --recursive"' '
@@ -295,10 +295,10 @@ test_expect_success 'test "status --recursive"' ' ' cat > expect <<EOF - $nested1sha1 nested1 (heads/master) + $nested1sha1 nested1 (heads/main) +$nested2sha1 nested1/nested2 (file2~1) - $nested3sha1 nested1/nested2/nested3 (heads/master) - $submodulesha1 nested1/nested2/nested3/submodule (heads/master) + $nested3sha1 nested1/nested2/nested3 (heads/main) + $submodulesha1 nested1/nested2/nested3/submodule (heads/main) EOF test_expect_success 'ensure "status --cached --recursive" preserves the --cached flag' '
@@ -316,13 +316,13 @@ test_expect_success 'ensure "status --cached --recursive" preserves the --cached nested2sha1=$(git -C clone3/nested1/nested2 rev-parse HEAD) cat > expect <<EOF - $nested1sha1 ../nested1 (heads/master) + $nested1sha1 ../nested1 (heads/main) +$nested2sha1 ../nested1/nested2 (file2) - $nested3sha1 ../nested1/nested2/nested3 (heads/master) - $submodulesha1 ../nested1/nested2/nested3/submodule (heads/master) + $nested3sha1 ../nested1/nested2/nested3 (heads/main) + $submodulesha1 ../nested1/nested2/nested3/submodule (heads/main) $sub1sha1 ../sub1 ($sub1sha1_short) $sub2sha1 ../sub2 ($sub2sha1_short) - $sub3sha1 ../sub3 (heads/master) + $sub3sha1 ../sub3 (heads/main) EOF test_expect_success 'test "status --recursive" from sub directory' '
t/t7409-submodule-detached-work-tree.sh +4 -4
@@ -35,7 +35,7 @@ test_expect_success 'submodule on detached working tree' ' git rev-parse --verify HEAD >actual && test_cmp ../../../../expect actual ) && - git push origin master + git push origin main ) && mkdir home2 && (
@@ -44,7 +44,7 @@ test_expect_success 'submodule on detached working tree' ' GIT_WORK_TREE="$(pwd)" && GIT_DIR="$(pwd)/.dotfiles" && export GIT_WORK_TREE GIT_DIR && - git checkout master && + git checkout main && git submodule update --init && ( unset GIT_WORK_TREE GIT_DIR &&
@@ -64,10 +64,10 @@ test_expect_success 'submodule on detached working pointed by core.worktree' ' git clone --bare ../remote "$GIT_DIR" && git config core.bare false && git config core.worktree .. && - git checkout master && + git checkout main && git submodule add ../bundle1 .vim/bundle/dupe && test_commit "dupe" && - git push origin master + git push origin main ) && ( cd home &&
t/t7417-submodule-path-url.sh +1 -1
@@ -36,7 +36,7 @@ test_expect_success MINGW 'submodule paths disallows trailing spaces' ' sed "s/sub/sub /" <tree >tree.new && tree=$(git -C super mktree <tree.new) && commit=$(echo with space | git -C super commit-tree $tree) && - git -C super update-ref refs/heads/master $commit && + git -C super update-ref refs/heads/main $commit && test_must_fail git clone --recurse-submodules super dst 2>err && test_i18ngrep "sub " err
t/test-lib.sh +2 -2
@@ -257,13 +257,13 @@ case "$TRASH_DIRECTORY" in esac case "$TEST_NUMBER" in -3404|4013|5310|6300) +3404|4013|5310|6300|7064) # Avoid conflicts with patch series that are cooking at the same time # as the patch series changing the default of `init.defaultBranch`. GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME ;; -[0-6]*) +[0-6]*|7[0-4]*) GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME ;;
Signature · 1 line
gitgitgadget
PATCH 21/28 t7[5-9]*: adjust the references to the default branch name "main"
In reply to Johannes Schindelin via GitGitGadgetFrom: Johannes Schindelin <[email protected]>
Excluding t7817, which is added in an unrelated patch series at the time of writing, this adjusts t7[5-9]*. This trick was performed via
$ (cd t && sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \ -e 's/Master/Main/g' -- t7[5-9]*.sh)
This allows us to define GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main for those tests.
--- t/t7501-commit-basic-functionality.sh | 2 +- t/t7502-commit-porcelain.sh | 12 +- ...3-pre-commit-and-pre-merge-commit-hooks.sh | 42 ++--- t/t7504-commit-msg-hook.sh | 24 +-- t/t7505-prepare-commit-msg-hook.sh | 20 +- t/t7508-status.sh | 58 +++--- t/t7510-signed-commit.sh | 2 +- t/t7512-status-help.sh | 40 ++-- t/t7517-per-repo-email.sh | 12 +- t/t7600-merge.sh | 44 ++--- t/t7606-merge-custom.sh | 2 +- t/t7608-merge-messages.sh | 36 ++-- t/t7610-mergetool.sh | 174 +++++++++--------- t/t7611-merge-abort.sh | 4 +- t/t7612-merge-verify-signatures.sh | 2 +- t/t7614-merge-signoff.sh | 24 +-- t/t7701-repack-unpack-unreachable.sh | 2 +- t/t7800-difftool.sh | 38 ++-- t/t7810-grep.sh | 28 +-- t/test-lib.sh | 4 +- 20 files changed, 285 insertions(+), 285 deletions(-)
t/t7501-commit-basic-functionality.sh +1 -1
@@ -603,7 +603,7 @@ test_expect_success 'same tree (merge and amend merge)' ' echo zero >zero && git add zero && git commit -m "add zero" && - git checkout master && + git checkout main && git merge -s ours side -m "empty ok" && git diff HEAD^ HEAD >actual &&
t/t7502-commit-porcelain.sh +6 -6
@@ -76,7 +76,7 @@ test_expect_success 'output summary format for merges' ' output_tests_cleanup() { # this is needed for "do not fire editor in the presence of conflicts" - git checkout master && + git checkout main && # this is needed for the "partial removal" test to pass git rm file1 &&
@@ -440,7 +440,7 @@ test_expect_success 'do not fire editor in the presence of conflicts' ' git add g && git commit -m "add g" && git branch second && - echo master >g && + echo main >g && echo g >h && git add g h && git commit -m "modify g and add h" &&
@@ -449,7 +449,7 @@ test_expect_success 'do not fire editor in the presence of conflicts' ' git add g && git commit -m second && # Must fail due to conflict - test_must_fail git cherry-pick -n master && + test_must_fail git cherry-pick -n main && echo "editor not started" >.git/result && ( GIT_EDITOR="\"$(pwd)/.git/FAKE_EDITOR\"" &&
@@ -478,9 +478,9 @@ git reset -q --hard test_expect_success 'Hand committing of a redundant merge removes dups' ' - git rev-parse second master >expect && - test_must_fail git merge second master && - git checkout master g && + git rev-parse second main >expect && + test_must_fail git merge second main && + git checkout main g && EDITOR=: git commit -a && git cat-file commit HEAD >raw && sed -n -e "s/^parent //p" -e "/^$/q" raw >actual &&
t/t7503-pre-commit-and-pre-merge-commit-hooks.sh +21 -21
108 lines not on this page · raw message
t/t7504-commit-msg-hook.sh +12 -12
@@ -142,12 +142,12 @@ test_expect_success '--no-verify with failing hook (editor)' ' test_expect_success 'merge fails with failing hook' ' test_when_finished "git branch -D newbranch" && - test_when_finished "git checkout -f master" && + test_when_finished "git checkout -f main" && git checkout --orphan newbranch && : >file2 && git add file2 && git commit --no-verify file2 -m in-side-branch && - test_must_fail git merge --allow-unrelated-histories master && + test_must_fail git merge --allow-unrelated-histories main && commit_msg_is "in-side-branch" # HEAD before merge '
@@ -155,14 +155,14 @@ test_expect_success 'merge fails with failing hook' ' test_expect_success 'merge bypasses failing hook with --no-verify' ' test_when_finished "git branch -D newbranch" && - test_when_finished "git checkout -f master" && + test_when_finished "git checkout -f main" && git checkout --orphan newbranch && git rm -f file && : >file2 && git add file2 && git commit --no-verify file2 -m in-side-branch && - git merge --no-verify --allow-unrelated-histories master && - commit_msg_is "Merge branch '\''master'\'' into newbranch" + git merge --no-verify --allow-unrelated-histories main && + commit_msg_is "Merge branch '\''main'\'' into newbranch" '
@@ -248,28 +248,28 @@ test_expect_success "hook doesn't edit commit message (editor)" ' test_expect_success 'hook called in git-merge picks up commit message' ' test_when_finished "git branch -D newbranch" && - test_when_finished "git checkout -f master" && + test_when_finished "git checkout -f main" && git checkout --orphan newbranch && git rm -f file && : >file2 && git add file2 && git commit --no-verify file2 -m in-side-branch && - git merge --allow-unrelated-histories master && + git merge --allow-unrelated-histories main && commit_msg_is "new message" ' test_expect_failure 'merge --continue remembers --no-verify' ' test_when_finished "git branch -D newbranch" && - test_when_finished "git checkout -f master" && - git checkout master && + test_when_finished "git checkout -f main" && + git checkout main && echo a >file2 && git add file2 && - git commit --no-verify -m "add file2 to master" && - git checkout -b newbranch master^ && + git commit --no-verify -m "add file2 to main" && + git checkout -b newbranch main^ && echo b >file2 && git add file2 && git commit --no-verify file2 -m in-side-branch && - git merge --no-verify -m not-rewritten-by-hook master && + git merge --no-verify -m not-rewritten-by-hook main && # resolve conflict: echo c >file2 && git add file2 &&
t/t7505-prepare-commit-msg-hook.sh +10 -10
@@ -15,7 +15,7 @@ test_expect_success 'set up commits for rebasing' ' do test_commit rebase-$i c $i done && - git checkout master && + git checkout main && cat >rebase-todo <<-EOF pick $(git rev-parse rebase-a)
@@ -190,7 +190,7 @@ test_expect_success 'with hook (-c)' ' test_expect_success 'with hook (merge)' ' - test_when_finished "git checkout -f master" && + test_when_finished "git checkout -f main" && git checkout -B other HEAD@{1} && echo "more" >>file && git add file &&
@@ -202,7 +202,7 @@ test_expect_success 'with hook (merge)' ' test_expect_success 'with hook and editor (merge)' ' - test_when_finished "git checkout -f master" && + test_when_finished "git checkout -f main" && git checkout -B other HEAD@{1} && echo "more" >>file && git add file &&
@@ -218,7 +218,7 @@ test_rebase () { test_expect_$expect C_LOCALE_OUTPUT "with hook (rebase ${mode:--i})" ' test_when_finished "\ git rebase --abort - git checkout -f master + git checkout -f main git branch -D tmp" && git checkout -b tmp rebase-me && GIT_SEQUENCE_EDITOR="cp rebase-todo" &&
@@ -250,14 +250,14 @@ test_rebase success test_have_prereq !REBASE_P || test_rebase success -p test_expect_success 'with hook (cherry-pick)' ' - test_when_finished "git checkout -f master" && + test_when_finished "git checkout -f main" && git checkout -B other b && git cherry-pick rebase-1 && test "$(git log -1 --pretty=format:%s)" = "message (no editor)" ' test_expect_success 'with hook and editor (cherry-pick)' ' - test_when_finished "git checkout -f master" && + test_when_finished "git checkout -f main" && git checkout -B other b && git cherry-pick -e rebase-1 && test "$(git log -1 --pretty=format:%s)" = merge
@@ -270,7 +270,7 @@ EOF test_expect_success 'with failing hook' ' - test_when_finished "git checkout -f master" && + test_when_finished "git checkout -f main" && head=$(git rev-parse HEAD) && echo "more" >> file && git add file &&
@@ -280,7 +280,7 @@ test_expect_success 'with failing hook' ' test_expect_success 'with failing hook (--no-verify)' ' - test_when_finished "git checkout -f master" && + test_when_finished "git checkout -f main" && head=$(git rev-parse HEAD) && echo "more" >> file && git add file &&
@@ -290,7 +290,7 @@ test_expect_success 'with failing hook (--no-verify)' ' test_expect_success 'with failing hook (merge)' ' - test_when_finished "git checkout -f master" && + test_when_finished "git checkout -f main" && git checkout -B other HEAD@{1} && echo "more" >> file && git add file &&
@@ -305,7 +305,7 @@ test_expect_success 'with failing hook (merge)' ' ' test_expect_success C_LOCALE_OUTPUT 'with failing hook (cherry-pick)' ' - test_when_finished "git checkout -f master" && + test_when_finished "git checkout -f main" && git checkout -B other b && test_must_fail git cherry-pick rebase-1 2>actual && test $(grep -c prepare-commit-msg actual) = 1
t/t7508-status.sh +29 -29
229 lines not on this page · raw message
t/t7510-signed-commit.sh +1 -1
@@ -25,7 +25,7 @@ test_expect_success GPG 'create signed commits' ' echo 3 >elif && git add elif && test_tick && git commit -m "third on side" && - git checkout master && + git checkout main && test_tick && git merge -S side && git tag merge &&
t/t7512-status-help.sh +20 -20
@@ -17,14 +17,14 @@ test_expect_success 'prepare for conflicts' ' git config --global advice.statusuoption false && test_commit init main.txt init && git branch conflicts && - test_commit on_master main.txt on_master && + test_commit on_main main.txt on_main && git checkout conflicts && test_commit on_conflicts main.txt on_conflicts ' test_expect_success 'status when conflicts unresolved' ' - test_must_fail git merge master && + test_must_fail git merge main && cat >expected <<\EOF && On branch conflicts You have unmerged paths.
@@ -44,7 +44,7 @@ EOF test_expect_success 'status when conflicts resolved before commit' ' git reset --hard conflicts && - test_must_fail git merge master && + test_must_fail git merge main && echo one >main.txt && git add main.txt && cat >expected <<\EOF &&
@@ -63,7 +63,7 @@ EOF test_expect_success 'prepare for rebase conflicts' ' - git reset --hard master && + git reset --hard main && git checkout -b rebase_conflicts && test_commit one_rebase main.txt one && test_commit two_rebase main.txt two &&
@@ -118,11 +118,11 @@ EOF test_expect_success 'prepare for rebase_i_conflicts' ' - git reset --hard master && + git reset --hard main && git checkout -b rebase_i_conflicts && test_commit one_unmerge main.txt one_unmerge && git branch rebase_i_conflicts_second && - test_commit one_master main.txt one_master && + test_commit one_main main.txt one_main && git checkout rebase_i_conflicts_second && test_commit one_second main.txt one_second '
@@ -182,7 +182,7 @@ EOF test_expect_success 'status when rebasing -i in edit mode' ' - git reset --hard master && + git reset --hard main && git checkout -b rebase_i_edit && test_commit one_rebase_i main.txt one && test_commit two_rebase_i main.txt two &&
@@ -212,7 +212,7 @@ EOF test_expect_success 'status when splitting a commit' ' - git reset --hard master && + git reset --hard main && git checkout -b split_commit && test_commit one_split main.txt one && test_commit two_split main.txt two &&
@@ -251,7 +251,7 @@ EOF test_expect_success 'status after editing the last commit with --amend during a rebase -i' ' - git reset --hard master && + git reset --hard main && git checkout -b amend_last && test_commit one_amend main.txt one && test_commit two_amend main.txt two &&
@@ -284,7 +284,7 @@ EOF test_expect_success 'prepare for several edits' ' - git reset --hard master && + git reset --hard main && git checkout -b several_edits && test_commit one_edits main.txt one && test_commit two_edits main.txt two &&
@@ -593,7 +593,7 @@ EOF test_expect_success 'prepare am_session' ' - git reset --hard master && + git reset --hard main && git checkout -b am_session && test_commit one_am one.txt "one" && test_commit two_am two.txt "two" &&
@@ -666,7 +666,7 @@ EOF test_expect_success 'status when bisecting' ' - git reset --hard master && + git reset --hard main && git checkout -b bisect && test_commit one_bisect main.txt one && test_commit two_bisect main.txt two &&
@@ -689,7 +689,7 @@ EOF test_expect_success 'status when rebase --apply conflicts with statushints disabled' ' - git reset --hard master && + git reset --hard main && git checkout -b statushints_disabled && test_when_finished "git config --local advice.statushints true" && git config --local advice.statushints false &&
@@ -714,7 +714,7 @@ EOF test_expect_success 'prepare for cherry-pick conflicts' ' - git reset --hard master && + git reset --hard main && git checkout -b cherry_branch && test_commit one_cherry main.txt one && test_commit two_cherries main.txt two &&
@@ -825,7 +825,7 @@ EOF ' test_expect_success 'status while reverting commit (conflicts)' ' - git checkout master && + git checkout main && echo before >to-revert.txt && test_commit before to-revert.txt && echo old >to-revert.txt &&
@@ -835,7 +835,7 @@ test_expect_success 'status while reverting commit (conflicts)' ' TO_REVERT=$(git rev-parse --short HEAD^) && test_must_fail git revert $TO_REVERT && cat >expected <<EOF && -On branch master +On branch main You are currently reverting commit $TO_REVERT. (fix conflicts and run "git revert --continue") (use "git revert --skip" to skip this patch)
@@ -856,7 +856,7 @@ test_expect_success 'status while reverting commit (conflicts resolved)' ' echo reverted >to-revert.txt && git add to-revert.txt && cat >expected <<EOF && -On branch master +On branch main You are currently reverting commit $TO_REVERT. (all conflicts fixed: run "git revert --continue") (use "git revert --skip" to skip this patch)
@@ -875,7 +875,7 @@ EOF test_expect_success 'status after reverting commit' ' git revert --continue && cat >expected <<\EOF && -On branch master +On branch main nothing to commit (use -u to show untracked files) EOF git status --untracked-files=no >actual &&
@@ -889,7 +889,7 @@ test_expect_success 'status while reverting after committing conflict resolution echo reverted >to-revert.txt && git commit -a && cat >expected <<EOF && -On branch master +On branch main Revert currently in progress. (run "git revert --continue" to continue) (use "git revert --skip" to skip this patch)
@@ -902,7 +902,7 @@ EOF ' test_expect_success 'prepare for different number of commits rebased' ' - git reset --hard master && + git reset --hard main && git checkout -b several_commits && test_commit one_commit main.txt one && test_commit two_commit main.txt two &&
t/t7517-per-repo-email.sh +6 -6
@@ -47,24 +47,24 @@ test_expect_success 'set up rebase scenarios' ' test_expect_success 'fast-forward rebase does not care about ident' ' git checkout -B tmp side-without-commit && - git rebase master + git rebase main ' test_expect_success 'non-fast-forward rebase refuses to write commits' ' test_when_finished "git rebase --abort || true" && git checkout -B tmp side-with-commit && - test_must_fail git rebase master + test_must_fail git rebase main ' test_expect_success 'fast-forward rebase does not care about ident (interactive)' ' git checkout -B tmp side-without-commit && - git rebase -i master + git rebase -i main ' test_expect_success 'non-fast-forward rebase refuses to write commits (interactive)' ' test_when_finished "git rebase --abort || true" && git checkout -B tmp side-with-commit && - test_must_fail git rebase -i master + test_must_fail git rebase -i main ' test_expect_success 'noop interactive rebase does not care about ident' '
@@ -75,14 +75,14 @@ test_expect_success 'noop interactive rebase does not care about ident' ' test_expect_success REBASE_P \ 'fast-forward rebase does not care about ident (preserve)' ' git checkout -B tmp side-without-commit && - git rebase -p master + git rebase -p main ' test_expect_success REBASE_P \ 'non-fast-forward rebase refuses to write commits (preserve)' ' test_when_finished "git rebase --abort || true" && git checkout -B tmp side-with-commit && - test_must_fail git rebase -p master + test_must_fail git rebase -p main ' test_expect_success 'author.name overrides user.name' '
t/t7600-merge.sh +22 -22
152 lines not on this page · raw message
t/t7606-merge-custom.sh +1 -1
@@ -4,7 +4,7 @@ test_description="git merge Testing a custom strategy. -* (HEAD, master) Merge commit 'c3' +* (HEAD, main) Merge commit 'c3' |\ | * (tag: c3) c3 * | (tag: c1) c1
t/t7608-merge-messages.sh +18 -18
@@ -10,51 +10,51 @@ check_oneline() { } test_expect_success 'merge local branch' ' - test_commit master-1 && + test_commit main-1 && git checkout -b local-branch && test_commit branch-1 && - git checkout master && - test_commit master-2 && + git checkout main && + test_commit main-2 && git merge local-branch && check_oneline "Merge branch Qlocal-branchQ" ' test_expect_success 'merge octopus branches' ' - git checkout -b octopus-a master && + git checkout -b octopus-a main && test_commit octopus-1 && - git checkout -b octopus-b master && + git checkout -b octopus-b main && test_commit octopus-2 && - git checkout master && + git checkout main && git merge octopus-a octopus-b && check_oneline "Merge branches Qoctopus-aQ and Qoctopus-bQ" ' test_expect_success 'merge tag' ' - git checkout -b tag-branch master && + git checkout -b tag-branch main && test_commit tag-1 && - git checkout master && - test_commit master-3 && + git checkout main && + test_commit main-3 && git merge tag-1 && check_oneline "Merge tag Qtag-1Q" ' test_expect_success 'ambiguous tag' ' - git checkout -b ambiguous master && + git checkout -b ambiguous main && test_commit ambiguous && - git checkout master && - test_commit master-4 && + git checkout main && + test_commit main-4 && git merge ambiguous && check_oneline "Merge tag QambiguousQ" ' test_expect_success 'remote-tracking branch' ' - git checkout -b remote master && + git checkout -b remote main && test_commit remote-1 && - git update-ref refs/remotes/origin/master remote && - git checkout master && - test_commit master-5 && - git merge origin/master && - check_oneline "Merge remote-tracking branch Qorigin/masterQ" + git update-ref refs/remotes/origin/main remote && + git checkout main && + test_commit main-5 && + git merge origin/main && + check_oneline "Merge remote-tracking branch Qorigin/mainQ" ' test_done
t/t7610-mergetool.sh +87 -87
474 lines not on this page · raw message
t/t7611-merge-abort.sh +2 -2
@@ -7,7 +7,7 @@ Set up repo with conflicting and non-conflicting branches: There are three files foo/bar/baz, and the following graph illustrates the content of these files in each commit: -# foo/bar/baz --- foo/bar/bazz <-- master +# foo/bar/baz --- foo/bar/bazz <-- main # \ # --- foo/barf/bazf <-- conflict_branch # \
@@ -40,7 +40,7 @@ test_expect_success 'setup' ' git checkout -b clean_branch HEAD^ && echo bart > bar && git commit -a -m "clean" && - git checkout master + git checkout main ' pre_merge_head="$(git rev-parse HEAD)"
t/t7612-merge-verify-signatures.sh +1 -1
@@ -31,7 +31,7 @@ test_expect_success GPG 'create signed commits' ' echo 3 >baz && git add baz && test_tick && git commit -SB7227189 -m "untrusted on side" && - git checkout master + git checkout main ' test_expect_success GPG 'merge unsigned commit with verification' '
t/t7614-merge-signoff.sh +12 -12
@@ -11,17 +11,17 @@ This test runs git merge --signoff and makes sure that it works. test_setup() { # Expected commit message after merge --signoff cat >expected-signed <<EOF && -Merge branch 'master' into other-branch +Merge branch 'main' into other-branch Signed-off-by: $(git var GIT_COMMITTER_IDENT | sed -e "s/>.*/>/") EOF # Expected commit message after merge without --signoff (or with --no-signoff) cat >expected-unsigned <<EOF && -Merge branch 'master' into other-branch +Merge branch 'main' into other-branch EOF - # Initial commit and feature branch to merge master into it. + # Initial commit and feature branch to merge main into it. git commit --allow-empty -m "Initial empty commit" && git checkout -b other-branch && test_commit other-branch file1 1
@@ -38,30 +38,30 @@ test_expect_success 'setup' ' # Test with --signoff flag test_expect_success 'git merge --signoff adds a sign-off line' ' - git checkout master && - test_commit master-branch-2 file2 2 && + git checkout main && + test_commit main-branch-2 file2 2 && git checkout other-branch && - git merge master --signoff --no-edit && + git merge main --signoff --no-edit && git cat-file commit HEAD | sed -e "1,/^\$/d" >actual && test_cmp expected-signed actual ' # Test without --signoff flag test_expect_success 'git merge does not add a sign-off line' ' - git checkout master && - test_commit master-branch-3 file3 3 && + git checkout main && + test_commit main-branch-3 file3 3 && git checkout other-branch && - git merge master --no-edit && + git merge main --no-edit && git cat-file commit HEAD | sed -e "1,/^\$/d" >actual && test_cmp expected-unsigned actual ' # Test for --no-signoff flag test_expect_success 'git merge --no-signoff flag cancels --signoff flag' ' - git checkout master && - test_commit master-branch-4 file4 4 && + git checkout main && + test_commit main-branch-4 file4 4 && git checkout other-branch && - git merge master --no-edit --signoff --no-signoff && + git merge main --no-edit --signoff --no-signoff && git cat-file commit HEAD | sed -e "1,/^\$/d" >actual && test_cmp expected-unsigned actual '
t/t7701-repack-unpack-unreachable.sh +1 -1
@@ -22,7 +22,7 @@ test_expect_success '-A with -d option leaves unreachable objects unpacked' ' git commit -a -m more_content && csha1=$(git rev-parse HEAD^{commit}) && tsha1=$(git rev-parse HEAD^{tree}) && - git checkout master && + git checkout main && echo even more content >> file1 && test_tick && git commit -a -m even_more_content &&
t/t7800-difftool.sh +19 -19
@@ -35,23 +35,23 @@ test_expect_success 'basic usage requires no repo' ' test_i18ngrep ^usage: output ' -# Create a file on master and change it on branch +# Create a file on main and change it on branch test_expect_success 'setup' ' - echo master >file && + echo main >file && git add file && git commit -m "added file" && - git checkout -b branch master && + git checkout -b branch main && echo branch >file && git commit -a -m "branch changed file" && - git checkout master + git checkout main ' # Configure a custom difftool.<tool>.cmd and use it test_expect_success 'custom commands' ' difftool_test_setup && test_config difftool.test-tool.cmd "cat \"\$REMOTE\"" && - echo master >expect && + echo main >expect && git difftool --no-prompt branch >actual && test_cmp expect actual &&
@@ -63,7 +63,7 @@ test_expect_success 'custom commands' ' test_expect_success 'custom tool commands override built-ins' ' test_config difftool.vimdiff.cmd "cat \"\$REMOTE\"" && - echo master >expect && + echo main >expect && git difftool --tool vimdiff --no-prompt branch >actual && test_cmp expect actual '
@@ -311,21 +311,21 @@ test_expect_success 'difftool.<tool>.path' ' test_expect_success 'difftool --extcmd=cat' ' echo branch >expect && - echo master >>expect && + echo main >>expect && git difftool --no-prompt --extcmd=cat branch >actual && test_cmp expect actual ' test_expect_success 'difftool --extcmd cat' ' echo branch >expect && - echo master >>expect && + echo main >>expect && git difftool --no-prompt --extcmd=cat branch >actual && test_cmp expect actual ' test_expect_success 'difftool -x cat' ' echo branch >expect && - echo master >>expect && + echo main >>expect && git difftool --no-prompt -x cat branch >actual && test_cmp expect actual '
@@ -338,7 +338,7 @@ test_expect_success 'difftool --extcmd echo arg1' ' ' test_expect_success 'difftool --extcmd cat arg1' ' - echo master >expect && + echo main >expect && git difftool --no-prompt \ --extcmd sh\ -c\ \"cat\ \$1\" branch >actual && test_cmp expect actual
@@ -351,7 +351,7 @@ test_expect_success 'difftool --extcmd cat arg2' ' test_cmp expect actual ' -# Create a second file on master and a different version on branch +# Create a second file on main and a different version on branch test_expect_success 'setup with 2 files different' ' echo m2 >file2 && git add file2 &&
@@ -361,7 +361,7 @@ test_expect_success 'setup with 2 files different' ' echo br2 >file2 && git add file2 && git commit -a -m "branch changed file2" && - git checkout master + git checkout main ' test_expect_success 'say no to the first file' '
@@ -369,14 +369,14 @@ test_expect_success 'say no to the first file' ' git difftool -x cat branch <input >output && grep m2 output && grep br2 output && - ! grep master output && + ! grep main output && ! grep branch output ' test_expect_success 'say no to the second file' ' (echo && echo n) >input && git difftool -x cat branch <input >output && - grep master output && + grep main output && grep branch output && ! grep m2 output && ! grep br2 output
@@ -384,7 +384,7 @@ test_expect_success 'say no to the second file' ' test_expect_success 'ending prompt input with EOF' ' git difftool -x cat branch </dev/null >output && - ! grep master output && + ! grep main output && ! grep branch output && ! grep m2 output && ! grep br2 output
@@ -396,9 +396,9 @@ test_expect_success 'difftool --tool-help' ' ' test_expect_success 'setup change in subdirectory' ' - git checkout master && + git checkout main && mkdir sub && - echo master >sub/sub && + echo main >sub/sub && git add sub/sub && git commit -m "added sub/sub" && git tag v1 &&
@@ -526,7 +526,7 @@ run_dir_diff_test 'difftool --dir-diff from subdirectory with GIT_DIR set' ' run_dir_diff_test 'difftool --dir-diff when worktree file is missing' ' test_when_finished git reset --hard && rm file2 && - git difftool --dir-diff $symlinks --extcmd ls branch master >output && + git difftool --dir-diff $symlinks --extcmd ls branch main >output && grep file2 output '
@@ -543,7 +543,7 @@ run_dir_diff_test 'difftool --dir-diff with unmerged files' ' echo b >>file && git add file && git commit -m conflict-b && - git checkout master && + git checkout main && git merge conflict-a && test_must_fail git merge conflict-b && cat >expect <<-EOF &&
t/t7810-grep.sh +14 -14
@@ -1206,19 +1206,19 @@ test_expect_success 'grep -e -- -- path' ' ' test_expect_success 'dashdash disambiguates rev as rev' ' - test_when_finished "rm -f master" && - echo content >master && - echo master:hello.c >expect && - git grep -l o master -- hello.c >actual && + test_when_finished "rm -f main" && + echo content >main && + echo main:hello.c >expect && + git grep -l o main -- hello.c >actual && test_cmp expect actual ' test_expect_success 'dashdash disambiguates pathspec as pathspec' ' - test_when_finished "git rm -f master" && - echo content >master && - git add master && - echo master:content >expect && - git grep o -- master >actual && + test_when_finished "git rm -f main" && + echo content >main && + git add main && + echo main:content >expect && + git grep o -- main >actual && test_cmp expect actual '
@@ -1254,15 +1254,15 @@ test_expect_success 'grep --no-index pattern -- path' ' ' test_expect_success 'grep --no-index complains of revs' ' - test_must_fail git grep --no-index o master -- 2>err && + test_must_fail git grep --no-index o main -- 2>err && test_i18ngrep "cannot be used with revs" err ' test_expect_success 'grep --no-index prefers paths to revs' ' - test_when_finished "rm -f master" && - echo content >master && - echo master:content >expect && - git grep --no-index o master >actual && + test_when_finished "rm -f main" && + echo content >main && + echo main:content >expect && + git grep --no-index o main >actual && test_cmp expect actual '
t/test-lib.sh +2 -2
@@ -257,13 +257,13 @@ case "$TRASH_DIRECTORY" in esac case "$TEST_NUMBER" in -3404|4013|5310|6300|7064) +3404|4013|5310|6300|7064|7817) # Avoid conflicts with patch series that are cooking at the same time # as the patch series changing the default of `init.defaultBranch`. GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME ;; -[0-6]*|7[0-4]*) +[0-7]*) GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME ;;
Signature · 1 line
gitgitgadget
PATCH 22/28 t8*: adjust the references to the default branch name "main"
In reply to Johannes Schindelin via GitGitGadgetFrom: Johannes Schindelin <[email protected]>
This trick was performed via
$ (cd t && sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \ -e 's/Master/Main/g' -- t8*.sh annotate*.sh)
This allows us to define GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main for those tests.
--- t/annotate-tests.sh | 8 ++++---- t/t8001-annotate.sh | 2 +- t/t8003-blame-corner-cases.sh | 4 ++-- t/t8004-blame-with-conflicts.sh | 14 +++++++------- t/test-lib.sh | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-)
t/annotate-tests.sh +4 -4
@@ -95,7 +95,7 @@ test_expect_success 'blame 2 authors' ' ' test_expect_success 'setup B1 lines (branch1)' ' - git checkout -b branch1 master && + git checkout -b branch1 main && echo "3A slow green fox jumps into the" >>file && echo "well." >>file && GIT_AUTHOR_NAME="B1" GIT_AUTHOR_EMAIL="[email protected]" \
@@ -107,7 +107,7 @@ test_expect_success 'blame 2 authors + 1 branch1 author' ' ' test_expect_success 'setup B2 lines (branch2)' ' - git checkout -b branch2 master && + git checkout -b branch2 main && sed -e "s/2A quick brown/4A quick brown lazy dog/" <file >file.new && mv file.new file && GIT_AUTHOR_NAME="B2" GIT_AUTHOR_EMAIL="[email protected]" \
@@ -131,11 +131,11 @@ test_expect_success 'blame --first-parent blames merge for branch1' ' ' test_expect_success 'blame ancestor' ' - check_count -h master A 2 B 2 + check_count -h main A 2 B 2 ' test_expect_success 'blame great-ancestor' ' - check_count -h master^ A 2 + check_count -h main^ A 2 ' test_expect_success 'setup evil merge' '
t/t8001-annotate.sh +1 -1
@@ -7,7 +7,7 @@ PROG='git annotate' . "$TEST_DIRECTORY"/annotate-tests.sh test_expect_success 'annotate old revision' ' - git annotate file master >actual && + git annotate file main >actual && awk "{ print \$3; }" <actual >authors && test 2 = $(grep A <authors | wc -l) && test 2 = $(grep B <authors | wc -l)
t/t8003-blame-corner-cases.sh +2 -2
@@ -161,13 +161,13 @@ test_expect_success 'blame wholesale copy and more in the index' ' test_expect_success 'blame during cherry-pick with file rename conflict' ' - test_when_finished "git reset --hard && git checkout master" && + test_when_finished "git reset --hard && git checkout main" && git checkout HEAD~3 && echo MOUSE >> mouse && git mv mouse rodent && git add rodent && GIT_AUTHOR_NAME=Rodent git commit -m "rodent" && - git checkout --detach master && + git checkout --detach main && (git cherry-pick HEAD@{1} || test $? -eq 1) && git show HEAD@{1}:rodent > rodent && git add rodent &&
t/t8004-blame-with-conflicts.sh +7 -7
@@ -21,16 +21,16 @@ test_expect_success 'setup first case' ' git add file2 && git commit --author "U Gly <ug@localhost>" -m ugly && - # Back to master and change something - git checkout master && + # Back to main and change something + git checkout main && echo " bla" >> file1 && git commit --author "Old Line <ol@localhost>" -a -m file1.b && - # Back to foo and merge master + # Back to foo and merge main git checkout foo && - if git merge master; then + if git merge main; then echo needed conflict here exit 1 else
@@ -44,8 +44,8 @@ Even more" > file2 && git rm file1 && git commit --author "M Result <mr@localhost>" -a -m merged && - # Back to master and change file1 again - git checkout master && + # Back to main and change file1 again + git checkout main && sed s/bla/foo/ <file1 >X && rm file1 && mv X file1 &&
@@ -53,7 +53,7 @@ Even more" > file2 && # Try to merge into foo again git checkout foo && - if git merge master; then + if git merge main; then echo needed conflict here exit 1 else
t/test-lib.sh +1 -1
@@ -263,7 +263,7 @@ case "$TEST_NUMBER" in GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME ;; -[0-7]*) +[0-8]*) GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME ;;
Signature · 1 line
gitgitgadget
PATCH 23/28 t9[0-4]*: adjust the references to the default branch name "main"
In reply to Johannes Schindelin via GitGitGadgetFrom: Johannes Schindelin <[email protected]>
This trick was performed via
$ (cd t && sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \ -e 's/Master/Main/g' -- t9[0-4]*.sh)
This allows us to define GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main for those tests.
--- t/t9001-send-email.sh | 28 ++++----- t/t9100-git-svn-basic.sh | 2 +- t/t9145-git-svn-master-branch.sh | 6 +- t/t9151-svn-mergeinfo.sh | 2 +- t/t9155-git-svn-fetch-deleted-tag.sh | 2 +- t/t9156-git-svn-fetch-deleted-tag-2.sh | 6 +- t/t9163-git-svn-reset-clears-caches.sh | 2 +- t/t9169-git-svn-dcommit-crlf.sh | 2 +- t/t9300-fast-import.sh | 82 ++++++++++++------------ t/t9301-fast-import-notes.sh | 14 ++--- t/t9302-fast-import-unpack-limit.sh | 16 ++--- t/t9350-fast-export.sh | 86 +++++++++++++------------- t/t9351-fast-export-anonymize.sh | 4 +- t/t9400-git-cvsserver-server.sh | 32 +++++----- t/t9401-git-cvsserver-crlf.sh | 16 ++--- t/t9402-git-cvsserver-refs.sh | 8 +-- t/test-lib.sh | 2 +- 17 files changed, 155 insertions(+), 155 deletions(-)
t/t9001-send-email.sh +14 -14
@@ -1168,10 +1168,10 @@ test_expect_success $PREREQ '--compose-encoding adds correct MIME for subject' ' ' test_expect_success $PREREQ 'detects ambiguous reference/file conflict' ' - echo master >master && - git add master && - git commit -m"add master" && - test_must_fail git send-email --dry-run master 2>errors && + echo main >main && + git add main && + git commit -m"add main" && + test_must_fail git send-email --dry-run main 2>errors && grep disambiguate errors '
@@ -1185,7 +1185,7 @@ test_expect_success $PREREQ 'feed two files' ' outdir/000?-*.patch 2>errors >out && grep "^Subject: " out >subjects && test "z$(sed -n -e 1p subjects)" = "zSubject: [PATCH 1/2] Second." && - test "z$(sed -n -e 2p subjects)" = "zSubject: [PATCH 2/2] add master" + test "z$(sed -n -e 2p subjects)" = "zSubject: [PATCH 2/2] add main" ' test_expect_success $PREREQ 'in-reply-to but no threading' '
@@ -2037,7 +2037,7 @@ test_expect_success $PREREQ 'setup expected-list' ' --cc="Cc2 <[email protected]>" \ --bcc="[email protected]" \ --bcc="[email protected]" \ - 0001-add-master.patch | replace_variable_fields \ + 0001-add-main.patch | replace_variable_fields \ >expected-list '
@@ -2049,7 +2049,7 @@ test_expect_success $PREREQ 'use email list in --cc --to and --bcc' ' --to="[email protected]" \ --cc="Cc 1 <[email protected]>, Cc2 <[email protected]>" \ --bcc="[email protected], [email protected]" \ - 0001-add-master.patch | replace_variable_fields \ + 0001-add-main.patch | replace_variable_fields \ >actual-list && test_cmp expected-list actual-list '
@@ -2065,7 +2065,7 @@ test_expect_success $PREREQ 'aliases work with email list' ' --to="To 1 <[email protected]>, to2, [email protected]" \ --cc="cc1, Cc2 <[email protected]>" \ --bcc="[email protected], [email protected]" \ - 0001-add-master.patch | replace_variable_fields \ + 0001-add-main.patch | replace_variable_fields \ >actual-list && test_cmp expected-list actual-list '
@@ -2089,7 +2089,7 @@ test_expect_success $PREREQ 'leading and trailing whitespaces are removed' ' --cc="Cc2 <[email protected]>" \ --bcc="$BCC1" \ --bcc="[email protected]" \ - 0001-add-master.patch | replace_variable_fields \ + 0001-add-main.patch | replace_variable_fields \ >actual-list && test_cmp expected-list actual-list '
@@ -2108,8 +2108,8 @@ test_expect_success $PREREQ 'invoke hook' ' false ;; esac && - test -f 0001-add-master.patch && - grep "add master" "$1" + test -f 0001-add-main.patch && + grep "add main" "$1" EOF mkdir subdir &&
@@ -2121,10 +2121,10 @@ test_expect_success $PREREQ 'invoke hook' ' --from="Example <[email protected]>" \ [email protected] \ --smtp-server="$(pwd)/../fake.sendmail" \ - ../0001-add-master.patch && + ../0001-add-main.patch && # Verify error message when a patch is rejected by the hook - sed -e "s/add master/x/" ../0001-add-master.patch >../another.patch && + sed -e "s/add main/x/" ../0001-add-main.patch >../another.patch && test_must_fail git send-email \ --from="Example <[email protected]>" \ [email protected] \
@@ -2139,7 +2139,7 @@ test_expect_success $PREREQ 'test that send-email works outside a repo' ' --from="Example <[email protected]>" \ [email protected] \ --smtp-server="$(pwd)/fake.sendmail" \ - "$(pwd)/0001-add-master.patch" + "$(pwd)/0001-add-main.patch" ' test_expect_success $PREREQ 'test that sendmail config is rejected' '
t/t9100-git-svn-basic.sh +1 -1
@@ -275,7 +275,7 @@ test_expect_success 'dcommit $rev does not clobber current branch' ' test refs/heads/my-bar = $(git symbolic-ref HEAD) && git log refs/remotes/bar | grep "change 1" && ! git log refs/remotes/bar | grep "change 2" && - git checkout master && + git checkout main && git branch -D my-bar '
t/t9145-git-svn-master-branch.sh +3 -3
@@ -2,7 +2,7 @@ # # Copyright (c) 2009 Eric Wong # -test_description='git svn initial master branch is "trunk" if possible' +test_description='git svn initial main branch is "trunk" if possible' . ./lib-git-svn.sh test_expect_success 'setup test repository' '
@@ -13,12 +13,12 @@ test_expect_success 'setup test repository' ' svn_cmd import -m b/b i "$svnrepo/branches/b" ' -test_expect_success 'git svn clone --stdlayout sets up trunk as master' ' +test_expect_success 'git svn clone --stdlayout sets up trunk as main' ' git svn clone -s "$svnrepo" g && ( cd g && test x$(git rev-parse --verify refs/remotes/origin/trunk^0) = \ - x$(git rev-parse --verify refs/heads/master^0) + x$(git rev-parse --verify refs/heads/main^0) ) '
t/t9151-svn-mergeinfo.sh +1 -1
@@ -50,7 +50,7 @@ test_expect_success 'merging two branches in one commit is detected correctly' ' ' test_expect_failure 'everything got merged in the end' ' - unmerged=$(git rev-list --all --not master) && + unmerged=$(git rev-list --all --not main) && [ -z "$unmerged" ] '
t/t9155-git-svn-fetch-deleted-tag.sh +1 -1
@@ -36,7 +36,7 @@ test_expect_success 'fetch deleted tags from same revision with checksum error' git svn fetch && git diff --exit-code origin/mybranch:trunk/subdir/file origin/tags/mytag:file && - git diff --exit-code master:subdir/file origin/tags/mytag^:file + git diff --exit-code main:subdir/file origin/tags/mytag^:file ' test_done
t/t9156-git-svn-fetch-deleted-tag-2.sh +3 -3
@@ -36,9 +36,9 @@ test_expect_success 'fetch deleted tags from same revision with no checksum erro cd git_project && git svn fetch && - git diff --exit-code master:subdir3/file origin/tags/mytag:file && - git diff --exit-code master:subdir2/file origin/tags/mytag^:file && - git diff --exit-code master:subdir1/file origin/tags/mytag^^:file + git diff --exit-code main:subdir3/file origin/tags/mytag:file && + git diff --exit-code main:subdir2/file origin/tags/mytag^:file && + git diff --exit-code main:subdir1/file origin/tags/mytag^^:file ' test_done
t/t9163-git-svn-reset-clears-caches.sh +1 -1
@@ -59,7 +59,7 @@ test_expect_success 'fetch to merge-base (a)' ' test_expect_success 'rebase looses SVN merge (m)' ' git svn rebase && git svn fetch && - test 1 = $(git cat-file -p master|grep parent|wc -l) + test 1 = $(git cat-file -p main|grep parent|wc -l) ' # git svn fetch creates correct history with merge commit
t/t9169-git-svn-dcommit-crlf.sh +1 -1
@@ -14,7 +14,7 @@ test_expect_success 'setup commit repository' ' p=$(git rev-parse HEAD) && t=$(git write-tree) && cmt=$(git commit-tree -p $p $t <cmt) && - git update-ref refs/heads/master $cmt && + git update-ref refs/heads/main $cmt && git cat-file commit HEAD | tail -n4 >out && test_cmp cmt out && git svn dcommit &&
t/t9300-fast-import.sh +41 -41
264 lines not on this page · raw message
t/t9301-fast-import-notes.sh +7 -7
@@ -9,7 +9,7 @@ test_description='test git fast-import of notes objects' test_tick cat >input <<INPUT_END -commit refs/heads/master +commit refs/heads/main committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT first commit
@@ -30,7 +30,7 @@ data <<EOF file baz/xyzzy in first commit EOF -commit refs/heads/master +commit refs/heads/main committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT second commit
@@ -46,7 +46,7 @@ data <<EOF file baz/xyzzy in second commit EOF -commit refs/heads/master +commit refs/heads/main committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT third commit
@@ -57,7 +57,7 @@ data <<EOF file foo in third commit EOF -commit refs/heads/master +commit refs/heads/main committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT fourth commit
@@ -70,13 +70,13 @@ EOF INPUT_END -test_expect_success 'set up master branch' ' +test_expect_success 'set up main branch' ' git fast-import <input && - git whatchanged master + git whatchanged main ' -commit4=$(git rev-parse refs/heads/master) +commit4=$(git rev-parse refs/heads/main) commit3=$(git rev-parse "$commit4^") commit2=$(git rev-parse "$commit4~2") commit1=$(git rev-parse "$commit4~3")
t/t9302-fast-import-unpack-limit.sh +8 -8
@@ -5,7 +5,7 @@ test_description='test git fast-import unpack limit' test_expect_success 'create loose objects on import' ' test_tick && cat >input <<-INPUT_END && - commit refs/heads/master + commit refs/heads/main committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT initial
@@ -23,12 +23,12 @@ test_expect_success 'create loose objects on import' ' test_expect_success 'bigger packs are preserved' ' test_tick && cat >input <<-INPUT_END && - commit refs/heads/master + commit refs/heads/main committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT incremental should create a pack COMMIT - from refs/heads/master^0 + from refs/heads/main^0 commit refs/heads/branch committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
@@ -48,7 +48,7 @@ test_expect_success 'bigger packs are preserved' ' test_expect_success 'lookups after checkpoint works' ' hello_id=$(echo hello | git hash-object --stdin -t blob) && id="$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE" && - before=$(git rev-parse refs/heads/master^0) && + before=$(git rev-parse refs/heads/main^0) && ( cat <<-INPUT_END && blob
@@ -56,13 +56,13 @@ test_expect_success 'lookups after checkpoint works' ' data 6 hello - commit refs/heads/master + commit refs/heads/main mark :2 committer $id data <<COMMIT checkpoint after this COMMIT - from refs/heads/master^0 + from refs/heads/main^0 M 100644 :1 hello # pre-checkpoint
@@ -86,10 +86,10 @@ test_expect_success 'lookups after checkpoint works' ' n=$(($n + 1)) fi && sleep 1 && - from=$(git rev-parse refs/heads/master^0) + from=$(git rev-parse refs/heads/main^0) done && cat <<-INPUT_END && - commit refs/heads/master + commit refs/heads/main committer $id data <<COMMIT make sure from "unpacked sha1 reference" works, too
t/t9350-fast-export.sh +43 -43
235 lines not on this page · raw message
t/t9351-fast-export-anonymize.sh +2 -2
@@ -51,7 +51,7 @@ test_expect_success 'stream retains other as refname' ' ' test_expect_success 'stream omits other refnames' ' - ! grep master stream && + ! grep main stream && ! grep mytag stream '
@@ -85,7 +85,7 @@ test_expect_success 'repo has original shape and timestamps' ' shape () { git log --format="%m %ct" --left-right --boundary "$@" } && - (cd .. && shape master...other) >expect && + (cd .. && shape main...other) >expect && shape $main_branch...$other_branch >actual && test_cmp expect actual '
t/t9400-git-cvsserver-server.sh +16 -16
@@ -45,7 +45,7 @@ test_expect_success 'setup' ' touch secondrootfile && git add secondrootfile && git commit -m "second root") && - git fetch secondroot master && + git fetch secondroot main && git merge --allow-unrelated-histories FETCH_HEAD && git clone -q --bare "$WORKDIR/.git" "$SERVERDIR" >/dev/null 2>&1 && GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true &&
@@ -57,7 +57,7 @@ test_expect_success 'setup' ' # note that cvs doesn't accept absolute pathnames # as argument to co -d test_expect_success 'basic checkout' \ - 'GIT_CONFIG="$git_config" cvs -Q co -d cvswork master && + 'GIT_CONFIG="$git_config" cvs -Q co -d cvswork main && test "$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5 | head -n 1))" = "empty/1.1/" && test "$(echo $(grep -v ^D cvswork/CVS/Entries|cut -d/ -f2,3,5 | sed -ne \$p))" = "secondrootfile/1.1/"'
@@ -226,7 +226,7 @@ GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true || exit 1 test_expect_success 'gitcvs.enabled = false' \ 'GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled false && - if GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1 + if GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 then echo unexpected cvs success false
@@ -240,14 +240,14 @@ rm -fr cvswork2 test_expect_success 'gitcvs.ext.enabled = true' \ 'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true && GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled false && - GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1 && + GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 && test_cmp cvswork cvswork2' rm -fr cvswork2 test_expect_success 'gitcvs.ext.enabled = false' \ 'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled false && GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true && - if GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1 + if GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 then echo unexpected cvs success false
@@ -261,21 +261,21 @@ rm -fr cvswork2 test_expect_success 'gitcvs.dbname' \ 'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true && GIT_DIR="$SERVERDIR" git config gitcvs.dbname %Ggitcvs.%a.%m.sqlite && - GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1 && + GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 && test_cmp cvswork cvswork2 && - test -f "$SERVERDIR/gitcvs.ext.master.sqlite" && - cmp "$SERVERDIR/gitcvs.master.sqlite" "$SERVERDIR/gitcvs.ext.master.sqlite"' + test -f "$SERVERDIR/gitcvs.ext.main.sqlite" && + cmp "$SERVERDIR/gitcvs.main.sqlite" "$SERVERDIR/gitcvs.ext.main.sqlite"' rm -fr cvswork2 test_expect_success 'gitcvs.ext.dbname' \ 'GIT_DIR="$SERVERDIR" git config --bool gitcvs.ext.enabled true && GIT_DIR="$SERVERDIR" git config gitcvs.ext.dbname %Ggitcvs1.%a.%m.sqlite && GIT_DIR="$SERVERDIR" git config gitcvs.dbname %Ggitcvs2.%a.%m.sqlite && - GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1 && + GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 && test_cmp cvswork cvswork2 && - test -f "$SERVERDIR/gitcvs1.ext.master.sqlite" && - test ! -f "$SERVERDIR/gitcvs2.ext.master.sqlite" && - cmp "$SERVERDIR/gitcvs.master.sqlite" "$SERVERDIR/gitcvs1.ext.master.sqlite"' + test -f "$SERVERDIR/gitcvs1.ext.main.sqlite" && + test ! -f "$SERVERDIR/gitcvs2.ext.main.sqlite" && + cmp "$SERVERDIR/gitcvs.main.sqlite" "$SERVERDIR/gitcvs1.ext.main.sqlite"' #------------
@@ -457,7 +457,7 @@ cd "$WORKDIR" test_expect_success 'cvs update (module list supports packed refs)' ' GIT_DIR="$SERVERDIR" git pack-refs --all && GIT_CONFIG="$git_config" cvs -n up -d 2> out && - grep "cvs update: New directory \`master'\''" < out + grep "cvs update: New directory \`main'\''" < out ' #------------
@@ -499,8 +499,8 @@ test_expect_success 'cvs status (no subdirs in header)' ' cd "$WORKDIR" test_expect_success 'cvs co -c (shows module database)' ' GIT_CONFIG="$git_config" cvs co -c > out && - grep "^master[ ][ ]*master$" <out && - ! grep -v "^master[ ][ ]*master$" <out + grep "^main[ ][ ]*main$" <out && + ! grep -v "^main[ ][ ]*main$" <out ' #------------
@@ -526,7 +526,7 @@ test_expect_success 'cvs co -c (shows module database)' ' sed -e 's/^x//' -e 's/SP$/ /' > "$WORKDIR/expect" <<EOF x -xRCS file: $WORKDIR/gitcvs.git/master/merge,v +xRCS file: $WORKDIR/gitcvs.git/main/merge,v xWorking file: merge xhead: 1.4 xbranch:
t/t9401-git-cvsserver-crlf.sh +8 -8
@@ -105,14 +105,14 @@ test_expect_success 'setup' ' ' test_expect_success 'cvs co (default crlf)' ' - GIT_CONFIG="$git_config" cvs -Q co -d cvswork master >cvs.log 2>&1 && + GIT_CONFIG="$git_config" cvs -Q co -d cvswork main >cvs.log 2>&1 && test x"$(grep '/-k' cvswork/CVS/Entries cvswork/subdir/CVS/Entries)" = x"" ' rm -rf cvswork test_expect_success 'cvs co (allbinary)' ' GIT_DIR="$SERVERDIR" git config --bool gitcvs.allbinary true && - GIT_CONFIG="$git_config" cvs -Q co -d cvswork master >cvs.log 2>&1 && + GIT_CONFIG="$git_config" cvs -Q co -d cvswork main >cvs.log 2>&1 && marked_as cvswork textfile.c -kb && marked_as cvswork binfile.bin -kb && marked_as cvswork .gitattributes -kb &&
@@ -125,7 +125,7 @@ test_expect_success 'cvs co (allbinary)' ' rm -rf cvswork cvs.log test_expect_success 'cvs co (use attributes/allbinary)' ' GIT_DIR="$SERVERDIR" git config --bool gitcvs.usecrlfattr true && - GIT_CONFIG="$git_config" cvs -Q co -d cvswork master >cvs.log 2>&1 && + GIT_CONFIG="$git_config" cvs -Q co -d cvswork main >cvs.log 2>&1 && marked_as cvswork textfile.c "" && marked_as cvswork binfile.bin -kb && marked_as cvswork .gitattributes -kb &&
@@ -138,7 +138,7 @@ test_expect_success 'cvs co (use attributes/allbinary)' ' rm -rf cvswork test_expect_success 'cvs co (use attributes)' ' GIT_DIR="$SERVERDIR" git config --bool gitcvs.allbinary false && - GIT_CONFIG="$git_config" cvs -Q co -d cvswork master >cvs.log 2>&1 && + GIT_CONFIG="$git_config" cvs -Q co -d cvswork main >cvs.log 2>&1 && marked_as cvswork textfile.c "" && marked_as cvswork binfile.bin -kb && marked_as cvswork .gitattributes "" &&
@@ -194,7 +194,7 @@ test_expect_success 'updating' ' rm -rf cvswork test_expect_success 'cvs co (use attributes/guess)' ' GIT_DIR="$SERVERDIR" git config gitcvs.allbinary guess && - GIT_CONFIG="$git_config" cvs -Q co -d cvswork master >cvs.log 2>&1 && + GIT_CONFIG="$git_config" cvs -Q co -d cvswork main >cvs.log 2>&1 && marked_as cvswork textfile.c "" && marked_as cvswork binfile.bin -kb && marked_as cvswork .gitattributes "" &&
@@ -224,7 +224,7 @@ test_expect_success 'setup multi-line files' ' rm -rf cvswork test_expect_success 'cvs co (guess)' ' GIT_DIR="$SERVERDIR" git config --bool gitcvs.usecrlfattr false && - GIT_CONFIG="$git_config" cvs -Q co -d cvswork master >cvs.log 2>&1 && + GIT_CONFIG="$git_config" cvs -Q co -d cvswork main >cvs.log 2>&1 && marked_as cvswork textfile.c "" && marked_as cvswork binfile.bin -kb && marked_as cvswork .gitattributes "" &&
@@ -239,7 +239,7 @@ test_expect_success 'cvs co (guess)' ' ' test_expect_success 'cvs co another copy (guess)' ' - GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 master >cvs.log 2>&1 && + GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 && marked_as cvswork2 textfile.c "" && marked_as cvswork2 binfile.bin -kb && marked_as cvswork2 .gitattributes "" &&
@@ -335,7 +335,7 @@ test_expect_success 'update subdir of other copy (guess)' ' echo "starting update/merge" >> "${WORKDIR}/marked.log" test_expect_success 'update/merge full other copy (guess)' ' - git pull gitcvs.git master && + git pull gitcvs.git main && sed "s/3/replaced_3/" < multilineTxt.c > ml.temp && mv ml.temp multilineTxt.c && git add multilineTxt.c &&
t/t9402-git-cvsserver-refs.sh +4 -4
@@ -115,7 +115,7 @@ test_expect_success 'setup v1, b1' ' rm -rf cvswork test_expect_success 'cvs co v1' ' - cvs -f -Q co -r v1 -d cvswork master >cvs.log 2>&1 && + cvs -f -Q co -r v1 -d cvswork main >cvs.log 2>&1 && check_start_tree cvswork && check_file cvswork textfile.c v1 && check_file cvswork t2 v1 &&
@@ -128,7 +128,7 @@ test_expect_success 'cvs co v1' ' rm -rf cvswork test_expect_success 'cvs co b1' ' - cvs -f co -r b1 -d cvswork master >cvs.log 2>&1 && + cvs -f co -r b1 -d cvswork main >cvs.log 2>&1 && check_start_tree cvswork && check_file cvswork textfile.c v1 && check_file cvswork t2 v1 &&
@@ -140,7 +140,7 @@ test_expect_success 'cvs co b1' ' ' test_expect_success 'cvs co b1 [cvswork3]' ' - cvs -f co -r b1 -d cvswork3 master >cvs.log 2>&1 && + cvs -f co -r b1 -d cvswork3 main >cvs.log 2>&1 && check_start_tree cvswork3 && check_file cvswork3 textfile.c v1 && check_file cvswork3 t2 v1 &&
@@ -265,7 +265,7 @@ test_expect_success 'setup simple b2' ' ' test_expect_success 'cvs co b2 [into cvswork2]' ' - cvs -f co -r b2 -d cvswork2 master >cvs.log 2>&1 && + cvs -f co -r b2 -d cvswork2 main >cvs.log 2>&1 && check_start_tree cvswork && check_file cvswork textfile.c v1 && check_file cvswork t2 v1 &&
t/test-lib.sh +1 -1
@@ -263,7 +263,7 @@ case "$TEST_NUMBER" in GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME ;; -[0-8]*) +[0-8]*|9[0-4]*) GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME ;;
Signature · 1 line
gitgitgadget
PATCH 24/28 t9[5-7]*: adjust the references to the default branch name "main"
In reply to Johannes Schindelin via GitGitGadgetFrom: Johannes Schindelin <[email protected]>
This trick was performed via
$ (cd t && sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \ -e 's/Master/Main/g' -- t9[5-7]*.sh lib-cvs.sh)
This allows us to define GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main for those tests.
--- t/lib-cvs.sh | 2 +- t/t9500-gitweb-standalone-no-errors.sh | 20 ++++++++++---------- t/t9501-gitweb-standalone-http-status.sh | 14 +++++++------- t/t9502-gitweb-standalone-parse-output.sh | 16 ++++++++-------- t/t9600-cvsimport.sh | 2 +- t/t9601-cvsimport-vendor-branch.sh | 16 ++++++++-------- t/t9602-cvsimport-branches-tags.sh | 4 ++-- t/t9603-cvsimport-patchsets.sh | 8 ++++---- t/test-lib.sh | 2 +- 9 files changed, 42 insertions(+), 42 deletions(-)
t/lib-cvs.sh +1 -1
@@ -36,7 +36,7 @@ setup_cvs_test_repository () { test_cvs_co () { # Usage: test_cvs_co BRANCH_NAME rm -rf module-cvs-"$1" - if [ "$1" = "master" ] + if [ "$1" = "main" ] then $CVS co -P -d module-cvs-"$1" -A module else
t/t9500-gitweb-standalone-no-errors.sh +10 -10
@@ -327,7 +327,7 @@ test_expect_success \ echo "Branch" >>b && git add b && git commit -a -m "On branch" && - git checkout master && + git checkout main && git merge b && git tag merge_commit'
@@ -364,7 +364,7 @@ test_expect_success \ echo "Changed and have mode changed" >07-change-mode-change && test_chmod +x 07-change-mode-change && git commit -a -m "Large commit" && - git checkout master' + git checkout main' test_expect_success \ 'commit(1): large commit' \
@@ -402,7 +402,7 @@ test_expect_success 'side-by-side: merge commit' ' test_expect_success \ 'tags: list of different types of tags' \ - 'git checkout master && + 'git checkout main && git tag -a -m "Tag commit object" tag-commit HEAD && git tag -a -m "" tag-commit-nomessage HEAD && git tag -a -m "Tag tag object" tag-tag tag-commit &&
@@ -443,7 +443,7 @@ test_expect_success \ test_expect_success \ 'logs: history (implicit HEAD, deleted file)' \ - 'git checkout master && + 'git checkout main && echo "to be deleted" >deleted_file && git add deleted_file && git commit -m "Add file to be deleted" &&
@@ -463,11 +463,11 @@ test_expect_success \ test_expect_success \ 'path_info: project/branch:file' \ - 'gitweb_run "" "/.git/master:file"' + 'gitweb_run "" "/.git/main:file"' test_expect_success \ 'path_info: project/branch:dir/' \ - 'gitweb_run "" "/.git/master:foo/"' + 'gitweb_run "" "/.git/main:foo/"' test_expect_success \ 'path_info: project/branch (non-existent)' \
@@ -479,16 +479,16 @@ test_expect_success \ test_expect_success \ 'path_info: project/branch:file (non-existent)' \ - 'gitweb_run "" "/.git/master:non-existent"' + 'gitweb_run "" "/.git/main:non-existent"' test_expect_success \ 'path_info: project/branch:dir/ (non-existent)' \ - 'gitweb_run "" "/.git/master:non-existent/"' + 'gitweb_run "" "/.git/main:non-existent/"' test_expect_success \ 'path_info: project/branch:/file' \ - 'gitweb_run "" "/.git/master:/file"' + 'gitweb_run "" "/.git/main:/file"' test_expect_success \ 'path_info: project/:/file (implicit HEAD)' \
@@ -801,7 +801,7 @@ test_expect_success \ git checkout orphan_branch || git checkout --orphan orphan_branch } && - test_when_finished "git checkout master" && + test_when_finished "git checkout main" && gitweb_run "p=.git;a=summary"' test_done
t/t9501-gitweb-standalone-http-status.sh +7 -7
@@ -85,7 +85,7 @@ test_debug 'cat gitweb.headers' # snapshot hash ids test_expect_success 'snapshots: good tree-ish id' ' - gitweb_run "p=.git;a=snapshot;h=master;sf=tgz" && + gitweb_run "p=.git;a=snapshot;h=main;sf=tgz" && grep "Status: 200 OK" gitweb.output ' test_debug 'cat gitweb.headers'
@@ -123,7 +123,7 @@ test_debug 'cat gitweb.output' # modification times (Last-Modified and If-Modified-Since) test_expect_success DATE_PARSER 'modification: feed last-modified' ' - gitweb_run "p=.git;a=atom;h=master" && + gitweb_run "p=.git;a=atom;h=main" && grep "Status: 200 OK" gitweb.headers && grep "Last-modified: Thu, 7 Apr 2005 22:14:13 +0000" gitweb.headers '
@@ -133,7 +133,7 @@ test_expect_success DATE_PARSER 'modification: feed if-modified-since (modified) HTTP_IF_MODIFIED_SINCE="Wed, 6 Apr 2005 22:14:13 +0000" && export HTTP_IF_MODIFIED_SINCE && test_when_finished "unset HTTP_IF_MODIFIED_SINCE" && - gitweb_run "p=.git;a=atom;h=master" && + gitweb_run "p=.git;a=atom;h=main" && grep "Status: 200 OK" gitweb.headers ' test_debug 'cat gitweb.headers'
@@ -142,13 +142,13 @@ test_expect_success DATE_PARSER 'modification: feed if-modified-since (unmodifie HTTP_IF_MODIFIED_SINCE="Thu, 7 Apr 2005 22:14:13 +0000" && export HTTP_IF_MODIFIED_SINCE && test_when_finished "unset HTTP_IF_MODIFIED_SINCE" && - gitweb_run "p=.git;a=atom;h=master" && + gitweb_run "p=.git;a=atom;h=main" && grep "Status: 304 Not Modified" gitweb.headers ' test_debug 'cat gitweb.headers' test_expect_success DATE_PARSER 'modification: snapshot last-modified' ' - gitweb_run "p=.git;a=snapshot;h=master;sf=tgz" && + gitweb_run "p=.git;a=snapshot;h=main;sf=tgz" && grep "Status: 200 OK" gitweb.headers && grep "Last-modified: Thu, 7 Apr 2005 22:14:13 +0000" gitweb.headers '
@@ -158,7 +158,7 @@ test_expect_success DATE_PARSER 'modification: snapshot if-modified-since (modif HTTP_IF_MODIFIED_SINCE="Wed, 6 Apr 2005 22:14:13 +0000" && export HTTP_IF_MODIFIED_SINCE && test_when_finished "unset HTTP_IF_MODIFIED_SINCE" && - gitweb_run "p=.git;a=snapshot;h=master;sf=tgz" && + gitweb_run "p=.git;a=snapshot;h=main;sf=tgz" && grep "Status: 200 OK" gitweb.headers ' test_debug 'cat gitweb.headers'
@@ -167,7 +167,7 @@ test_expect_success DATE_PARSER 'modification: snapshot if-modified-since (unmod HTTP_IF_MODIFIED_SINCE="Thu, 7 Apr 2005 22:14:13 +0000" && export HTTP_IF_MODIFIED_SINCE && test_when_finished "unset HTTP_IF_MODIFIED_SINCE" && - gitweb_run "p=.git;a=snapshot;h=master;sf=tgz" && + gitweb_run "p=.git;a=snapshot;h=main;sf=tgz" && grep "Status: 304 Not Modified" gitweb.headers ' test_debug 'cat gitweb.headers'
t/t9502-gitweb-standalone-parse-output.sh +8 -8
@@ -79,10 +79,10 @@ test_expect_success 'snapshot: HEAD' ' ' test_debug 'cat gitweb.headers && cat file_list' -test_expect_success 'snapshot: short branch name (master)' ' - gitweb_run "p=.git;a=snapshot;h=master;sf=tar" && - ID=$(git rev-parse --verify --short=7 master) && - check_snapshot ".git-master-$ID" +test_expect_success 'snapshot: short branch name (main)' ' + gitweb_run "p=.git;a=snapshot;h=main;sf=tar" && + ID=$(git rev-parse --verify --short=7 main) && + check_snapshot ".git-main-$ID" ' test_debug 'cat gitweb.headers && cat file_list'
@@ -93,10 +93,10 @@ test_expect_success 'snapshot: short tag name (first)' ' ' test_debug 'cat gitweb.headers && cat file_list' -test_expect_success 'snapshot: full branch name (refs/heads/master)' ' - gitweb_run "p=.git;a=snapshot;h=refs/heads/master;sf=tar" && - ID=$(git rev-parse --verify --short=7 master) && - check_snapshot ".git-master-$ID" +test_expect_success 'snapshot: full branch name (refs/heads/main)' ' + gitweb_run "p=.git;a=snapshot;h=refs/heads/main;sf=tar" && + ID=$(git rev-parse --verify --short=7 main) && + check_snapshot ".git-main-$ID" ' test_debug 'cat gitweb.headers && cat file_list'
t/t9600-cvsimport.sh +1 -1
@@ -159,6 +159,6 @@ test_expect_success PERL 'no .git/cvs-revisions created by default' ' ' -test_expect_success PERL 'test entire HEAD' 'test_cmp_branch_tree master' +test_expect_success PERL 'test entire HEAD' 'test_cmp_branch_tree main' test_done
t/t9601-cvsimport-vendor-branch.sh +8 -8
@@ -42,43 +42,43 @@ test_expect_success PERL 'import a module with a vendor branch' ' ' -test_expect_success PERL 'check HEAD out of cvs repository' 'test_cvs_co master' +test_expect_success PERL 'check HEAD out of cvs repository' 'test_cvs_co main' -test_expect_success PERL 'check master out of git repository' 'test_git_co master' +test_expect_success PERL 'check main out of git repository' 'test_git_co main' test_expect_success PERL 'check a file that was imported once' ' - test_cmp_branch_file master imported-once.txt + test_cmp_branch_file main imported-once.txt ' test_expect_failure PERL 'check a file that was imported twice' ' - test_cmp_branch_file master imported-twice.txt + test_cmp_branch_file main imported-twice.txt ' test_expect_success PERL 'check a file that was imported then modified on HEAD' ' - test_cmp_branch_file master imported-modified.txt + test_cmp_branch_file main imported-modified.txt ' test_expect_success PERL 'check a file that was imported, modified, then imported again' ' - test_cmp_branch_file master imported-modified-imported.txt + test_cmp_branch_file main imported-modified-imported.txt ' test_expect_success PERL 'check a file that was added to HEAD then imported' ' - test_cmp_branch_file master added-imported.txt + test_cmp_branch_file main added-imported.txt ' test_expect_success PERL 'a vendor branch whose tag has been removed' ' - test_cmp_branch_file master imported-anonymously.txt + test_cmp_branch_file main imported-anonymously.txt '
t/t9602-cvsimport-branches-tags.sh +2 -2
@@ -14,9 +14,9 @@ test_expect_success PERL 'import module' ' ' -test_expect_success PERL 'test branch master' ' +test_expect_success PERL 'test branch main' ' - test_cmp_branch_tree master + test_cmp_branch_tree main '
t/t9603-cvsimport-patchsets.sh +4 -4
@@ -20,16 +20,16 @@ test_expect_failure PERL 'import with criss cross times on revisions' ' git cvsimport -p"-x" -C module-git module && ( cd module-git && - git log --pretty=format:%s > ../actual-master && + git log --pretty=format:%s > ../actual-main && git log A~2..A --pretty="format:%s %ad" -- > ../actual-A && - echo "" >> ../actual-master && + echo "" >> ../actual-main && echo "" >> ../actual-A ) && echo "Rev 4 Rev 3 Rev 2 -Rev 1" > expect-master && - test_cmp expect-master actual-master && +Rev 1" > expect-main && + test_cmp expect-main actual-main && echo "Rev 5 Branch A Wed Mar 11 19:09:10 2009 +0000 Rev 4 Branch A Wed Mar 11 19:03:52 2009 +0000" > expect-A &&
t/test-lib.sh +1 -1
@@ -263,7 +263,7 @@ case "$TEST_NUMBER" in GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME ;; -[0-8]*|9[0-4]*) +[0-8]*|9[0-7]*) GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME ;;
Signature · 1 line
gitgitgadget
PATCH 25/28 tests(git-p4): transition to the default branch name `main`
In reply to Johannes Schindelin via GitGitGadgetFrom: Johannes Schindelin <[email protected]>
In the previous commits, we adjusted the test suite to use the branch name main for initial branches.
The git p4-related tests are a bit harder to adjust because git p4 uses the ref refs/heads/p4/master to track the remote branches, and for now, we do not want to change that (this might be the subject of a future patch series). We only need to adjust for the actual initial branch name to be changed to main.
This allows us to define GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main for those tests.
--- t/t9800-git-p4-basic.sh | 2 +- t/t9801-git-p4-branch.sh | 16 ++++++++-------- t/t9806-git-p4-options.sh | 18 +++++++++--------- t/t9807-git-p4-submit.sh | 2 +- t/t9811-git-p4-label-import.sh | 2 +- t/test-lib.sh | 2 +- 6 files changed, 21 insertions(+), 21 deletions(-)
t/t9800-git-p4-basic.sh +1 -1
@@ -226,7 +226,7 @@ test_expect_success 'clone --bare should make a bare repository' ' git config --get --bool core.bare true && git rev-parse --verify refs/remotes/p4/master && git rev-parse --verify refs/remotes/p4/HEAD && - git rev-parse --verify refs/heads/master && + git rev-parse --verify refs/heads/main && git rev-parse --verify HEAD ) '
t/t9801-git-p4-branch.sh +8 -8
@@ -67,7 +67,7 @@ test_expect_success 'import main, no branch detection' ' ( cd "$git" && git log --oneline --graph --decorate --all && - git rev-list master -- >wc && + git rev-list main -- >wc && test_line_count = 4 wc ) '
@@ -78,7 +78,7 @@ test_expect_success 'import branch1, no branch detection' ' ( cd "$git" && git log --oneline --graph --decorate --all && - git rev-list master -- >wc && + git rev-list main -- >wc && test_line_count = 2 wc ) '
@@ -89,7 +89,7 @@ test_expect_success 'import branch2, no branch detection' ' ( cd "$git" && git log --oneline --graph --decorate --all && - git rev-list master -- >wc && + git rev-list main -- >wc && test_line_count = 2 wc ) '
@@ -100,7 +100,7 @@ test_expect_success 'import depot, no branch detection' ' ( cd "$git" && git log --oneline --graph --decorate --all && - git rev-list master -- >wc && + git rev-list main -- >wc && test_line_count = 8 wc ) '
@@ -114,7 +114,7 @@ test_expect_success 'import depot, branch detection' ' git log --oneline --graph --decorate --all && # 4 main commits - git rev-list master -- >wc && + git rev-list main -- >wc && test_line_count = 4 wc && # 3 main, 1 integrate, 1 on branch2
@@ -137,7 +137,7 @@ test_expect_success 'import depot, branch detection, branchList branch definitio git log --oneline --graph --decorate --all && # 4 main commits - git rev-list master -- >wc && + git rev-list main -- >wc && test_line_count = 4 wc && # 3 main, 1 integrate, 1 on branch2
@@ -484,7 +484,7 @@ test_expect_success 'use-client-spec detect-branches files in top-level' ' ( cd "$git" && git p4 sync --detect-branches --use-client-spec //depot/usecs@all && - git checkout -b master p4/usecs/b1 && + git checkout -b main p4/usecs/b1 && test_path_is_file b1-file1 && test_path_is_missing b2-file2 && test_path_is_missing b1 &&
@@ -537,7 +537,7 @@ test_expect_success 'use-client-spec detect-branches skips files in branches' ' ( cd "$git" && git p4 sync --detect-branches --use-client-spec //depot/usecs@all && - git checkout -b master p4/usecs/b3 && + git checkout -b main p4/usecs/b3 && test_path_is_file b1-file1 && test_path_is_file b3-file3_2 && test_path_is_missing b3-file3_1
t/t9806-git-p4-options.sh +9 -9
@@ -27,14 +27,14 @@ test_expect_success 'clone no --git-dir' ' test_must_fail git p4 clone --git-dir=xx //depot ' -test_expect_success 'clone --branch should checkout master' ' +test_expect_success 'clone --branch should checkout main' ' git p4 clone --branch=refs/remotes/p4/sb --dest="$git" //depot && test_when_finished cleanup_git && ( cd "$git" && git rev-parse refs/remotes/p4/sb >sb && - git rev-parse refs/heads/master >master && - test_cmp sb master && + git rev-parse refs/heads/main >main && + test_cmp sb main && git rev-parse HEAD >head && test_cmp sb head )
@@ -147,22 +147,22 @@ test_expect_success 'clone --changesfile, @all' ' test_must_fail git p4 clone --changesfile="$TRASH_DIRECTORY/cf" --dest="$git" //depot@all ' -# imports both master and p4/master in refs/heads +# imports both main and p4/master in refs/heads # requires --import-local on sync to find p4 refs/heads -# does not update master on sync, just p4/master +# does not update main on sync, just p4/master test_expect_success 'clone/sync --import-local' ' git p4 clone --import-local --dest="$git" //depot@1,2 && test_when_finished cleanup_git && ( cd "$git" && - git log --oneline refs/heads/master >lines && + git log --oneline refs/heads/main >lines && test_line_count = 2 lines && git log --oneline refs/heads/p4/master >lines && test_line_count = 2 lines && test_must_fail git p4 sync && git p4 sync --import-local && - git log --oneline refs/heads/master >lines && + git log --oneline refs/heads/main >lines && test_line_count = 2 lines && git log --oneline refs/heads/p4/master >lines && test_line_count = 3 lines
@@ -174,7 +174,7 @@ test_expect_success 'clone --max-changes' ' test_when_finished cleanup_git && ( cd "$git" && - git log --oneline refs/heads/master >lines && + git log --oneline refs/heads/main >lines && test_line_count = 2 lines ) '
@@ -237,7 +237,7 @@ test_expect_success 'clone --use-client-spec' ' git init && git config git-p4.useClientSpec true && git p4 sync //depot/... && - git checkout -b master p4/master && + git checkout -b main p4/master && test_path_is_file bus/dir/f4 && test_path_is_missing file1 )
t/t9807-git-p4-submit.sh +1 -1
@@ -114,7 +114,7 @@ test_expect_success 'submit with allowSubmit' ' git config git-p4.skipSubmitEdit true && git config git-p4.allowSubmit "nobranch" && test_must_fail git p4 submit && - git config git-p4.allowSubmit "nobranch,master" && + git config git-p4.allowSubmit "nobranch,main" && git p4 submit ) '
t/t9811-git-p4-label-import.sh +1 -1
@@ -185,7 +185,7 @@ test_expect_success 'tag that cannot be exported' ' git add main/f12 && git commit -m "adding f12" && git tag -m "tag on a_branch" GIT_TAG_ON_A_BRANCH && - git checkout master && + git checkout main && git p4 submit --export-labels ) && (
t/test-lib.sh +1 -1
@@ -263,7 +263,7 @@ case "$TEST_NUMBER" in GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME ;; -[0-8]*|9[0-7]*) +[0-8]*|9[0-8]*) GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME ;;
Signature · 1 line
gitgitgadget
PATCH 26/28 t99*: adjust the references to the default branch name "main"
In reply to Johannes Schindelin via GitGitGadgetFrom: Johannes Schindelin <[email protected]>
Carefully excluding t9902, which sees independent development elsewhere at the time of writing, we use main as the default branch name in t9903. This trick was performed via
$ (cd t && sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \ -e 's/Master/Main/g' -- t99*.sh lib-cvs.sh && git checkout HEAD -- t9902\*)
This allows us to define GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main for all tests (except the ones we specifically excluded for now).
--- t/t9903-bash-prompt.sh | 114 ++++++++++++++++++++--------------------- t/test-lib.sh | 4 +- 2 files changed, 59 insertions(+), 59 deletions(-)
t/t9903-bash-prompt.sh +57 -57
@@ -28,7 +28,7 @@ test_expect_success 'setup for prompt tests' ' echo 3 >file && git commit -m "third b1" file && git tag -a -m msg2 t2 && - git checkout -b b2 master && + git checkout -b b2 main && echo 0 >file && git commit -m "second b2" file && echo 00 >file &&
@@ -37,20 +37,20 @@ test_expect_success 'setup for prompt tests' ' git commit -m "yet another b2" file && mkdir ignored_dir && echo "ignored_dir/" >>.gitignore && - git checkout master + git checkout main ' test_expect_success 'prompt - branch name' ' - printf " (master)" >expected && + printf " (main)" >expected && __git_ps1 >"$actual" && test_cmp expected "$actual" ' test_expect_success SYMLINKS 'prompt - branch name - symlink symref' ' - printf " (master)" >expected && - test_when_finished "git checkout master" && + printf " (main)" >expected && + test_when_finished "git checkout main" && test_config core.preferSymlinkRefs true && - git checkout master && + git checkout main && __git_ps1 >"$actual" && test_cmp expected "$actual" '
@@ -58,7 +58,7 @@ test_expect_success SYMLINKS 'prompt - branch name - symlink symref' ' test_expect_success 'prompt - unborn branch' ' printf " (unborn)" >expected && git checkout --orphan unborn && - test_when_finished "git checkout master" && + test_when_finished "git checkout main" && __git_ps1 >"$actual" && test_cmp expected "$actual" '
@@ -72,7 +72,7 @@ test_expect_success FUNNYNAMES 'prompt - with newline in path' ' with newline" && mkdir "$repo_with_newline" && - printf " (master)" >expected && + printf " (main)" >expected && git init "$repo_with_newline" && test_when_finished "rm -rf \"$repo_with_newline\"" && mkdir "$repo_with_newline"/subdir &&
@@ -87,7 +87,7 @@ test_expect_success 'prompt - detached head' ' printf " ((%s...))" $(git log -1 --format="%h" --abbrev=13 b1^) >expected && test_config core.abbrev 13 && git checkout b1^ && - test_when_finished "git checkout master" && + test_when_finished "git checkout main" && __git_ps1 >"$actual" && test_cmp expected "$actual" '
@@ -95,7 +95,7 @@ test_expect_success 'prompt - detached head' ' test_expect_success 'prompt - describe detached head - contains' ' printf " ((t2~1))" >expected && git checkout b1^ && - test_when_finished "git checkout master" && + test_when_finished "git checkout main" && ( GIT_PS1_DESCRIBE_STYLE=contains && __git_ps1 >"$actual"
@@ -106,7 +106,7 @@ test_expect_success 'prompt - describe detached head - contains' ' test_expect_success 'prompt - describe detached head - branch' ' printf " ((tags/t2~1))" >expected && git checkout b1^ && - test_when_finished "git checkout master" && + test_when_finished "git checkout main" && ( GIT_PS1_DESCRIBE_STYLE=branch && __git_ps1 >"$actual"
@@ -117,7 +117,7 @@ test_expect_success 'prompt - describe detached head - branch' ' test_expect_success 'prompt - describe detached head - describe' ' printf " ((t1-1-g%s))" $(git log -1 --format="%h" b1^) >expected && git checkout b1^ && - test_when_finished "git checkout master" && + test_when_finished "git checkout main" && ( GIT_PS1_DESCRIBE_STYLE=describe && __git_ps1 >"$actual"
@@ -128,7 +128,7 @@ test_expect_success 'prompt - describe detached head - describe' ' test_expect_success 'prompt - describe detached head - default' ' printf " ((t2))" >expected && git checkout --detach b1 && - test_when_finished "git checkout master" && + test_when_finished "git checkout main" && __git_ps1 >"$actual" && test_cmp expected "$actual" '
@@ -152,7 +152,7 @@ test_expect_success 'prompt - deep inside .git directory' ' ' test_expect_success 'prompt - inside bare repository' ' - printf " (BARE:master)" >expected && + printf " (BARE:main)" >expected && git init --bare bare.git && test_when_finished "rm -rf bare.git" && (
@@ -172,7 +172,7 @@ test_expect_success 'prompt - interactive rebase' ' test_when_finished "rm -f fake_editor.sh" && test_set_editor "$TRASH_DIRECTORY/fake_editor.sh" && git checkout b1 && - test_when_finished "git checkout master" && + test_when_finished "git checkout main" && git rebase -i HEAD^ && test_when_finished "git rebase --abort" && __git_ps1 >"$actual" &&
@@ -182,7 +182,7 @@ test_expect_success 'prompt - interactive rebase' ' test_expect_success 'prompt - rebase merge' ' printf " (b2|REBASE 1/3)" >expected && git checkout b2 && - test_when_finished "git checkout master" && + test_when_finished "git checkout main" && test_must_fail git rebase --merge b1 b2 && test_when_finished "git rebase --abort" && __git_ps1 >"$actual" &&
@@ -192,7 +192,7 @@ test_expect_success 'prompt - rebase merge' ' test_expect_success 'prompt - rebase am' ' printf " (b2|REBASE 1/3)" >expected && git checkout b2 && - test_when_finished "git checkout master" && + test_when_finished "git checkout main" && test_must_fail git rebase --apply b1 b2 && test_when_finished "git rebase --abort" && __git_ps1 >"$actual" &&
@@ -202,7 +202,7 @@ test_expect_success 'prompt - rebase am' ' test_expect_success 'prompt - merge' ' printf " (b1|MERGING)" >expected && git checkout b1 && - test_when_finished "git checkout master" && + test_when_finished "git checkout main" && test_must_fail git merge b2 && test_when_finished "git reset --hard" && __git_ps1 >"$actual" &&
@@ -210,7 +210,7 @@ test_expect_success 'prompt - merge' ' ' test_expect_success 'prompt - cherry-pick' ' - printf " (master|CHERRY-PICKING)" >expected && + printf " (main|CHERRY-PICKING)" >expected && test_must_fail git cherry-pick b1 b1^ && test_when_finished "git cherry-pick --abort" && __git_ps1 >"$actual" &&
@@ -222,7 +222,7 @@ test_expect_success 'prompt - cherry-pick' ' ' test_expect_success 'prompt - revert' ' - printf " (master|REVERTING)" >expected && + printf " (main|REVERTING)" >expected && test_must_fail git revert b1^ b1 && test_when_finished "git revert --abort" && __git_ps1 >"$actual" &&
@@ -234,7 +234,7 @@ test_expect_success 'prompt - revert' ' ' test_expect_success 'prompt - bisect' ' - printf " (master|BISECTING)" >expected && + printf " (main|BISECTING)" >expected && git bisect start && test_when_finished "git bisect reset" && __git_ps1 >"$actual" &&
@@ -242,7 +242,7 @@ test_expect_success 'prompt - bisect' ' ' test_expect_success 'prompt - dirty status indicator - clean' ' - printf " (master)" >expected && + printf " (main)" >expected && ( GIT_PS1_SHOWDIRTYSTATE=y && __git_ps1 >"$actual"
@@ -251,7 +251,7 @@ test_expect_success 'prompt - dirty status indicator - clean' ' ' test_expect_success 'prompt - dirty status indicator - dirty worktree' ' - printf " (master *)" >expected && + printf " (main *)" >expected && echo "dirty" >file && test_when_finished "git reset --hard" && (
@@ -262,7 +262,7 @@ test_expect_success 'prompt - dirty status indicator - dirty worktree' ' ' test_expect_success 'prompt - dirty status indicator - dirty index' ' - printf " (master +)" >expected && + printf " (main +)" >expected && echo "dirty" >file && test_when_finished "git reset --hard" && git add -u &&
@@ -274,7 +274,7 @@ test_expect_success 'prompt - dirty status indicator - dirty index' ' ' test_expect_success 'prompt - dirty status indicator - dirty index and worktree' ' - printf " (master *+)" >expected && + printf " (main *+)" >expected && echo "dirty index" >file && test_when_finished "git reset --hard" && git add -u &&
@@ -288,7 +288,7 @@ test_expect_success 'prompt - dirty status indicator - dirty index and worktree' test_expect_success 'prompt - dirty status indicator - orphan branch - clean' ' printf " (orphan #)" >expected && - test_when_finished "git checkout master" && + test_when_finished "git checkout main" && git checkout --orphan orphan && git reset --hard && (
@@ -300,7 +300,7 @@ test_expect_success 'prompt - dirty status indicator - orphan branch - clean' ' test_expect_success 'prompt - dirty status indicator - orphan branch - dirty index' ' printf " (orphan +)" >expected && - test_when_finished "git checkout master" && + test_when_finished "git checkout main" && git checkout --orphan orphan && ( GIT_PS1_SHOWDIRTYSTATE=y &&
@@ -311,7 +311,7 @@ test_expect_success 'prompt - dirty status indicator - orphan branch - dirty ind test_expect_success 'prompt - dirty status indicator - orphan branch - dirty index and worktree' ' printf " (orphan *+)" >expected && - test_when_finished "git checkout master" && + test_when_finished "git checkout main" && git checkout --orphan orphan && >file && (
@@ -322,7 +322,7 @@ test_expect_success 'prompt - dirty status indicator - orphan branch - dirty ind ' test_expect_success 'prompt - dirty status indicator - shell variable unset with config disabled' ' - printf " (master)" >expected && + printf " (main)" >expected && echo "dirty" >file && test_when_finished "git reset --hard" && test_config bash.showDirtyState false &&
@@ -334,7 +334,7 @@ test_expect_success 'prompt - dirty status indicator - shell variable unset with ' test_expect_success 'prompt - dirty status indicator - shell variable unset with config enabled' ' - printf " (master)" >expected && + printf " (main)" >expected && echo "dirty" >file && test_when_finished "git reset --hard" && test_config bash.showDirtyState true &&
@@ -346,7 +346,7 @@ test_expect_success 'prompt - dirty status indicator - shell variable unset with ' test_expect_success 'prompt - dirty status indicator - shell variable set with config disabled' ' - printf " (master)" >expected && + printf " (main)" >expected && echo "dirty" >file && test_when_finished "git reset --hard" && test_config bash.showDirtyState false &&
@@ -358,7 +358,7 @@ test_expect_success 'prompt - dirty status indicator - shell variable set with c ' test_expect_success 'prompt - dirty status indicator - shell variable set with config enabled' ' - printf " (master *)" >expected && + printf " (main *)" >expected && echo "dirty" >file && test_when_finished "git reset --hard" && test_config bash.showDirtyState true &&
@@ -382,7 +382,7 @@ test_expect_success 'prompt - dirty status indicator - not shown inside .git dir ' test_expect_success 'prompt - stash status indicator - no stash' ' - printf " (master)" >expected && + printf " (main)" >expected && ( GIT_PS1_SHOWSTASHSTATE=y && __git_ps1 >"$actual"
@@ -391,7 +391,7 @@ test_expect_success 'prompt - stash status indicator - no stash' ' ' test_expect_success 'prompt - stash status indicator - stash' ' - printf " (master $)" >expected && + printf " (main $)" >expected && echo 2 >file && git stash && test_when_finished "git stash drop" &&
@@ -417,7 +417,7 @@ test_expect_success 'prompt - stash status indicator - not shown inside .git dir ' test_expect_success 'prompt - untracked files status indicator - no untracked files' ' - printf " (master)" >expected && + printf " (main)" >expected && ( GIT_PS1_SHOWUNTRACKEDFILES=y && cd otherrepo &&
@@ -427,7 +427,7 @@ test_expect_success 'prompt - untracked files status indicator - no untracked fi ' test_expect_success 'prompt - untracked files status indicator - untracked files' ' - printf " (master %%)" >expected && + printf " (main %%)" >expected && ( GIT_PS1_SHOWUNTRACKEDFILES=y && __git_ps1 >"$actual"
@@ -436,7 +436,7 @@ test_expect_success 'prompt - untracked files status indicator - untracked files ' test_expect_success 'prompt - untracked files status indicator - empty untracked dir' ' - printf " (master)" >expected && + printf " (main)" >expected && mkdir otherrepo/untracked-dir && test_when_finished "rm -rf otherrepo/untracked-dir" && (
@@ -448,7 +448,7 @@ test_expect_success 'prompt - untracked files status indicator - empty untracked ' test_expect_success 'prompt - untracked files status indicator - non-empty untracked dir' ' - printf " (master %%)" >expected && + printf " (main %%)" >expected && mkdir otherrepo/untracked-dir && test_when_finished "rm -rf otherrepo/untracked-dir" && >otherrepo/untracked-dir/untracked-file &&
@@ -461,7 +461,7 @@ test_expect_success 'prompt - untracked files status indicator - non-empty untra ' test_expect_success 'prompt - untracked files status indicator - untracked files outside cwd' ' - printf " (master %%)" >expected && + printf " (main %%)" >expected && ( mkdir -p ignored_dir && cd ignored_dir &&
@@ -472,7 +472,7 @@ test_expect_success 'prompt - untracked files status indicator - untracked files ' test_expect_success 'prompt - untracked files status indicator - shell variable unset with config disabled' ' - printf " (master)" >expected && + printf " (main)" >expected && test_config bash.showUntrackedFiles false && ( sane_unset GIT_PS1_SHOWUNTRACKEDFILES &&
@@ -482,7 +482,7 @@ test_expect_success 'prompt - untracked files status indicator - shell variable ' test_expect_success 'prompt - untracked files status indicator - shell variable unset with config enabled' ' - printf " (master)" >expected && + printf " (main)" >expected && test_config bash.showUntrackedFiles true && ( sane_unset GIT_PS1_SHOWUNTRACKEDFILES &&
@@ -492,7 +492,7 @@ test_expect_success 'prompt - untracked files status indicator - shell variable ' test_expect_success 'prompt - untracked files status indicator - shell variable set with config disabled' ' - printf " (master)" >expected && + printf " (main)" >expected && test_config bash.showUntrackedFiles false && ( GIT_PS1_SHOWUNTRACKEDFILES=y &&
@@ -502,7 +502,7 @@ test_expect_success 'prompt - untracked files status indicator - shell variable ' test_expect_success 'prompt - untracked files status indicator - shell variable set with config enabled' ' - printf " (master %%)" >expected && + printf " (main %%)" >expected && test_config bash.showUntrackedFiles true && ( GIT_PS1_SHOWUNTRACKEDFILES=y &&
@@ -522,13 +522,13 @@ test_expect_success 'prompt - untracked files status indicator - not shown insid ' test_expect_success 'prompt - format string starting with dash' ' - printf -- "-master" >expected && + printf -- "-main" >expected && __git_ps1 "-%s" >"$actual" && test_cmp expected "$actual" ' test_expect_success 'prompt - pc mode' ' - printf "BEFORE: (\${__git_ps1_branch_name}):AFTER\\nmaster" >expected && + printf "BEFORE: (\${__git_ps1_branch_name}):AFTER\\nmain" >expected && ( __git_ps1 "BEFORE:" ":AFTER" >"$actual" && test_must_be_empty "$actual" &&
@@ -538,7 +538,7 @@ test_expect_success 'prompt - pc mode' ' ' test_expect_success 'prompt - bash color pc mode - branch name' ' - printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear}):AFTER\\nmaster" >expected && + printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear}):AFTER\\nmain" >expected && ( GIT_PS1_SHOWCOLORHINTS=y && __git_ps1 "BEFORE:" ":AFTER" >"$actual" &&
@@ -550,7 +550,7 @@ test_expect_success 'prompt - bash color pc mode - branch name' ' test_expect_success 'prompt - bash color pc mode - detached head' ' printf "BEFORE: (${c_red}\${__git_ps1_branch_name}${c_clear}):AFTER\\n(%s...)" $(git log -1 --format="%h" b1^) >expected && git checkout b1^ && - test_when_finished "git checkout master" && + test_when_finished "git checkout main" && ( GIT_PS1_SHOWCOLORHINTS=y && __git_ps1 "BEFORE:" ":AFTER" &&
@@ -560,7 +560,7 @@ test_expect_success 'prompt - bash color pc mode - detached head' ' ' test_expect_success 'prompt - bash color pc mode - dirty status indicator - dirty worktree' ' - printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_red}*${c_clear}):AFTER\\nmaster" >expected && + printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_red}*${c_clear}):AFTER\\nmain" >expected && echo "dirty" >file && test_when_finished "git reset --hard" && (
@@ -573,7 +573,7 @@ test_expect_success 'prompt - bash color pc mode - dirty status indicator - dirt ' test_expect_success 'prompt - bash color pc mode - dirty status indicator - dirty index' ' - printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_green}+${c_clear}):AFTER\\nmaster" >expected && + printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_green}+${c_clear}):AFTER\\nmain" >expected && echo "dirty" >file && test_when_finished "git reset --hard" && git add -u &&
@@ -587,7 +587,7 @@ test_expect_success 'prompt - bash color pc mode - dirty status indicator - dirt ' test_expect_success 'prompt - bash color pc mode - dirty status indicator - dirty index and worktree' ' - printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_red}*${c_green}+${c_clear}):AFTER\\nmaster" >expected && + printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_red}*${c_green}+${c_clear}):AFTER\\nmain" >expected && echo "dirty index" >file && test_when_finished "git reset --hard" && git add -u &&
@@ -602,7 +602,7 @@ test_expect_success 'prompt - bash color pc mode - dirty status indicator - dirt ' test_expect_success 'prompt - bash color pc mode - dirty status indicator - before root commit' ' - printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_green}#${c_clear}):AFTER\\nmaster" >expected && + printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_green}#${c_clear}):AFTER\\nmain" >expected && ( GIT_PS1_SHOWDIRTYSTATE=y && GIT_PS1_SHOWCOLORHINTS=y &&
@@ -628,7 +628,7 @@ test_expect_success 'prompt - bash color pc mode - inside .git directory' ' ' test_expect_success 'prompt - bash color pc mode - stash status indicator' ' - printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_lblue}\$${c_clear}):AFTER\\nmaster" >expected && + printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_lblue}\$${c_clear}):AFTER\\nmain" >expected && echo 2 >file && git stash && test_when_finished "git stash drop" &&
@@ -642,7 +642,7 @@ test_expect_success 'prompt - bash color pc mode - stash status indicator' ' ' test_expect_success 'prompt - bash color pc mode - untracked files status indicator' ' - printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_red}%%${c_clear}):AFTER\\nmaster" >expected && + printf "BEFORE: (${c_green}\${__git_ps1_branch_name}${c_clear} ${c_red}%%${c_clear}):AFTER\\nmain" >expected && ( GIT_PS1_SHOWUNTRACKEDFILES=y && GIT_PS1_SHOWCOLORHINTS=y &&
@@ -653,7 +653,7 @@ test_expect_success 'prompt - bash color pc mode - untracked files status indica ' test_expect_success 'prompt - zsh color pc mode' ' - printf "BEFORE: (%%F{green}master%%f):AFTER" >expected && + printf "BEFORE: (%%F{green}main%%f):AFTER" >expected && ( ZSH_VERSION=5.0.0 && GIT_PS1_SHOWCOLORHINTS=y &&
@@ -664,7 +664,7 @@ test_expect_success 'prompt - zsh color pc mode' ' ' test_expect_success 'prompt - hide if pwd ignored - env var unset, config disabled' ' - printf " (master)" >expected && + printf " (main)" >expected && test_config bash.hideIfPwdIgnored false && ( cd ignored_dir &&
@@ -685,7 +685,7 @@ test_expect_success 'prompt - hide if pwd ignored - env var unset, config disabl ' test_expect_success 'prompt - hide if pwd ignored - env var unset, config unset' ' - printf " (master)" >expected && + printf " (main)" >expected && ( cd ignored_dir && __git_ps1 >"$actual"
@@ -704,7 +704,7 @@ test_expect_success 'prompt - hide if pwd ignored - env var unset, config unset, ' test_expect_success 'prompt - hide if pwd ignored - env var set, config disabled' ' - printf " (master)" >expected && + printf " (main)" >expected && test_config bash.hideIfPwdIgnored false && ( cd ignored_dir &&
t/test-lib.sh +2 -2
@@ -257,13 +257,13 @@ case "$TRASH_DIRECTORY" in esac case "$TEST_NUMBER" in -3404|4013|5310|6300|7064|7817) +3404|4013|5310|6300|7064|7817|9902) # Avoid conflicts with patch series that are cooking at the same time # as the patch series changing the default of `init.defaultBranch`. GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME ;; -[0-8]*|9[0-8]*) +*) GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME ;;
Signature · 1 line
gitgitgadget
PATCH 27/28 tests: drop prereq `PREPARE_FOR_MAIN_BRANCH` where no longer needed
In reply to Johannes Schindelin via GitGitGadgetFrom: Johannes Schindelin <[email protected]>
We introduced the PREPARE_FOR_MAIN_BRANCH prereq for the sole purpose of allowing us to perform the non-trivial adjustments regarding the master -> main rename before the automatable ones.
Now that the transition is almost complete, we can stop using it in most instances. The only exception is t9902: at the time of writing, there are other patches in flight that touch this test script, therefore the transition to main is postponed to a later date.
This patch is the result of this command:
sed -i 's/PREPARE_FOR_MAIN_BRANCH[ ,]//' t/t[0-9]*.sh && git checkout HEAD -- t/t9902\*
--- t/t1400-update-ref.sh | 4 +-- t/t3200-branch.sh | 6 ++--- t/t3201-branch-contains.sh | 2 +- t/t3203-branch-output.sh | 2 +- t/t3205-branch-color.sh | 2 +- t/t5505-remote.sh | 8 +++--- t/t5510-fetch.sh | 4 +-- t/t5526-fetch-submodules.sh | 42 +++++++++++++++--------------- t/t5703-upload-pack-ref-in-want.sh | 2 +- t/t6302-for-each-ref-filter.sh | 12 ++++----- 10 files changed, 42 insertions(+), 42 deletions(-)
t/t1400-update-ref.sh +2 -2
@@ -585,7 +585,7 @@ test_expect_success 'stdin fails on unbalanced quotes' ' grep "fatal: badly quoted argument: \\\"main" err ' -test_expect_success PREPARE_FOR_MAIN_BRANCH 'stdin fails on invalid escape' ' +test_expect_success 'stdin fails on invalid escape' ' echo "create $a \"ma\zn\"" >stdin && test_must_fail git update-ref --stdin <stdin 2>err && grep "fatal: badly quoted argument: \\\"ma\\\\zn\\\"" err
@@ -704,7 +704,7 @@ test_expect_success 'stdin succeeds with quoted argument' ' test_cmp expect actual ' -test_expect_success PREPARE_FOR_MAIN_BRANCH 'stdin succeeds with escaped character' ' +test_expect_success 'stdin succeeds with escaped character' ' git update-ref -d $a && echo "create $a \"ma\\151n\"" >stdin && git update-ref --stdin <stdin &&
t/t3200-branch.sh +3 -3
@@ -321,7 +321,7 @@ test_expect_success 'git branch --list -v with --abbrev' ' ' -test_expect_success PREPARE_FOR_MAIN_BRANCH 'git branch --column' ' +test_expect_success 'git branch --column' ' COLUMNS=81 git branch --column=column >actual && cat >expect <<\EOF && a/b/c bam foo l * main n o/p r
@@ -358,7 +358,7 @@ EOF test_cmp expect actual ' -test_expect_success PREPARE_FOR_MAIN_BRANCH 'git branch with column.*' ' +test_expect_success 'git branch with column.*' ' git config column.ui column && git config column.branch "dense" && COLUMNS=80 git branch >actual &&
@@ -375,7 +375,7 @@ test_expect_success 'git branch --column -v should fail' ' test_must_fail git branch --column -v ' -test_expect_success PREPARE_FOR_MAIN_BRANCH 'git branch -v with column.ui ignored' ' +test_expect_success 'git branch -v with column.ui ignored' ' git config column.ui column && COLUMNS=80 git branch -v | cut -c -8 | sed "s/ *$//" >actual && git config --unset column.ui &&
t/t3201-branch-contains.sh +1 -1
@@ -242,7 +242,7 @@ test_expect_success 'branch --merged combined with --no-merged' ' # Here "topic" tracks "main" with one extra commit, and "zzz" points to the # same tip as main The name "zzz" must come alphabetically after "topic" # as we process them in that order. -test_expect_success PREPARE_FOR_MAIN_BRANCH 'branch --merged with --verbose' ' +test_expect_success 'branch --merged with --verbose' ' git branch --track topic main && git branch zzz topic && git checkout topic &&
t/t3203-branch-output.sh +1 -1
@@ -329,7 +329,7 @@ test_expect_success '--color overrides auto-color' ' test_cmp expect.color actual ' -test_expect_success PREPARE_FOR_MAIN_BRANCH 'verbose output lists worktree path' ' +test_expect_success 'verbose output lists worktree path' ' one=$(git rev-parse --short HEAD) && two=$(git rev-parse --short main) && cat >expect <<-EOF &&
t/t3205-branch-color.sh +1 -1
@@ -28,7 +28,7 @@ test_expect_success 'regular output shows colors' ' test_cmp expect actual ' -test_expect_success PREPARE_FOR_MAIN_BRANCH 'verbose output shows colors' ' +test_expect_success 'verbose output shows colors' ' oid=$(git rev-parse --short HEAD) && cat >expect <<-EOF && * <CYAN>main <RESET> $oid foo
t/t5505-remote.sh +4 -4
@@ -234,7 +234,7 @@ cat >test/expect <<EOF main pushes to another (up to date) EOF -test_expect_success PREPARE_FOR_MAIN_BRANCH 'show' ' +test_expect_success 'show' ' ( cd test && git config --add remote.origin.fetch refs/heads/main:refs/heads/upstream &&
@@ -285,7 +285,7 @@ cat >test/expect <<EOF refs/tags/lastbackup forces to refs/tags/lastbackup EOF -test_expect_success PREPARE_FOR_MAIN_BRANCH 'show -n' ' +test_expect_success 'show -n' ' mv one one.unreachable && ( cd test &&
@@ -328,7 +328,7 @@ test_expect_success 'set-head --auto' ' ) ' -test_expect_success PREPARE_FOR_MAIN_BRANCH 'set-head --auto has no problem w/multiple HEADs' ' +test_expect_success 'set-head --auto has no problem w/multiple HEADs' ' ( cd test && git fetch two "refs/heads/*:refs/remotes/two/*" &&
@@ -1348,7 +1348,7 @@ test_expect_success 'unqualified <dst> refspec DWIM and advice' ' ) ' -test_expect_success PREPARE_FOR_MAIN_BRANCH 'refs/remotes/* <src> refspec and unqualified <dst> DWIM and advice' ' +test_expect_success 'refs/remotes/* <src> refspec and unqualified <dst> DWIM and advice' ' ( cd two && git tag -a -m "Some tag" my-tag main &&
t/t5510-fetch.sh +2 -2
@@ -942,7 +942,7 @@ test_expect_success 'fetching with auto-gc does not lock up' ' ) ' -test_expect_success PREPARE_FOR_MAIN_BRANCH,C_LOCALE_OUTPUT 'fetch aligned output' ' +test_expect_success C_LOCALE_OUTPUT 'fetch aligned output' ' git clone . full-output && test_commit looooooooooooong-tag && (
@@ -957,7 +957,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH,C_LOCALE_OUTPUT 'fetch aligned outpu test_cmp expect actual ' -test_expect_success PREPARE_FOR_MAIN_BRANCH,C_LOCALE_OUTPUT 'fetch compact output' ' +test_expect_success C_LOCALE_OUTPUT 'fetch compact output' ' git clone . compact && test_commit extraaa && (
t/t5526-fetch-submodules.sh +21 -21
168 lines not on this page · raw message
t/t5703-upload-pack-ref-in-want.sh +1 -1
@@ -383,7 +383,7 @@ test_expect_success 'server is initially behind - ref in want' ' test_cmp expected actual ' -test_expect_success PREPARE_FOR_MAIN_BRANCH 'server loses a ref - ref in want' ' +test_expect_success 'server loses a ref - ref in want' ' git -C "$REPO" config uploadpack.allowRefInWant true && rm -rf local && cp -r "$LOCAL_PRISTINE" local &&
t/t6302-for-each-ref-filter.sh +6 -6
@@ -113,7 +113,7 @@ test_expect_success '%(color) must fail' ' test_must_fail git for-each-ref --format="%(color)%(refname)" ' -test_expect_success PREPARE_FOR_MAIN_BRANCH 'left alignment is default' ' +test_expect_success 'left alignment is default' ' cat >expect <<-\EOF && refname is refs/heads/main |refs/heads/main refname is refs/heads/side |refs/heads/side
@@ -131,7 +131,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'left alignment is default' ' test_cmp expect actual ' -test_expect_success PREPARE_FOR_MAIN_BRANCH 'middle alignment' ' +test_expect_success 'middle alignment' ' cat >expect <<-\EOF && | refname is refs/heads/main |refs/heads/main | refname is refs/heads/side |refs/heads/side
@@ -149,7 +149,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'middle alignment' ' test_cmp expect actual ' -test_expect_success PREPARE_FOR_MAIN_BRANCH 'right alignment' ' +test_expect_success 'right alignment' ' cat >expect <<-\EOF && | refname is refs/heads/main|refs/heads/main | refname is refs/heads/side|refs/heads/side
@@ -184,7 +184,7 @@ EOF test_align_permutations() { while read -r option do - test_expect_success PREPARE_FOR_MAIN_BRANCH "align:$option" ' + test_expect_success "align:$option" ' git for-each-ref --format="|%(align:$option)refname is %(refname)%(end)|%(refname)" >actual && test_cmp expect actual '
@@ -213,7 +213,7 @@ EOF # Individual atoms inside %(align:...) and %(end) must not be quoted. -test_expect_success PREPARE_FOR_MAIN_BRANCH 'alignment with format quote' " +test_expect_success 'alignment with format quote' " cat >expect <<-\EOF && |' '\''main| A U Thor'\'' '| |' '\''side| A U Thor'\'' '|
@@ -231,7 +231,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'alignment with format quote' " test_cmp expect actual " -test_expect_success PREPARE_FOR_MAIN_BRANCH 'nested alignment with quote formatting' " +test_expect_success 'nested alignment with quote formatting' " cat >expect <<-\EOF && |' main '| |' side '|
Signature · 1 line
gitgitgadget
PATCH 28/28 Change the default branch name to `main`
In reply to Johannes Schindelin via GitGitGadgetFrom: Don Goodman-Wilson <[email protected]>
The current default name for the initial branch is a loaded term, and many Open Source projects renamed their principal branches already. A common choice appears to be main.
Let's follow their lead and change the default of init.defaultBranch.
--- refs.c | 2 +- t/lib-submodule-update.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
refs.c +1 -1
@@ -575,7 +575,7 @@ char *repo_default_branch_name(struct repository *r)die (_ ("could not retrieve `%s`" ), config_display_key);if (!ret) - ret =xstrdup ("master" ); + ret =xstrdup ("main" ); full_ref =xstrfmt ("refs/heads/%s" , ret);if (check_refname_format (full_ref,0 ))
t/lib-submodule-update.sh +1 -1
@@ -144,7 +144,7 @@ create_lib_submodule_repo () { git checkout -b valid_sub1 && git revert HEAD && - git checkout "${GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME-master}" + git checkout "${GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME-main}" ) }
Signature · 1 line
gitgitgadget
Re: [PATCH 28/28] Change the default branch name to `main`
Quoted 5 lines · Don Goodman-Wilson via GitGitGadget
The current default name for the initial branch is a loaded term, and many Open Source projects renamed their principal branches already. A common choice appears to be
main.Let's follow their lead and change the default of
init.defaultBranch.
I think it makes sense to split this change off from a 28-series test cleanup series.
t/lib-submodule-update.sh create_lib_submodule_repo () { · line 147
Quoted 10 lines
t/lib-submodule-update.sh +1
-1@@ -144,7 +144,7 @@ create_lib_submodule_repo () { git checkout -b valid_sub1 && git revert HEAD && - git checkout "${GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME-master}" + git checkout "${GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME-main}"
Earlier in that function we're doing a "git init". With all this test cleanup I wonder why not just "git rev-parse --abbrev-ref" to get the default name, instead of carrying the hardcoding forward.
Re: [PATCH 28/28] Change the default branch name to `main`
Hi Ævar,
Quoted 11 lines · Ævar Arnfjörð Bjarmason
Quoted 5 lines · Don Goodman-Wilson via GitGitGadget
The current default name for the initial branch is a loaded term, and many Open Source projects renamed their principal branches already. A common choice appears to be
main.Let's follow their lead and change the default of
init.defaultBranch.I think it makes sense to split this change off from a 28-series test cleanup series.
It is not a test cleanup. It is a series of 27 patches preparing the test suite for the change made in the 28th patch.
I don't think that it is a good idea to split off that 28th patch from the patches whose entire purpose is to prepare for that 28th patch.
Quoted 9 lines
Quoted 9 lines
t/lib-submodule-update.sh +0
-0@@ -144,7 +144,7 @@ create_lib_submodule_repo () { git checkout -b valid_sub1 && git revert HEAD &&
Quoted 6 lines
t/lib-submodule-update.sh create_lib_submodule_repo () { · line 147
Quoted 2 lines
t/lib-submodule-update.sh +1
-1- git checkout "${GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME-master}" + git checkout "${GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME-main}"Earlier in that function we're doing a "git init". With all this test cleanup I wonder why not just "git rev-parse --abbrev-ref" to get the default name, instead of carrying the hardcoding forward.
My goal was to keep everything as close to its original as possible. In v2.29.2, this line reads:
git checkout master
See https://github.com/git/git/blob/v2.29.2/t/lib-submodule-update.sh#L147
to convince yourself.
Personally, I would have used something like
main=$(git symbolic-ref --short HEAD) && [...] git checkout $main
instead of what you suggested. That's a topic for another patch (series), though.
Ciao,
Dscho
Re: [PATCH 28/28] Change the default branch name to `main`
Quoted 13 lines · Johannes Schindelin
Hi Ævar,
Quoted 9 lines · Ævar Arnfjörð Bjarmason
Quoted 5 lines · Don Goodman-Wilson via GitGitGadget
The current default name for the initial branch is a loaded term, and many Open Source projects renamed their principal branches already. A common choice appears to be
main.Let's follow their lead and change the default of
init.defaultBranch.
Quoted 8 lines
Quoted 2 lines
I think it makes sense to split this change off from a 28-series test cleanup series.
It is not a test cleanup. It is a series of 27 patches preparing the test suite for the change made in the 28th patch.
I don't think that it is a good idea to split off that 28th patch from the patches whose entire purpose is to prepare for that 28th patch.
Well, I personally think that the "purpose" of the first 27 patches must be updated if that is the case.
The test should NOT be prepared only to work in the post "switch from master to main" world.
Instead, what we want to see is that the test would work whether the fallback default value for init.defaultBranch is 'master' (i.e. old world) or 'main (i.e. a possible new world). Perhaps by using the GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME mechanism for tests that relies on a particular value to be the fallback default. So in the sense, the goal the first 26 patches support is the 27th one, which is the most important one in the series from _my_ point of view. We get ourselves prepared so that 28th one can happen at any time.
That way, as long as the first 27 patches land, we will keep the same test coverage as we've always had, regardless of the timing we actually ship the 28th one to the production environment.
Quoted 8 lines
Personally, I would have used something like
main=$(git symbolic-ref --short HEAD) && [...] git checkout $maininstead of what you suggested. That's a topic for another patch (series), though.
Yeah, I would have used $primary or some word that is neither these m* names, but I think that is a good alternative, when workable, to the GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME mechanism. When the golden master compared with actual output hardcodes the expected branch names, however, the approach becomes awkward, though.
Thanks.
Quoted 3 lines · Johannes Schindelin via GitGitGadget
This is the big one. This changes the default of init.defaultBranch to main, reflecting what many open source projects already did (which was followed by GitHub, Azure Repos and others).
I want to plant a big red flag here for the record.
I am against this change.
At the very least in the manner it is being made. I started a separate thread [1] explaining the reasoning.
In addition to the manner--which I argue in that other thread should be done for Git 3.0--I also object to the reasoning behind the change.
Let me know if you would rather hear my arguments against the reasoning here, or in the other thread.
Cheers.
[1] https://lore.kernel.org/git/CAMP44s3BJ3dGsLJ-6yA-Po459=+m826KD9an4+P3qOY1vkbxZg@mail.gmail.com/
Signature · 1 line
Felipe Contreras
Quoted 3 lines · Johannes Schindelin via GitGitGadget
This is the big one. This changes the default of init.defaultBranch to main, reflecting what many open source projects already did (which was followed by GitHub, Azure Repos and others).
I don't have an issue with the end goal of s/master/main|$whatever/ as UX here as noted in previous related review rounds. But I don't think this series as it stands is anywhere near ready.
This is 27 patches of s/master/main/ in the tests, followed by making the change to the default in refs.c without as much as a single documentation update to inform users of the change.
I don't see the point in doing these sorts of test suite changes, it just seems like needless churn. But I have not read the whole backlog of previous iterations of this & related patches, so bear with me.
Why not instead do what we did when we added protocol v2 to the tests, e.g. in 8a1b0978ab ("test: request GIT_TEST_PROTOCOL_VERSION=0 when appropriate", 2019-12-23) we simply set the t5515 test to always run with protocol v1. If you'd do this:
diff --git a/t/t5515-fetch-merge-logic.sh b/t/t5515-fetch-merge-logic.sh
index 70a9d2d8ab..939c8b2f83 100755
--- a/t/t5515-fetch-merge-logic.sh
+++ b/t/t5515-fetch-merge-logic.sh
@@ -11,6 +11,9 @@ test_description='Merge logic in fetch'
GIT_TEST_PROTOCOL_VERSION=0
export GIT_TEST_PROTOCOL_VERSION
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
. ./test-lib.sh
build_script () {Of course that also needs:
index fa347ed3e1..2d700a171b 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -1711,10 +1711,8 @@ test_lazy_prereq SHA1 '
test_lazy_prereq REBASE_P '
test -z "$GIT_TEST_SKIP_REBASE_P"
'
-# Special-purpose prereq for transitioning to a new default branch name:
-# Some tests need more than just a mindless (case-preserving) s/master/main/g -# replacement. The non-trivial adjustments are guarded behind this -# prerequisite, acting kind of as a feature flag -test_lazy_prereq PREPARE_FOR_MAIN_BRANCH '
- test "$GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME" = main
+
+test_lazy_prereq MAIN_BRANCH_IS_MASTER '
+ test -z "$GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME" ||
+ test "$GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME" = "master"
'
Because (but see "later" a few paragraphs later), the logic as it stands on "master" is entirely backwards & broken. I.e. if you don't set GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME or set it to "master" we now skip a bunch of tests ... which only work if the value is "master". If you set it to "main" they'll break.
Then instead of ending up with a hardcoding of "main" we'd be able to run the tests with a new custom branch name (even one with whitespace in it). That coverage is plenty to test any branch name hardcoding.
The remaining tests that would still have "master" would then just be dealt with by the same thing we did for the too-protocol-v1-specific tests, i.e.:
diff --git a/t/t3502-cherry-pick-merge.sh b/t/t3502-cherry-pick-merge.sh
index 8b635a196d..354f9bd851 100755
--- a/t/t3502-cherry-pick-merge.sh
+++ b/t/t3502-cherry-pick-merge.sh
@@ -8,6 +8,8 @@ test_description='cherry picking and reverting a merge
'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh
test_expect_success setup 'Except unlike protocol v1/v2 we're really not gaining anything in coverage by going further, it's not the point of any of these tests to test for the default branch name. It's a *lot* of churn,
"Later": After writing the above I see from 704fed9ea2 ("tests: start moving to a different default main branch name", 2020-10-23) that this state of affairs is intentional. But doesn't discuss why the more usual (because we've done it that way a few times before) v1/v2-esque transition wasn't done instead.
Doing it the other way still seems better. We're now not running our full tests in anticipation for this series landing on "master", and after applying this we're still not running all of them.
Anyway, enough with discussing this detail of the test suite churn. My main objection to this version of it is:
After this series as it stands lands what's a rather big UI change in git isn't discussed *anywhere* in the docs.
I'm not saying we need some similar s/master/main/g in Documentation/ as what's being done here in t/, but I think a bare minimum for a rather big UI change like this is:
1) Let's at least talk about it in some way in git-init(1), i.e. that it used to be "master" before version so-and-so and is now different. With this series applied we still say:
Documentation/git-init.txt:If not specified, fall back to the default name: master.
2) Ditto in the init.defaultBranch and things like that
3) After all this effort at eliminating "master" entirely in the tests we're still shipping a sample hook that expects "master" on "git init", and breaks now that it's "main"
And maybe stuff like:
4) Have "git init" emit some new advice message saying that the default has changed and we've init-ed a new repo with a "main" branch.
Our primary concern should be the vast majority of users who don't follow this topic on Twitter, don't read this mailing list, and are just going to waste 10 minutes of their day because some script they've had working for years using "git init" did something unexpected.
Let's at least aim to make that 5 minutes instead by making the change more discoverable.
Hi Ævar,
Quoted 6 lines · Ævar Arnfjörð Bjarmason
Quoted 3 lines · Johannes Schindelin via GitGitGadget
This is the big one. This changes the default of init.defaultBranch to main, reflecting what many open source projects already did (which was followed by GitHub, Azure Repos and others).
Quoted 7 lines
I don't have an issue with the end goal of s/master/main|$whatever/ as UX here as noted in previous related review rounds. But I don't think this series as it stands is anywhere near ready.
This is 27 patches of s/master/main/ in the tests, followed by making the change to the default in
refs.cwithout as much as a single documentation update to inform users of the change.
Of course, this is _the one_ patch series mentioned in
https://github.com/gitgitgadget/git/pull/655 that does _not_ link back to the meta-PR.
So you're right, on its own, these 28 patches do not make sense.
And if you split off the 28th patch, the remaining 27 patches make even less sense.
The reason why I partitioned the changes this way was that it is a _ton_ of patches to review, and in many ways, these 28 patches are the most important ones to review (I didn't want to just rely on the CI builds passing, I reviewed those patches carefully, multiple times, to make sure that they made sense in the goal to transition to main).
I will respond to the rest of your concerns later, Dscho
Quoted 123 lines
I don't see the point in doing these sorts of test suite changes, it just seems like needless churn. But I have not read the whole backlog of previous iterations of this & related patches, so bear with me.
Why not instead do what we did when we added protocol v2 to the tests, e.g. in
8a1b0978ab("test: request GIT_TEST_PROTOCOL_VERSION=0 when appropriate", 2019-12-23) we simply set the t5515 test to always run with protocol v1. If you'd do this:diff --git a/t/t5515-fetch-merge-logic.sh b/t/t5515-fetch-merge-logic.sh index 70a9d2d8ab..939c8b2f83 100755 --- a/t/t5515-fetch-merge-logic.sh +++ b/t/t5515-fetch-merge-logic.sh @@ -11,6 +11,9 @@ test_description='Merge logic in fetch' GIT_TEST_PROTOCOL_VERSION=0 export GIT_TEST_PROTOCOL_VERSION +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh build_script () {Of course that also needs:
index
fa347ed3e1..2d700a171b100644
---a/t/test-lib.sh
+++b/t/test-lib.sh
@@ -1711,10 +1711,8 @@test_lazy_prereqSHA1 '
test_lazy_prereqREBASE_P'
test -z "$GIT_TEST_SKIP_REBASE_P"
'
-# Special-purpose prereq for transitioning to a new default branch name:
-# Some tests need more than just a mindless (case-preserving) s/master/main/g -# replacement. The non-trivial adjustments are guarded behind this -# prerequisite, acting kind of as a feature flag -test_lazy_prereqPREPARE_FOR_MAIN_BRANCH'
- test "$GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME" = main
+
+test_lazy_prereqMAIN_BRANCH_IS_MASTER'
+ test -z "$GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME" ||
+ test "$GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME" = "master"
'Because (but see "later" a few paragraphs later), the logic as it stands on "master" is entirely backwards & broken. I.e. if you don't set
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAMEor set it to "master" we now skip a bunch of tests ... which only work if the value is "master". If you set it to "main" they'll break.Then instead of ending up with a hardcoding of "main" we'd be able to run the tests with a new custom branch name (even one with whitespace in it). That coverage is plenty to test any branch name hardcoding.
The remaining tests that would still have "master" would then just be dealt with by the same thing we did for the too-protocol-v1-specific tests, i.e.:
diff --git a/t/t3502-cherry-pick-merge.sh b/t/t3502-cherry-pick-merge.sh index 8b635a196d..354f9bd851 100755 --- a/t/t3502-cherry-pick-merge.sh +++ b/t/t3502-cherry-pick-merge.sh @@ -8,6 +8,8 @@ test_description='cherry picking and reverting a merge ' +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME . ./test-lib.sh test_expect_success setup 'Except unlike protocol v1/v2 we're really not gaining anything in coverage by going further, it's not the point of any of these tests to test for the default branch name. It's a *lot* of churn,
"Later": After writing the above I see from
704fed9ea2("tests: start moving to a different default main branch name", 2020-10-23) that this state of affairs is intentional. But doesn't discuss why the more usual (because we've done it that way a few times before) v1/v2-esque transition wasn't done instead.Doing it the other way still seems better. We're now not running our full tests in anticipation for this series landing on "master", and after applying this we're still not running all of them.
Anyway, enough with discussing this detail of the test suite churn. My main objection to this version of it is:
After this series as it stands lands what's a rather big UI change in git isn't discussed *anywhere* in the docs.
I'm not saying we need some similar s/master/main/g in
Documentation/as what's being done here in t/, but I think a bare minimum for a rather big UI change like this is:1) Let's at least talk about it in some way in git-init(1), i.e. that it used to be "master" before version so-and-so and is now different. With this series applied we still say:
Documentation/git-init.txt:If not specified, fall back to the default name:
master.2) Ditto in the init.defaultBranch and things like that
3) After all this effort at eliminating "master" entirely in the tests we're still shipping a sample hook that expects "master" on "git init", and breaks now that it's "main"
And maybe stuff like:
4) Have "git init" emit some new advice message saying that the default has changed and we've init-ed a new repo with a "main" branch.
Our primary concern should be the vast majority of users who don't follow this topic on Twitter, don't read this mailing list, and are just going to waste 10 minutes of their day because some script they've had working for years using "git init" did something unexpected.
Let's at least aim to make that 5 minutes instead by making the change more discoverable.
[RFC/PATCH] tests: support testing with an arbitrary default branch (sort of)
Since 704fed9ea2 ("tests: start moving to a different default main branch name", 2020-10-23) we've been needlessly skipping tests if the branch is "master" in preparation for an eventual switch to another name.
As I noted in [1] I don't see why we shouldn't be doing a more graceful approach here where we don't start skipping unrelated tests just because some s/master/main/g changes are in flight.
Furthermore the seeming goal of eliminating the string "master" from anywhere in git's sources results in needless patch churn, and has nothing to do with the goal of changing the branch name in the UX.
This patch demonstrates that things could be much simpler if we don't set ourselves that requirement. Now we:
* Can set GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=<some-name>, but this no longer overrides config, so it behaves like other GIT_TEST_* variables.
* Have a test-tool helper that gives us refs.c's idea of the main branch name to share the logic between the tests and the main C code.
* A lot of tests (but a small minority of the total) have master "master" hardcoded in some way. We now inventory them in tests-that-need-master.txt, we can still remove the names from that file and manually change the code later, but this accomplishes a clean test run with a relatively easy-to-review diff.
We ignore GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=<name> when it comes to these files, unless GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME_HARDER=true is set.
* The changes to t5515-fetch-merge-logic.sh and t5560-http-backend-noserver.sh show how much easier it is to just punt on certain tests. In these tests that heavily rely on the "master" name (not inherently, it's just hardcoded in a lot of places) we just give up and keep using "master".
1. https://lore.kernel.org/git/[email protected]/
---
I need to walk away from the computer now, but this is an RFC of what I was commenting on upthread.
Makefile | 1 + config.c | 10 + config.h | 1 + refs.c | 7 +- t/helper/test-default-branch-name.c | 16 ++ t/helper/test-tool.c | 1 + t/helper/test-tool.h | 1 + t/t0001-init.sh | 2 +- t/t5515-fetch-merge-logic.sh | 3 + t/t5560-http-backend-noserver.sh | 4 + t/test-lib.sh | 27 ++- t/tests-that-need-master.txt | 343 ++++++++++++++++++++++++++++ 12 files changed, 403 insertions(+), 13 deletions(-) create mode 100644 t/helper/test-default-branch-name.c create mode 100644 t/tests-that-need-master.txt
Makefile +1 -0
@@ -696,6 +696,7 @@ TEST_BUILTINS_OBJS += test-chmtime.o TEST_BUILTINS_OBJS += test-config.o TEST_BUILTINS_OBJS += test-ctype.o TEST_BUILTINS_OBJS += test-date.o +TEST_BUILTINS_OBJS += test-default-branch-name.o TEST_BUILTINS_OBJS += test-delta.o TEST_BUILTINS_OBJS += test-dir-iterator.o TEST_BUILTINS_OBJS += test-drop-caches.o
config.c +10 -0
@@ -1706,6 +1706,16 @@ unsigned long git_env_ulong(const char *k, unsigned long val)return val; } +/* +* Parse environment variable 'k' as a char *; if missing, use the +* default value 'def'. +*/ +const char *git_env_str (const char *k,const char *def) +{ +const char *v =getenv (k); +return v &&strlen (v) ? v : def; +} +int git_config_system (void ) {return !git_env_bool ("GIT_CONFIG_NOSYSTEM" ,0 );
config.h +1 -0
@@ -298,6 +298,7 @@ int git_config_copy_section_in_file(const char *, const char *, const char *);const char *git_etc_gitconfig (void );int git_env_bool (const char *,int );unsigned long git_env_ulong (const char *,unsigned long ); +const char *git_env_str (const char *,const char *);int git_config_system (void );int config_error_nonbool (const char *);#if defined(__GNUC__)
refs.c +2 -5
@@ -567,15 +567,12 @@ char *repo_default_branch_name(struct repository *r)const char *config_key ="init.defaultbranch" ;const char *config_display_key ="init.defaultBranch" ;char *ret =NULL , *full_ref; -const char *env =getenv ("GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME" ); -if (env && *env) - ret =xstrdup (env); -else if (repo_config_get_string (r, config_key, &ret) <0 ) +if (repo_config_get_string (r, config_key, &ret) <0 )die (_ ("could not retrieve `%s`" ), config_display_key);if (!ret) - ret =xstrdup ("master" ); + ret =xstrdup (git_env_str ("GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME" ,"master" )); full_ref =xstrfmt ("refs/heads/%s" , ret);if (check_refname_format (full_ref,0 ))
t/helper/test-default-branch-name.c new file +16 -0
@@ -0,0 +1,16 @@ +#include "test-tool.h" +#include "git-compat-util.h" +#include "refs.h" + +/* +* usage: +* tool-test default-branch-name +*/ +int cmd__default_branch_name (int argc,const char **argv) +{ +const char *name =git_default_branch_name (); + +puts (name); + +return 0 ; +}
t/helper/test-tool.c +1 -0
@@ -21,6 +21,7 @@ static struct test_cmd cmds[] = { { "ctype", cmd__ctype }, { "date", cmd__date }, { "delta", cmd__delta }, + { "default-branch-name", cmd__default_branch_name }, { "dir-iterator", cmd__dir_iterator }, { "drop-caches", cmd__drop_caches }, { "dump-cache-tree", cmd__dump_cache_tree },
t/helper/test-tool.h +1 -0
@@ -10,6 +10,7 @@ int cmd__chmtime(int argc, const char **argv);int cmd__config (int argc,const char **argv);int cmd__ctype (int argc,const char **argv);int cmd__date (int argc,const char **argv); +int cmd__default_branch_name (int argc,const char **argv);int cmd__delta (int argc,const char **argv);int cmd__dir_iterator (int argc,const char **argv);int cmd__drop_caches (int argc,const char **argv);
t/t0001-init.sh +1 -1
@@ -562,7 +562,7 @@ test_expect_success 'overridden default main branch name (env)' ' test_config_global init.defaultBranch nmb && GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=env git init main-branch-env && git -C main-branch-env symbolic-ref HEAD >actual && - grep env actual + grep nmb actual ' test_expect_success 'invalid default branch name' '
t/t5515-fetch-merge-logic.sh +3 -0
@@ -11,6 +11,9 @@ test_description='Merge logic in fetch' GIT_TEST_PROTOCOL_VERSION=0 export GIT_TEST_PROTOCOL_VERSION +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh build_script () {
t/t5560-http-backend-noserver.sh +4 -0
@@ -1,6 +1,10 @@ #!/bin/sh test_description='test git-http-backend-noserver' + +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + . ./test-lib.sh HTTPD_DOCUMENT_ROOT_PATH="$TRASH_DIRECTORY"
t/test-lib.sh +20 -7
@@ -1382,6 +1382,26 @@ HOME="$TRASH_DIRECTORY" GNUPGHOME="$HOME/gnupg-home-not-used" export HOME GNUPGHOME +# Check if we're doing tests with the main branch != master, and if +# we'd like to override that for known-broken tests. +GIT_TEST_MAIN=$(test-tool default-branch-name) +if test "$GIT_TEST_MAIN" = "master" +then + test_set_prereq MAIN_BRANCH_IS_MASTER +else + if test -z "$GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME_HARDER" && + grep -q $TEST_NAME "$TEST_DIRECTORY/tests-that-need-master.txt" + then + echo overriding + GIT_TEST_MAIN=master + GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master + test_set_prereq MAIN_BRANCH_IS_MASTER + fi +fi +export GIT_TEST_MAIN +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + +# Initialize the repository after we know the main branch name. if test -z "$TEST_NO_CREATE_REPO" then test_create_repo "$TRASH_DIRECTORY"
@@ -1711,10 +1731,3 @@ test_lazy_prereq SHA1 ' test_lazy_prereq REBASE_P ' test -z "$GIT_TEST_SKIP_REBASE_P" ' -# Special-purpose prereq for transitioning to a new default branch name: -# Some tests need more than just a mindless (case-preserving) s/master/main/g -# replacement. The non-trivial adjustments are guarded behind this -# prerequisite, acting kind of as a feature flag -test_lazy_prereq PREPARE_FOR_MAIN_BRANCH ' - test "$GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME" = main -'
t/tests-that-need-master.txt new file +343 -0
343 lines not on this page · raw message
Signature · 1 line
2.29.2.222.g5d2a92d10f8
Re: [RFC/PATCH] tests: support testing with an arbitrary default branch (sort of)
Quoted 9 lines · Ævar Arnfjörð Bjarmason
* A lot of tests (but a small minority of the total) have master "master" hardcoded in some way. We now inventory them in tests-that-need-master.txt, we can still remove the names from that file and manually change the code later, but this accomplishes a clean test run with a relatively easy-to-review diff.
We ignore GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=<name> when it comes to these files, unless GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME_HARDER=true is set.
I'm confused how this is better. We could just be setting GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME at the top of those files, couldn't we? (Likewise, I think annotating individual scripts is more decentralized than a magic pattern in test-lib.sh, though it amounts to the same thing).
And if I understand the current state of Dscho's patches, we don't _have_ to convert any tests right now. We could just annotate those scripts which are not yet converted to have them use the old name.
But I don't think we want to live in that state indefinitely. It's slightly annoying to have inconsistent naming within the tests. I'd be happy to switch individual tests at a leisurely pace over the next couple of months or whatever. But since Dscho has bothered to write all of the patches now, why not use them?
I'm much more concerned about the lack of documentation changes associated with the final patch. We don't necessarily need to eradicate every mention of "master" from the documentation, but I think we do need to make sure that examples and instructions are consistent with how Git will actually behave. And that does need to happen at the same time as the user-visible flip of the default.
I'm on the fence whether there should be a deprecation period or major version bump for the final patch, but making the tests flexible enough to handle the before and after state seems like it can be done uncoupled from the actual default-flip.
-Peff
Re: [RFC/PATCH] tests: support testing with an arbitrary default branch (sort of)
Hi Peff and Ævar,
Quoted 12 lines · Jeff King
Quoted 9 lines · Ævar Arnfjörð Bjarmason
* A lot of tests (but a small minority of the total) have master "master" hardcoded in some way. We now inventory them in tests-that-need-master.txt, we can still remove the names from that file and manually change the code later, but this accomplishes a clean test run with a relatively easy-to-review diff.
We ignore GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=<name> when it comes to these files, unless GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME_HARDER=true is set.
Quoted 5 lines
I'm confused how this is better. We could just be setting
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAMEat the top of those files, couldn't we? (Likewise, I think annotating individual scripts is more decentralized than a magic pattern intest-lib.sh, though it amounts to the same thing).
I considered this alternative very briefly, and rejected it immediately because it would have implied a drawn-out limbo where the test suite will be inconsistent. That's not what I want.
Quoted 3 lines
And if I understand the current state of Dscho's patches, we don't _have_ to convert any tests right now. We could just annotate those scripts which are not yet converted to have them use the old name.
And that's what I did in some cases, see e.g. 5d5f4ea30de (t5411: finish preparing for main being the default branch name, 2020-10-31).
It's just quite a ton of work to do this for all the affected test scripts, and I wanted to automate as much as possible of that process so that it'll be easier to cope with all the other topics that are in flight.
Therefore, I opted to "annotate the scripts" via a case in test-lib.sh. It should be quite a bit easier to understand, too, for the occasional reader, as it shows you the complete range of scripts that have been handled so far.
Quoted 5 lines
But I don't think we want to live in that state indefinitely. It's slightly annoying to have inconsistent naming within the tests. I'd be happy to switch individual tests at a leisurely pace over the next couple of months or whatever. But since Dscho has bothered to write all of the patches now, why not use them?
Yep, I am a bit puzzled why we need to consider other approaches. I would have thought that the more pressing issue is to verify that I
1) caught all the necessary conversions,
2) did not miss any non-trivial adjustments (such as naster and aligned comments).
At the same time, I am quite thankful for all the help Ævar provided; mentioning that I missed naster in t1400 was definitely super helpful.
Quoted 6 lines
I'm much more concerned about the lack of documentation changes associated with the final patch. We don't necessarily need to eradicate every mention of "master" from the documentation, but I think we do need to make sure that examples and instructions are consistent with how Git will actually behave. And that does need to happen at the same time as the user-visible flip of the default.
I am sorry. This is totally my fault. I should have described this much better in the cover letter. This patch series deliberately omits all the documentation changes.
I _did_ prepare them, they are pretty much ready-to-go, as part of the inclusive-naming branch I track in
https://github.com/gitgitgadget/git/pull/655 (I use the branch name use-main-as-default-branch-name-docs in the inclusive-naming branch thicket to track the documentation changes).
The decision to separate them out into their own patch series was made consciously, to avoid having one big, honking, totally unreviewably large patch series.
Therefore, just like I fed the preparatory patch series in a slow cadence, I planned on feeding the -docs patch series once the dust settles on this patch series (i.e. once it hits next).
Quoted 4 lines
I'm on the fence whether there should be a deprecation period or major version bump for the final patch, but making the tests flexible enough to handle the before and after state seems like it can be done uncoupled from the actual default-flip.
Hmm. On that matter, I wonder what the big fuss is all about. It's not like Git is forcing anybody to change their default branch. That's not at all what we're doing. To the contrary: _after_ many projects chose to change their default branch names, and _after_ GitHub started to follow that trend, Git added support for init.defaultBranch to accommodate that use case better. So in a sense, we're actually pretty late changing the fall-back of init.defaultBranch, at least from the perspective outside of the Git project.
There have been plenty of articles about this in the meantime, too, and I could imagine that most developers are at least aware that the shift away from master is happening, in many quite visible projects.
So to me, this whole discussion about whether this should bump the major version of Git seems a bit overblown. It's not like the median developer is creating new repositories on a regular basis, and if they do, chances are that they go with whatever branch name happens to be the initial one.
What is much more common is that developers clone existing projects. And guess what, many of those projects already use a different default branch name. And developers seem to accept that and just go on with their lives.
If it was up to me, I would reserve a major version increment to much bigger changes.
Ciao,
Dscho
Re: [RFC/PATCH] tests: support testing with an arbitrary default branch (sort of)
Hi Peff,
Quoted 7 lines · Johannes Schindelin
Quoted 4 lines · Jeff King
I'm on the fence whether there should be a deprecation period or major version bump for the final patch, but making the tests flexible enough to handle the before and after state seems like it can be done uncoupled from the actual default-flip.
Quoted 7 lines
[...] It's not like the median developer is creating new repositories on a regular basis, and if they do, chances are that they go with whatever branch name happens to be the initial one.
What is much more common is that developers clone existing projects. And guess what, many of those projects already use a different default branch name. And developers seem to accept that and just go on with their lives.
After sending off this mail, I felt a bit bad about not backing this up with data.
Whatever telemetry I would be able to pull would not be representative, and I would not be at liberty to share it anyway. So I asked Alex Mullans of GitHub (who is in charge of the default branch name switch to main there) whether he has any data I could share publicly and he said: "Across GitHub, 1/4 of daily pushes (and growing) go to main."
Seeing as the branch name to be used in newly-created repositories on GitHub changed only very recently (October 1st, i.e. some 6 weeks ago), I highly suspect that this number means that _a lot_ of existing projects have changed their primary branch name to main, and seem to be quite happy with it.
All this is to say that I consider it unnecessary to have a long deprecation period or major version bump for this patch series, based on available public data. The name main is already in wide-spread use (and growing) as primary branch name of Git projects.
Ciao,
Dscho
Re: [RFC/PATCH] tests: support testing with an arbitrary default branch (sort of)
In reply to Johannes SchindelinQuoted 51 lines · Johannes Schindelin
Hi Peff and Ævar,
Quoted 12 lines · Jeff King
Quoted 9 lines · Ævar Arnfjörð Bjarmason
* A lot of tests (but a small minority of the total) have master "master" hardcoded in some way. We now inventory them in tests-that-need-master.txt, we can still remove the names from that file and manually change the code later, but this accomplishes a clean test run with a relatively easy-to-review diff.
We ignore GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=<name> when it comes to these files, unless GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME_HARDER=true is set.
Quoted 5 lines
I'm confused how this is better. We could just be setting
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAMEat the top of those files, couldn't we? (Likewise, I think annotating individual scripts is more decentralized than a magic pattern intest-lib.sh, though it amounts to the same thing).I considered this alternative very briefly, and rejected it immediately because it would have implied a drawn-out limbo where the test suite will be inconsistent. That's not what I want.
Quoted 3 lines
And if I understand the current state of Dscho's patches, we don't _have_ to convert any tests right now. We could just annotate those scripts which are not yet converted to have them use the old name.
And that's what I did in some cases, see e.g.
5d5f4ea30de(t5411: finish preparing formainbeing the default branch name, 2020-10-31).It's just quite a ton of work to do this for all the affected test scripts, and I wanted to automate as much as possible of that process so that it'll be easier to cope with all the other topics that are in flight.
Therefore, I opted to "annotate the scripts" via a
caseintest-lib.sh. It should be quite a bit easier to understand, too, for the occasional reader, as it shows you the complete range of scripts that have been handled so far.Quoted 5 lines
But I don't think we want to live in that state indefinitely. It's slightly annoying to have inconsistent naming within the tests. I'd be happy to switch individual tests at a leisurely pace over the next couple of months or whatever. But since Dscho has bothered to write all of the patches now, why not use them?
Yep, I am a bit puzzled why we need to consider other approaches. I would have thought that the more pressing issue is to verify that I
Quoted 7 lines
1) caught all the necessary conversions,
2) did not miss any non-trivial adjustments (such as
nasterand aligned comments).At the same time, I am quite thankful for all the help Ævar provided; mentioning that I missed
nasterin t1400 was definitely super helpful.
Not being up-to-date on this whole s/master/main/g discussion, is the context here that we've essentially pre-approved these patches & doc for integration into the next release? If so I really don't mind doing it this way.
I started poking at this because I noticed that on git.git's master branch tests were being skipped due to PREPARE_FOR_MAIN_BRANCH, so it's in some in-between state between patch serieses.
We're now in week 4/9 of a release cycle for 2.30 (or 3.00 or whatever). I hope the one thing people for & against this master/main change can agree on is that it would be bad to ship a git with an incomplete migration to "main", e.g. the 28/28 patch here which changes it but without any doc updates.
I may be reading this wrong, but it seems pr-762/dscho/use-main-as-default-branch-name-v1...remotes/dscho/inclusive-naming (which I'm assuming is what's left) is another ~30k line diff on top of this ~25k one.
So yes I'm very late to the discussion, sorry about that. I'm just chiming in to say that if we're doing this as part of our regular patch review front-loading these massive search/replace changes seems to be too much of a change for one cycle.
But if Junio's going to chime in to say he's applying it all I don't care & don't have any concern about it.
Quoted 9 lines
Quoted 6 lines
I'm much more concerned about the lack of documentation changes associated with the final patch. We don't necessarily need to eradicate every mention of "master" from the documentation, but I think we do need to make sure that examples and instructions are consistent with how Git will actually behave. And that does need to happen at the same time as the user-visible flip of the default.
I am sorry. This is totally my fault. I should have described this much better in the cover letter. This patch series deliberately omits all the
Ditto in my hastily-written RFC commit message. A better summary is:
* Yours: All tests depend on master changed to all tests depend on main
* Mine (well, partway there): You can set $ANY_NAME for the branch, but we blacklist some as being hardcoded on <name> (which I just left at master).
This means we can test e.g. non-ASCII default branch names. It seems better to me if we're going to s/master/something/g & review it to have that something be \$GIT_TEST_MAIN (or another variable). Then we can mark that test as "accepts any default branch name" and move on.
* Yours: Requires not running some tests while we wait for this to land
* Mine: Run all tests & mark them as we go along for master||$NEWNAME. Similar to the test protocol v2 refactoring
But yeah e.g. the t/tests-that-need-master.txt I added in my RFC is better marked in the test itself, I should have stolen your 'case "$TEST_NUMBER"' way of doing it.
In my defense I honestly managed to miss it in skimming the ginormous diff, which I think makes part of my argument here :)
Quoted 6 lines
I _did_ prepare them, they are pretty much ready-to-go, as part of the
inclusive-namingbranch I track in
https://github.com/gitgitgadget/git/pull/655 (I use the branch nameuse-main-as-default-branch-name-docsin theinclusive-namingbranch thicket to track the documentation changes).
Quoted 7 lines
The decision to separate them out into their own patch series was made consciously, to avoid having one big, honking, totally unreviewably large patch series.
Therefore, just like I fed the preparatory patch series in a slow cadence, I planned on feeding the
-docspatch series once the dust settles on this patch series (i.e. once it hitsnext).
On the topic of deprecation etc.:
Quoted 23 lines
Quoted 4 lines
I'm on the fence whether there should be a deprecation period or major version bump for the final patch, but making the tests flexible enough to handle the before and after state seems like it can be done uncoupled from the actual default-flip.
Hmm. On that matter, I wonder what the big fuss is all about. It's not like Git is forcing anybody to change their default branch. That's not at all what we're doing. To the contrary: _after_ many projects chose to change their default branch names, and _after_ GitHub started to follow that trend, Git added support for
init.defaultBranchto accommodate that use case better. So in a sense, we're actually pretty late changing the fall-back ofinit.defaultBranch, at least from the perspective outside of the Git project.There have been plenty of articles about this in the meantime, too, and I could imagine that most developers are at least aware that the shift away from
masteris happening, in many quite visible projects.So to me, this whole discussion about whether this should bump the major version of Git seems a bit overblown. It's not like the median developer is creating new repositories on a regular basis, and if they do, chances are that they go with whatever branch name happens to be the initial one.
Quoted 7 lines
What is much more common is that developers clone existing projects. And guess what, many of those projects already use a different default branch name. And developers seem to accept that and just go on with their lives.
If it was up to me, I would reserve a major version increment to much bigger changes.
[I'm continuing quoting you here from your downthread <[email protected]>]
Quoted 12 lines
Whatever telemetry I would be able to pull would not be representative, and I would not be at liberty to share it anyway. So I asked Alex Mullans of GitHub (who is in charge of the default branch name switch to
mainthere) whether he has any data I could share publicly and he said: "Across GitHub, 1/4 of daily pushes (and growing) go tomain."Seeing as the branch name to be used in newly-created repositories on GitHub changed only very recently (October 1st, i.e. some 6 weeks ago), I highly suspect that this number means that _a
lot_of existing projects have changed their primary branch name tomain, and seem to be quite happy with it.
Quoted 4 lines
All this is to say that I consider it unnecessary to have a long deprecation period or major version bump for this patch series, based on available public data. The name
mainis already in wide-spread use (and growing) as primary branch name of Git projects.
All of that's true, but I really don't see how it's relevant to the change we're discussing making to refs.c in git.git, which from my generous reading of some of the threads in objection to this is the main point of contention.
(I'm generously not engaging with some of the more howler-monkey esque replies we've had on-list from people who seemed to have no idea what was actually being proposed in git.git)
*That* change is not whether we approve of people using "main", or hosting sites like GitHub etc. making it the default.
I think it's fair to say that even in some alternate universe where the particular reasons we're switching away from "master" didn't exist and e.g. GitHub et al had just decided on this out of the blue based on an aesthetic preference we'd just say "uh, sure, whatever, you configure it how you want".
Rather, we're talking about what happens when you run "git init".
Most people who are using or creating git repositories are nowadays never going to be impacted by what "git init" does. So I think the data you're citing here doesn't support your argument at all, it does the opposite.
The people using these repositories with "main" on GitHub did not do so with a patch to "git init". They clicked a button in the UI, or copy/pasted GitHub's "how to create a local repo" which nowadays will manually set the branch to "main" before pushing.
Then who's using "git init" who's going to be impacted by this change? It's everyone else, like probably tens of tens of thousands of one-off cronjobs somewhere creating a daily report of some by "init && commit && git diff master..".
I'm on the fence about what we should do in that case, but I'm leaning towards some deprecation period or at least some other approach than a s/master/main/g change precisely because of the numbers you're citing.
Because they shows how irrelevant the default shipped with git.git is to users who want this s/master/main/g change in repositories they regularly use. So we're really mostly talking about an impact to scripts & some advanced users, both of who have a pretty good argument for "init"'s default being what's been explicitly documented for ages in its manpage.
Even if we want to just change it I think it's uncharitable to those people not to at least consider throwing them some bone. E.g. "init" could use the old default when it's not connected to a terminal, we could show an advice notice and sleep(5) saying we're using a new default etc. etc.
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [RFC/PATCH] tests: support testing with an arbitrary default branch (sort of)
Quoted 53 lines · Johannes Schindelin
Hi Ævar,
Quoted 24 lines · Ævar Arnfjörð Bjarmason
Quoted 12 lines · Johannes Schindelin
Whatever telemetry I would be able to pull would not be representative, and I would not be at liberty to share it anyway. So I asked Alex Mullans of GitHub (who is in charge of the default branch name switch to
mainthere) whether he has any data I could share publicly and he said: "Across GitHub, 1/4 of daily pushes (and growing) go tomain."Seeing as the branch name to be used in newly-created repositories on GitHub changed only very recently (October 1st, i.e. some 6 weeks ago), I highly suspect that this number means that _a
lot_of existing projects have changed their primary branch name tomain, and seem to be quite happy with it.Quoted 4 lines
All this is to say that I consider it unnecessary to have a long deprecation period or major version bump for this patch series, based on available public data. The name
mainis already in wide-spread use (and growing) as primary branch name of Git projects.[...]
I'm on the fence about what we should do in that case, but I'm leaning towards some deprecation period or at least some other approach than a s/master/main/g change precisely because of the numbers you're citing.Quoted 6 lines
Because they shows how irrelevant the default shipped with git.git is to users who want this s/master/main/g change in repositories they regularly use. So we're really mostly talking about an impact to scripts & some advanced users, both of who have a pretty good argument for "init"'s default being what's been explicitly documented for ages in its manpage.
I think you have a good point here. It really does not matter _all_ that much, yet I still would like to complete the switch to
mainat some stage. But as you point out, that point does not _have_ to be now.As a consequence, I reconsider my stance on "splitting off patch 28". I think I will send out a v2 tomorrow, including the fix you suggested for t1400 to also rename
nastertonain, and dropping the patch that changes the fall-back forinit.defaultBranchfor now.I _do_ want to complete the transition to using
GIT_TEST_DEFAULT_INIT_BRANCH=mainto address the concern you raised
elsewhere: a couple of test cases are skipped until that transition is complete.After I send out v2, I will work on that patch that imitates
d18c950a69f(pull: warn if the user didn't say whether to rebase or to merge, 2020-03-09) to show some advice wheninit.defaultBranchis not set.
Quoted 6 lines
My current thinking is that we could show this advice for about half a year and then make the switch to
main, continuing to show the advice (now adjusted formain) for about another half year, and then turn the warning off.What do you think, does that sound too conservative of a plan?
The v2 looks good to me. I just had a suggestion in [1] to apply something on top to restore the test coverage until while whatever comes after it lands.
In case I didn't make it clear I have no objection entirely replacing "master" with "main" in the tests. I just had a practical concern/question about coverage while it was landing, and a suggestion of whether perhaps there was an easier/faster way to do the "init" change first by omitting some of the test churn.
But if you want to do all the legwork that's fine by me :)
I just thought that a sober estimation of how long it takes patches to land would mean the v1 would be in some in-between state for the next release.
FWIW I'm not necessarily for some warning. I mainly wanted to attempt to mediate some of the discussion about the concern to something more productive.
At the risk of repeating too much of my past overly long E-Mails, but if I'm being difficult for you when you're submitting patches & causing work for you I think I owe you an unambiguous explanation for why that is:
I think some of the people advocating this change can rightly look at some of the previous E-Mail traffic and see what are at best rants and at worst some political grandstanding that's at best pretty irrelevant to any proposed changes in git.git.
But that doesn't mean that there aren't some legitimate concerns. Those are in my mind separate from the particular political motivations of the s/master/main/ change, we'd have those with any change to the defaults in the core tooling.
I think in general with such changes that replies like Theodore Ts'o here [2] (not picking on him in particular, I just thought it was representative) reflect a rather insular view of how we need to think about these sorts of changes.
I.e. a *lot* of git users probably aren't aware that there's even a git config (they use some 3rd party UI), and I'd say the vast majority are likely to never find or read any sort of release notes about changes we make.
Most people's relation to git is like my relation to netcat. It's some tool I use 1-2 levels down in my stack, and I only bothered to find out about it because "ssh" stopped working one day.
If at the end of the day we decide to keep something like your original v1 28/28 patch + docs after some realistic look at the impact that would be fine by me. Just as long as we understand who we're likely to break stuff for, and whether it's worth the trade-off.
To Theodore's point about some people's motivations in [2], just to make my stance/opinion on the end-state clear (so far in all these threads I've been commenting on the "how" of the incremental transition):
I do 100% agree that the s/master/main/g change of the default should be made in one form or another. In my mind that doesn't even require a consideration of the political motivations at this point as far as git.git is concerned, just:
1. Major Git hosting providers already made the change
2. Realistically a lot/majority of git's user base interact with that in a major way.
3. A discrepancy in any default between /usr/bin/git and those providers is more confusing than not.
4. #3 doesn't mean they say "jump" we say "how high" whatever the change is.
But in this case the default is an entirely arbitrary default. Not e.g. that they decided to add some ill-thought out header to the object format or whatever.
P.S.: Shouldn't the pull patch in d18c950a69f be using the advice
facility, not warning()?
Re: [RFC/PATCH] tests: support testing with an arbitrary default branch (sort of)
Quoted 4 lines · Ævar Arnfjörð Bjarmason
I do 100% agree that the s/master/main/g change of the default should be made in one form or another. In my mind that doesn't even require a consideration of the political motivations at this point as far as git.git is concerned, just:
Others disagree.
While the political motivation shouldn't be a central concern, I suspect the vast majority of users have no idea this change is coming, and when they see the warning they will likely complain... Strongly. The fact that this change is extremely politically charged will become a factor.
Quoted 1 line
1. Major Git hosting providers already made the change
That's their decision. The Git project shouldn't be held hostage to third party decisions.
Quoted 5 lines
2. Realistically a lot/majority of git's user base interact with that in a major way.
3. A discrepancy in any default between
/usr/bin/gitand those providers is more confusing than not.
That's a problem for GitHub et al. Fortunately they can tell their users to set init.defaultbranch to whatever they want.
Quoted 6 lines
4. #3 doesn't mean they say "jump" we say "how high" whatever the change is.
But in this case the default is an entirely arbitrary default. Not e.g. that they decided to add some ill-thought out header to the object format or whatever.
I don't agree it is arbitrary, otherwise you could set the default to "loremipsum". Moreover, even if was arbitrary, it was arbitrary in 2005, not 2020 where "master" is already widely used in basically *all* the documentation everywhere. Some people have been using this name for 15 years, they won't give it up just like that.
People will complain, especially if they don't see a good reason for the change.
Signature · 1 line
Felipe Contreras
Re: [RFC/PATCH] tests: support testing with an arbitrary default branch (sort of)
Quoted 9 lines · Felipe Contreras
Quoted 4 lines · Ævar Arnfjörð Bjarmason
I do 100% agree that the s/master/main/g change of the default should be made in one form or another. In my mind that doesn't even require a consideration of the political motivations at this point as far as git.git is concerned, just:
Others disagree.
Sure, and I might end up disagreeing with myself once we have the proposed patches & more people inevitably chime in with some useful data about the trade-offs, edge cases we haven't considered etc.
Quoted 7 lines
While the political motivation shouldn't be a central concern, I suspect the vast majority of users have no idea this change is coming, and when they see the warning they will likely complain... Strongly. The fact that this change is extremely politically charged will become a factor.
Quoted 1 line
1. Major Git hosting providers already made the change
[... addressed below ...]
Quoted 11 lines
That's their decision. The Git project shouldn't be held hostage to third party decisions.
Quoted 5 lines
2. Realistically a lot/majority of git's user base interact with that in a major way.
3. A discrepancy in any default between
/usr/bin/gitand those providers is more confusing than not.That's a problem for GitHub et al. Fortunately they can tell their users to set init.defaultbranch to whatever they want.
I think this and what you mention in another thread[1] about GitHub's instructions for creating a repository takes a narrow view of our responsibility for creating a sane UI for users.
For example, right after the instructions you note there GitHub's current instructions are:
git remote add origin $url
git branch -M main
git push -u origin main
Now, put yourself in the shoes of a novice user who's just been introduced to this "git" thing for a job they started 2 days ago. We don't take the s/master/main/g change in git.git, GitHub keeps theirs.
You followed some tutorial or read the manpage to create a local repository and made a few commits, then to upload it to GitHub or another provider that uses "main" by default you copy/pasted the above commands. Now the thing changing from "master" to "main" is one more thing you're confused by.
That's my motivation for supporting this change. I think most git users by number are (hopefully) in the future, yes, as you note we'll have version transitions where that's more confusing than not, but the same can be said about the dashed command transition.
Whatever mistakes we made in that transition and should learn from a typical git user in 2020 has never used a dashed builtin, just like a new user in 2030 probably won't know or have to care about their local default being different than a $BIG_HOSTING_PROVIDER default.
That *is* our problem, not just a problem for GitHub et al. To claim otherwise is to just bury our head in the sand.
Are we on balance going to not make the change because e.g. we don't want various paper books and tutorials to be confusing? Maybe, maybe not. But just dismissing those concerns by saying e.g. "that's O'Reilly's problem" would be as nonsensical as us pretending that perpetuating an (admittedly rather minor) UI difference in perpetuity by our inaction is purely GitHub's responsibility.
Quoted 7 lines
Quoted 6 lines
4. #3 doesn't mean they say "jump" we say "how high" whatever the change is.
But in this case the default is an entirely arbitrary default. Not e.g. that they decided to add some ill-thought out header to the object format or whatever.
Quoted 5 lines
I don't agree it is arbitrary, otherwise you could set the default to "loremipsum". Moreover, even if was arbitrary, it was arbitrary in 2005, not 2020 where "master" is already widely used in basically *all* the documentation everywhere. Some people have been using this name for 15 years, they won't give it up just like that.
Yes, that was badly phrased and I take that back. I meant to say something closer to "a common convention" or whatever. E.g. if GitHub et al for whatever reason switched all use of "origin" as the default remote to "source" I'd think that at some point we'd be improving things overall if we made that switch as well.
Quoted 2 lines
People will complain, especially if they don't see a good reason for the change.
1. https://lore.kernel.org/git/CAMP44s1515GOwTOYv-wz4qMC9Qb6d8cSVSb_CNVwun0+Yj3VxQ@mail.gmail.com/
Re: [RFC/PATCH] tests: support testing with an arbitrary default branch (sort of)
Quoted 12 lines · Ævar Arnfjörð Bjarmason
Quoted 2 lines · Felipe Contreras
That's a problem for GitHub et al. Fortunately they can tell their users to set init.defaultbranch to whatever they want.
I think this and what you mention in another thread[1] about GitHub's instructions for creating a repository takes a narrow view of our responsibility for creating a sane UI for users.
For example, right after the instructions you note there GitHub's current instructions are:
Quoted 8 lines
git remote add origin $url
git branch -M main
git push -u origin mainNow, put yourself in the shoes of a novice user who's just been introduced to this "git" thing for a job they started 2 days ago. We don't take the s/master/main/g change in git.git, GitHub keeps theirs.
I am.
But that doesn't change the instructions. The "git branch -M main" would still be there (for older versions of Git).
And the "git push -u origin main" would still be there, because you need to specify the branch you want to push to. Although I would have used HEAD instead of main, or even better @, which apparently doesn't work, but should work. If GitHub cares so much about these instructions, they could have fixed this so "git push -u origin @" works, why haven't they? Because they don't care as much as they claim to (see the obvious inconsistency below).
Quoted 5 lines
You followed some tutorial or read the manpage to create a local repository and made a few commits, then to upload it to GitHub or another provider that uses "main" by default you copy/pasted the above commands. Now the thing changing from "master" to "main" is one more thing you're confused by.
What if the project uses "trunk"? Or "default"?
If a project uses a non-standard name, it's their responsibility to teach their users how to interact with that project. If GitHub chose "main", it's *their* responsibility to tell their users that this is a discrepancy from most of the online documentation, including online documentation specific to GitHub.
The best way the Git project can help is by not hard-coding any of these names, so the documentation doesn't have to use "master", or "main", but can use @, or @{upstream}.
But right now the documentation *has* to hard-code these names, because of poor triangular workflow support from Git, something I tried to fix many years ago with my @{publish} patches.
If we had proper @{upstream} and @{publish} support, and taught users how to use them well, there would be no need for anyone to do "git rebase -i master" ("git rebase -i" would do).
Quoted 4 lines
That's my motivation for supporting this change. I think most git users by number are (hopefully) in the future, yes, as you note we'll have version transitions where that's more confusing than not, but the same can be said about the dashed command transition.
The number of Git users in the future directly depends on how we treat Git users in the present. And the Git users of the present would not appreciate that 99% of documentation out there uses "master", while Git does not, especially if in their mind it's due to bad (political) reasons.
What's wrong with *first* fixing the interface so we don't have to type "master" so much (e.g. by properly supporting triangular workflows), and *then* consider changing "master" later, *after* a lot of online documentation has stopped using the name "master" directly as well?
Quoted 4 lines
Whatever mistakes we made in that transition and should learn from a typical git user in 2020 has never used a dashed builtin, just like a new user in 2030 probably won't know or have to care about their local default being different than a $BIG_HOSTING_PROVIDER default.
That's *if* the current project survives in its current form. Perhaps in 2030 there will be a libgit with more than one user interface. Nobody knows the future.
Quoted 2 lines
That *is* our problem, not just a problem for GitHub et al. To claim otherwise is to just bury our head in the sand.
It is our problem to improve the interface so users don't have to type "master" (or "main), so much.
It is not our problem that GitHub decided to get ahead of itself and change their instructions without first considering other options, like improving the interface.
Quoted 6 lines
Are we on balance going to not make the change because e.g. we don't want various paper books and tutorials to be confusing? Maybe, maybe not. But just dismissing those concerns by saying e.g. "that's O'Reilly's problem" would be as nonsensical as us pretending that perpetuating an (admittedly rather minor) UI difference in perpetuity by our inaction is purely GitHub's responsibility.
GitHub can fix that UI difference *today* by retracting their instructions and instead come here and discuss with us ways to improve the interface first.
They chose that action *unilaterally* without discussing it with the Git project. That's on them.
Yes, GitHub users are our users too, but we have many more users, we shouldn't hurt them just because GitHub has no patience.
As an example of GitHub's impatience, look at GitHub's Hello World [1], the text has been updated to "main", but all the images say "master". It's their *first* guide, and it's already inconsistent.
https://guides.github.com/activities/hello-world/readme-edits.gif
Additionally, GitHub cannot say "implement X or we will hurt our users". That would be manipulative tactics, and the Git project should not succumb to those. Regardless of what GitHub does, the Git project should implement X on its own terms, if and when it has determined it's in the best interest of its users.
Moreover, you have not explained precisely how the issues will be solved by changing the default name. All the documentation out there would be inconsistent with "main". Even GitHub's own documentation is inconsistent at this precise moment.
Take one of the first results you get when googling "github how to" [2], it says to "git push -u origin master". By keeping the name "master" we are helping those users that are not using a github.com guide, and are using one of the hundreds (or thousands) of guides out there that assume the name is master. In fact, the *only* thing that is hurting GitHub users right now is those initial instructions they chose, which you can ignore, and instead use an external guide.
It is very likely that by doing this change we would actually hurt more GitHub users than not doing it.
Cheers.
[1] https://guides.github.com/activities/hello-world/
[2] https://opensource.com/article/18/1/step-step-guide-git
Signature · 1 line
Felipe Contreras
Re: [RFC/PATCH] tests: support testing with an arbitrary default branch (sort of)
In reply to Ævar Arnfjörð BjarmasonQuoted 12 lines · Ævar Arnfjörð Bjarmason
... In my mind that doesn't even require a consideration of the political motivations at this point as far as git.git is concerned, just:
1. Major Git hosting providers already made the change
2. Realistically a lot/majority of git's user base interact with that in a major way.
3. A discrepancy in any default between
/usr/bin/gitand those providers is more confusing than not.
Quoted 6 lines
4. #3 doesn't mean they say "jump" we say "how high" whatever the change is.
But in this case the default is an entirely arbitrary default. Not e.g. that they decided to add some ill-thought out header to the object format or whatever.
Yes.
Quoted 2 lines
P.S.: Shouldn't the pull patch ind18c950a69fbe using the advice
facility, notwarning()?
I think warning() is the right thing here, as it is self squelching. Setting pull.rebase (even to 'false') is sufficient---there is no need to set advise.setpullrebase to 'false' on top.
Re: [RFC/PATCH] tests: support testing with an arbitrary default branch (sort of)
Hi Junio & Ævar,
Quoted 8 lines · Junio C Hamano
Quoted 2 lines · Ævar Arnfjörð Bjarmason
P.S.: Shouldn't the pull patch ind18c950a69fbe using the advice
facility, notwarning()?I think
warning()is the right thing here, as it is self squelching. Setting pull.rebase (even to 'false') is sufficient---there is no need to set advise.setpullrebase to 'false' on top.
Right. The only reason to use advise() would be to allow users to squelch the warning by setting advice.*.
On the other hand, warnings are not colored, but advice messages are.
And now I realize that the same holds for init.defaultBranch: it is also self-squelching. And it also might benefit from the coloring to make it stand out a bit.
Thoughts?
Ciao,
Dscho
Re: [RFC/PATCH] tests: support testing with an arbitrary default branch (sort of)
Quoted 16 lines · Johannes Schindelin
Hi Junio & Ævar,
Quoted 8 lines · Junio C Hamano
Quoted 2 lines · Ævar Arnfjörð Bjarmason
P.S.: Shouldn't the pull patch ind18c950a69fbe using the advice
facility, notwarning()?I think
warning()is the right thing here, as it is self squelching. Setting pull.rebase (even to 'false') is sufficient---there is no need to set advise.setpullrebase to 'false' on top.Right. The only reason to use
advise()would be to allow users to squelch the warning by settingadvice.*.
Quoted 7 lines
On the other hand, warnings are not colored, but advice messages are.
And now I realize that the same holds for
init.defaultBranch: it is also self-squelching. And it also might benefit from the coloring to make it stand out a bit.Thoughts?
I do not see colors well. You'll always get "find some other way to make it stand out more to those like us---if you canhdo so without colors, that would be ideal" from me, so please don't ask me to vote for more colors.
Re: [RFC/PATCH] tests: support testing with an arbitrary default branch (sort of)
Hi Junio,
Quoted 22 lines · Junio C Hamano
Quoted 20 lines · Johannes Schindelin
Quoted 8 lines · Junio C Hamano
Quoted 2 lines · Ævar Arnfjörð Bjarmason
P.S.: Shouldn't the pull patch ind18c950a69fbe using the advice
facility, notwarning()?I think
warning()is the right thing here, as it is self squelching. Setting pull.rebase (even to 'false') is sufficient---there is no need to set advise.setpullrebase to 'false' on top.Right. The only reason to use
advise()would be to allow users to squelch the warning by settingadvice.*.On the other hand, warnings are not colored, but advice messages are.
And now I realize that the same holds for
init.defaultBranch: it is also self-squelching. And it also might benefit from the coloring to make it stand out a bit.
Quoted 6 lines
Quoted 1 line
Thoughts?
I do not see colors well. You'll always get "find some other way to make it stand out more to those like us---if you canhdo so without colors, that would be ideal" from me, so please don't ask me to vote for more colors.
From a purely selfish point of view: colors _do_ serve me well. And from a maintainer's point of view: I added my share of coloring based on users' feedback, so I think that even if it does not benefit everybody equally well, it is valuable to add coloring where helpful.
As to the aspect "find some other way to make it stand out", I believe that advise() addresses that _also_, by virtue of prefixing the lines with the uniform hint: prefix (which stands out visually, at least to me, maybe it also does that for you?).
Ciao,
Dscho
Re: [RFC/PATCH] tests: support testing with an arbitrary default branch (sort of)
In reply to Ævar Arnfjörð BjarmasonHi Ævar,
I agree with pretty much all you said, just wanted to comment on a couple things:
Quoted 7 lines · Ævar Arnfjörð Bjarmason
In case I didn't make it clear I have no objection entirely replacing "master" with "main" in the tests. I just had a practical concern/question about coverage while it was landing, and a suggestion of whether perhaps there was an easier/faster way to do the "init" change first by omitting some of the test churn.
But if you want to do all the legwork that's fine by me :)
I started it, I finish it, I guess. Well, technically Don started it...
Quoted 6 lines
I think some of the people advocating this change can rightly look at some of the previous E-Mail traffic and see what are at best rants and at worst some political grandstanding that's at best pretty irrelevant to any proposed changes in git.git.
But that doesn't mean that there aren't some legitimate concerns.
And that's so sad to read. It is disheartening how eager certain people were to drown out others' voices, then claiming that they had not heard any views opposing their own. I mean, yeah, if you want to hear other opinions, it sure helps to stop talking for a while, and to start listening.
I consider myself lucky that I _did_ get the chance to listen. Related to my work in GSoC and Outreachy, and through my day job, wonderful people approached me with their stories and perspectives. I am really glad that I had the opportunity to hear those.
As to legitimate concerns: yes, you are right. There are those. If your documentation says that you should avoid committing directly to the master branch, and then you clone a popular Open Source project and it does not even _have_ a master branch, that might be a bit puzzling.
Note that I used a clone as an example, not git init, because it is a much more common operation. Git is a tool for developers to communicate, in a way, after all, even if it _can_ be used for working in isolation, too. Hence clones outnumber inits. And that communication of ideas, of code, and to combine efforts, to collaborate, that is what Git really facilitates. That is why I find it so important to be inclusive, to be inviting underrepresented developers. There is such a lot of untapped potential there, and even if using a non-offensive default branch name is but a _teeny_ tiny step to open the door a little, it is at least a step in the right direction.
Now, since I mentioned clone: please note that the default branch name used in a clone is squarely outside the Git project's control. It is decided by the maintainer(s)/communities of the respective projects. And that's exactly how it should be.
Therefore, as you said before, it does not really matter all that much at what date we will change the fall-back for init.defaultBranch.
At the same time, I still think that it is valuable to transition the test suite _now_, to be as independent on a specific default branch name as possible, if only to ensure that above-mentioned projects can choose freely what they want their primary branch to be called and Git works just fine.
Quoted 5 lines
I do 100% agree that the s/master/main/g change of the default should be made in one form or another. In my mind that doesn't even require a consideration of the political motivations at this point as far as git.git is concerned, just:
Quoted 7 lines
1. Major Git hosting providers already made the change
2. Realistically a lot/majority of git's user base interact with that in a major way.
3. A discrepancy in any default between
/usr/bin/gitand those providers is more confusing than not.
Right.
I originally thought that we should switch the default branch name in v2.30 for that reason, but I now think that adding that advice is probably a less disruptive, and almost equally supportive solution.
Quoted 9 lines
4. #3 doesn't mean they say "jump" we say "how high" whatever the change is.
But in this case the default is an entirely arbitrary default. Not e.g. that they decided to add some ill-thought out header to the object format or whatever.
P.S.: Shouldn't the pull patch ind18c950a69fbe using the advice
facility, notwarning()?
I submitted a patch for that, but unfortunately forgot to Cc: you:
https://lore.kernel.org/git/[email protected]
Ciao,
Dscho
Re: [RFC/PATCH] tests: support testing with an arbitrary default branch (sort of)
In reply to Johannes SchindelinQuoted 9 lines · Johannes Schindelin
Quoted 4 lines · Jeff King
I'm on the fence whether there should be a deprecation period or major version bump for the final patch, but making the tests flexible enough to handle the before and after state seems like it can be done uncoupled from the actual default-flip.
Hmm. On that matter, I wonder what the big fuss is all about. It's not like Git is forcing anybody to change their default branch.
Except you are, and you will be doing it without the user consent, and without warning. This is the opposite of what any software project that cares about its users should do.
The consequences are predictable.
Exactly the same argument was used in 2008, and it was wrong for exactly the same reasons.
Yes, people could add the exec-path to their PATH, so "nobody was being forced" ultimately, but that's missing the point entirely, because that happened *after* they were forced initially, and being caught completely off guard.
Quoted 3 lines
There have been plenty of articles about this in the meantime, too, and I could imagine that most developers are at least aware that the shift away from
masteris happening, in many quite visible projects.
I have used Git since 2005, contributed since 2009, follow the git subreddit, and I was not aware of the change, and presumably neither was Ævar.
What you imagine most developers know is irrelevant, what is relevant is what they actually know.
This is the bias known as the curse of knowledge: since you have a lot of specific knowledge you fail to see how other people could not see the same thing you are seeing, but they don't, and the reason is that they don't have the same knowledge as you.
But just because you can't see it happen, doesn't mean it can't.
It did in 2008, and people back then used the same argument you are using now.
Developers back then could not imagine how it was possible that users were not aware of the upcoming change that had been cooking for years, but alas they did not.
Do not assume what your users know. Deprecation periods exist for a reason, and so do warnings.
Signature · 1 line
Felipe Contreras
Quoted 8 lines · Ævar Arnfjörð Bjarmason
On Thu, Nov 12 2020, Johannes Schindelin via GitGitGadget wrote:
After this series as it stands lands what's a rather big UI change in git isn't discussed *anywhere* in the docs.
I'm not saying we need some similar s/master/main/g in
Documentation/as what's being done here in t/, but I think a bare minimum for a rather big UI change like this is:
Why not?
Isn't this change being championed on behalf of users who find the word offensive?
Why would it be offensive to see the word on the commands you type on the command line, but not offensive if the documentation tells you to type those commands? This does not compute.
And worse; for the rest of the users that don't find the word offensive (99.9% of them?), the documentation is left in an inconsistent state, where some commands would not work as they are stated.
If a word is so offensive it has to be erased from the Git lexicon, then it has to be erased *everywhere*, or at least everywhere a user might look.
Cheers.
Signature · 1 line
Felipe Contreras
"Johannes Schindelin via GitGitGadget" <[email protected]>
Quoted 3 lines · writes:
This is the big one. This changes the default of init.defaultBranch to main, reflecting what many open source projects already did (which was followed by GitHub, Azure Repos and others).
I'll keep this brief as I'm still offline/vacation til next week.
As other people already said, I'd prefer to see
- all tests updated to work, without losing any coverage, regardless of the default for the init.defaultbranch is.
Some test scripts may require setting init.defaultBranch='master' at the top in the 'setup' part (I've shown how in my response to t4013 patchset) if the body of the test relies too heavily on the primary branch to be 'master'. On the other hand, some test scripts may require setting init.defaultBranch='main' at the top, if they have been converted to work _only_ with 'main'.
Both of these are unfortunate, but it is much better than losing test coverage during the test update effort.
Some test scripts may not need any "this test would only work with 'master|main', so we are forcing". After your test update series so far, hopefully many may already be ready to be force to 'main' even when the Git binary may still use 'master' as the fallback default for init.defaultBranch.
- a well thought-out transition plan (including user education and publicity), with the final "flip of the fallback default".
and I'd strongly prefer that these two to be done separately. Since we cannot anticipate how long the latter would take with unknown amount of distraction, I'd prefer 100% of our tests keep working while the fallback default for init.defaultBranch is 'master', and they still work on the flag day when the default is changed to 'main' (or 'primary' for that matter---after all, tests that care too deeply what the primary branch name is, and have been updated to eradicate 'master' from them, would be forcing 'main', so the hardcoded fallback default in our binary should not matter).
Thanks.
Quoted 4 lines · Junio C Hamano
Some test scripts may require setting init.defaultBranch='master' at the top in the 'setup' part (I've shown how in my response to t4013 patchset) if the body of the test relies too heavily on the primary branch to be 'master'.
Ah, I realized we have much better mechanism already in the form of GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME environment.
So, my three wishes in this message now become
- lose PREPARE_FOR_MAIN_BRANCH prerequisite as quickly as possible by doing the following two.
- Use that mechanism to force 'main' in test scripts that now only can work with 'main', even before we change the fallback default from master to main in the production code, so that we won't lose test coverage.
- The same for test scripts that are not converted yet to force use of 'master', so that we could change the fallback default from master to main in the production code even before converting these other scripts, so that we won't lose test coverage.
Thanks.
Hi Junio,
Quoted 7 lines · Junio C Hamano
Quoted 4 lines · Junio C Hamano
Some test scripts may require setting init.defaultBranch='master' at the top in the 'setup' part (I've shown how in my response to t4013 patchset) if the body of the test relies too heavily on the primary branch to be 'master'.
Quoted 6 lines
Ah, I realized we have much better mechanism already in the form of
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAMEenvironment.So, my three wishes in this message now become
- lose
PREPARE_FOR_MAIN_BRANCHprerequisite as quickly as possible
Okay, we're on the same page here.
Quoted 1 line
by doing the following two.
A couple of test cases already have the PREPARE_FOR_MAIN_BRANCH prereq (in preparation for transitioning the test suite, which is what I will settle for in v2 of this patch series). Most notably, t5526 and t9902, which I had to exclude to avoid clashing with branches that are currently in flight.
So my goal is to transition the test suite as quickly as possible, by first converting the majority in v2 of this patch series, and then handling the rest of the test scripts individually, on top of the in-flight topics.
Quoted 4 lines
- Use that mechanism to force 'main' in test scripts that now only can work with 'main', even before we change the fallback default from master to main in the production code, so that we won't lose test coverage.
That's precisely what I do, incrementally, by adjusting that case statement in t/test-lib.sh whenever a range of test scripts has been transitioned. In patch 2/28, it looks like this:
case "$TEST_NUMBER" in [01]*) GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME ;; esac
By patch 26/28, it looks like this:
case "$TEST_NUMBER" in 3404|4013|5310|5526|6300|7064|7817|9902) # Avoid conflicts with patch series that are cooking at the same # time # as the patch series changing the default of # `init.defaultBranch`. GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME ;; *) GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME ;; esac
Quoted 4 lines
- The same for test scripts that are not converted yet to force use of 'master', so that we could change the fallback default from master to main in the production code even before converting these other scripts, so that we won't lose test coverage.
Okay, I could have done it that way by starting with
case "$TEST_NUMBER" in [01]*) GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME ;; *) GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME ;; esac
But that would result in a funny-looking intermediate state with a master arm, then main, then again master.
Besides, it would be more complicated because t/t5411-proc-receive-hook.sh and t/t5515-fetch-merge-logic.sh already ask for main, but by setting it before sourcing test-lib.sh, and therefore we would have to special-case them in that case from the get-go.
Therefore, in the interest of making this patch series _slightly_ easier to review (you still have to look at the _bottom_ of most of those patches to catch the crucial change to t/test-lib.sh), I would like to keep the patch series in the current shape.
Will send v2 in a moment.
Thanks,
Dscho
Quoted 11 lines · Johannes Schindelin
Hi Junio,
Quoted 7 lines · Junio C Hamano
Quoted 4 lines · Junio C Hamano
Some test scripts may require setting init.defaultBranch='master' at the top in the 'setup' part (I've shown how in my response to t4013 patchset) if the body of the test relies too heavily on the primary branch to be 'master'.
Quoted 8 lines
Quoted 6 lines
Ah, I realized we have much better mechanism already in the form of
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAMEenvironment.So, my three wishes in this message now become
- lose
PREPARE_FOR_MAIN_BRANCHprerequisite as quickly as possibleOkay, we're on the same page here.
Yeah, you may have noticed after reading my recent messages to this topic, my initial reaction was mostly triggered by "eh, are we losing test coverage too much?" before re-reading what the patches (both what we have already merged and these 28 final stretch patches) actually do, and realizing that they aim at preparing us so that we can flip the fallback default any time we like. So we are very much on the same page.
Quoted 13 lines
That's precisely what I do, incrementally, by adjusting that
casestatement int/test-lib.shwhenever a range of test scripts has been transitioned. In patch 2/28, it looks like this:case "$TEST_NUMBER" in [01]*) GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME ;; esacBy patch 26/28, it looks like this:
Quoted 14 lines
case "$TEST_NUMBER" in 3404|4013|5310|5526|6300|7064|7817|9902) # Avoid conflicts with patch series that are cooking at the same # time # as the patch series changing the default of # `init.defaultBranch`. GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME ;; *) GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME ;; esac
I actually am not a big fan of the centralized table of "these want to run with main". My ideal would be to have an explicit assignment of either master or main for tests that absolutely require the default to be one of these names at the top of these script, and any test scripts that do not care what the initial branch is called (perhaps because they begin by switching to a branch whose name is picked by them immediately after they start and use that name throughout) won't have GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME in them.
I think we can live with a centralized "case", but I have trouble with seeing only two arms in the above case statement, whether which one gets the asterisk. There may be ones that need to force 'master', there may be ones that need to force 'main', but hopefully many do not even have to force and can work with either. And seeing "everything else works only with 'main'" is a bit disappointing.
But if you must have a case with only two arms, i.e. "these are exceptions" and "everything else", I think the above (i.e. we refrain from touching these and force them to 'master' as exceptions, but everything else is forced to 'main') is better than having them the other way around.
Thanks.
Hi Junio,
Quoted 17 lines · Junio C Hamano
Quoted 6 lines · Johannes Schindelin
case "$TEST_NUMBER" in 3404|4013|5310|5526|6300|7064|7817|9902) # Avoid conflicts with patch series that are cooking at the same # time # as the patch series changing the default of # `init.defaultBranch`.Quoted 8 lines
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME ;; *) GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME ;; esac
Quoted 8 lines
I actually am not a big fan of the centralized table of "these want to run with main". My ideal would be to have an explicit assignment of either master or main for tests that absolutely require the default to be one of these names at the top of these script, and any test scripts that do not care what the initial branch is called (perhaps because they begin by switching to a branch whose name is picked by them immediately after they start and use that name throughout) won't have
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAMEin them.
I will make it so in v3.
It does make sense, too: the four patch series I sent out in the past hours address some issues that I would have otherwise missed in the transition (in particular, two test cases with test_must_fail in them would have continued to pass, but for the wrong reason, during the transition to main.
Ciao,
Dscho
v2 cover tests: use main as default branch name
In reply to Johannes Schindelin via GitGitGadgetThis (big) patch series (almost) concludes the transition of Git's test suite to use init.defaultBranch=main that was started in js/default-branch-name-part-4-minus-1, continued in js/default-branch-name-adjust-t5411 and in js/default-branch-name-adjust-t5515. This transition prepares for changing the fall-back value of init.defaultBranch accordingly (which will be done in a different set of patch series, with an appropriate deprecation period), reflecting what many open source projects already did followed by GitHub, Azure Repos and others.
Instead of one huge patch that reflects essentially a search-and-replace in the test suite, this patch series splits the changes up into chunks that are intended to be smaller than 100kB so that they are not rejected by the Git mailing list. Interspersed between those changes are adjustments e.g. in alignment, to make it easier to review (or recreate) the search-and-replace patches.
Note that this branch is based on next, mostly because it would otherwise conflict with en/merge-tests, jk/diff-release-filespec-fix and ds/maintenance-part-3.
To avoid even more conflicts with topics that did not even make it to seen yet, this patch series specifically excludes t3404, t4013, t5310, t5526, t6300, t7064, t7817, t9902: in those test scripts, we will still use master for the time being. Once the topics in question have settled, I will send the appropriate follow-up patches to adjust them to use main instead.
Note that even after this patch series, master is still found in t/, even outside of the tests we excluded specifically to avoid conflicts with other patch series that are currently in flight: t/perf/, the git p4 tests (because git p4 still uses p4/master to refer to the remote main branch), and some comments still refer to this name. I intend to address at least some of those, in patch series separate from the current one.
Changes since v1:
* Dropped the commit changing the default initial branch name for git init.
* Adjusted the patch for t1402 to also replace naster by nain.
* Excluded t5526 from the patches for now, to avoid clashing with pk/subsub-fetch-fix.
Johannes Schindelin (27):
t0060: preemptively adjust alignment
t[01]*: adjust the references to the default branch name "main" t2*: adjust the references to the default branch name "main" t3[0-3]*: adjust the references to the default branch name "main"
t3416: preemptively adjust alignment in a comment
t34*: adjust the references to the default branch name "main" t3[5-9]*: adjust the references to the default branch name "main" t4*: adjust the references to the default branch name "main"
t5323: prepare centered comment for master -> main t5[0-4]*: adjust the references to the default branch name "main"
t5503: prepare aligned comment for replacing master with main t550*: adjust the references to the default branch name "main" t551*: adjust the references to the default branch name "main" t55[23]*: adjust the references to the default branch name "main" t55[4-9]*: adjust the references to the default branch name "main" t5[6-9]*: adjust the references to the default branch name "main" t6[0-3]*: adjust the references to the default branch name "main" t64*: preemptively adjust alignment to prepare for master -> main t6[4-9]*: adjust the references to the default branch name "main" t7[0-4]*: adjust the references to the default branch name "main" t7[5-9]*: adjust the references to the default branch name "main" t8*: adjust the references to the default branch name "main" t9[0-4]*: adjust the references to the default branch name "main" t9[5-7]*: adjust the references to the default branch name "main" tests(git-p4): transition to the default branch name main t99*: adjust the references to the default branch name "main"
tests: drop prereq PREPARE_FOR_MAIN_BRANCH where no longer needed
t/annotate-tests.sh | 8 +- t/lib-cvs.sh | 2 +- t/t0002-gitfile.sh | 6 +- t/t0020-crlf.sh | 8 +- t/t0021-conversion.sh | 40 +- t/t0027-auto-crlf.sh | 4 +- t/t0028-working-tree-encoding.sh | 4 +- t/t0041-usage.sh | 10 +- t/t0050-filesystem.sh | 6 +- t/t0060-path-utils.sh | 4 +- t/t0100-previous.sh | 18 +- t/t1004-read-tree-m-u-wf.sh | 40 +- t/t1008-read-tree-overlay.sh | 2 +- t/t1009-read-tree-new-index.sh | 4 +- t/t1011-read-tree-sparse-checkout.sh | 2 +- t/t1021-rerere-in-workdir.sh | 2 +- t/t1090-sparse-checkout-scope.sh | 10 +- t/t1091-sparse-checkout-builtin.sh | 2 +- t/t1300-config.sh | 8 +- t/t1301-shared-repo.sh | 4 +- t/t1305-config-include.sh | 2 +- t/t1309-early-config.sh | 4 +- t/t1400-update-ref.sh | 72 +-- t/t1402-check-ref-format.sh | 32 +- t/t1403-show-ref.sh | 18 +- t/t1405-main-ref-store.sh | 42 +- t/t1406-submodule-ref-store.sh | 30 +- t/t1407-worktree-ref-store.sh | 32 +- t/t1408-packed-refs.sh | 12 +- t/t1410-reflog.sh | 56 +- t/t1411-reflog-show.sh | 2 +- t/t1413-reflog-detach.sh | 24 +- t/t1414-reflog-walk.sh | 12 +- t/t1416-ref-transaction-hooks.sh | 10 +- t/t1430-bad-ref-name.sh | 52 +- t/t1450-fsck.sh | 2 +- t/t1500-rev-parse.sh | 4 +- t/t1503-rev-parse-verify.sh | 28 +- t/t1505-rev-parse-last.sh | 8 +- t/t1506-rev-parse-diagnosis.sh | 4 +- t/t1507-rev-parse-upstream.sh | 40 +- t/t1508-at-combinations.sh | 10 +- t/t1511-rev-parse-caret.sh | 26 +- t/t1512-rev-parse-disambiguation.sh | 2 +- t/t1513-rev-parse-prefix.sh | 4 +- t/t1514-rev-parse-push.sh | 16 +- t/t1700-split-index.sh | 2 +- t/t2007-checkout-symlink.sh | 10 +- t/t2009-checkout-statinfo.sh | 8 +- t/t2010-checkout-ambiguous.sh | 4 +- t/t2011-checkout-invalid-head.sh | 16 +- t/t2012-checkout-last.sh | 48 +- t/t2015-checkout-unborn.sh | 2 +- t/t2017-checkout-orphan.sh | 44 +- t/t2020-checkout-detach.sh | 28 +- t/t2022-checkout-paths.sh | 22 +- t/t2023-checkout-m.sh | 10 +- t/t2024-checkout-dwim.sh | 70 +-- t/t2027-checkout-track.sh | 6 +- t/t2030-unresolve-info.sh | 6 +- t/t2060-switch.sh | 30 +- t/t2070-restore.sh | 4 +- t/t2106-update-index-assume-unchanged.sh | 2 +- t/t2400-worktree-add.sh | 66 +-- t/t2401-worktree-prune.sh | 2 +- t/t2402-worktree-list.sh | 20 +- t/t2405-worktree-submodule.sh | 6 +- t/t3040-subprojects-basic.sh | 2 +- t/t3200-branch.sh | 248 ++++----- t/t3201-branch-contains.sh | 82 +-- t/t3202-show-branch-octopus.sh | 2 +- t/t3203-branch-output.sh | 40 +- t/t3204-branch-name-interpretation.sh | 6 +- t/t3205-branch-color.sh | 8 +- t/t3206-range-diff.sh | 40 +- t/t3206/history.export | 2 +- t/t3210-pack-refs.sh | 4 +- t/t3211-peel-ref.sh | 4 +- t/t3301-notes.sh | 6 +- t/t3302-notes-index-expensive.sh | 2 +- t/t3303-notes-subtrees.sh | 8 +- t/t3304-notes-mixed.sh | 8 +- t/t3308-notes-merge.sh | 2 +- t/t3320-notes-merge-worktrees.sh | 4 +- t/t3400-rebase.sh | 60 +-- t/t3402-rebase-merge.sh | 44 +- t/t3403-rebase-skip.sh | 6 +- t/t3405-rebase-malformed.sh | 8 +- t/t3406-rebase-message.sh | 24 +- t/t3407-rebase-abort.sh | 18 +- t/t3408-rebase-multi-line.sh | 2 +- t/t3409-rebase-preserve-merges.sh | 10 +- t/t3412-rebase-root.sh | 28 +- t/t3413-rebase-hook.sh | 42 +- t/t3415-rebase-autosquash.sh | 2 +- t/t3416-rebase-onto-threedots.sh | 54 +- t/t3418-rebase-continue.sh | 24 +- t/t3419-rebase-patch-id.sh | 12 +- t/t3420-rebase-autostash.sh | 8 +- t/t3423-rebase-reword.sh | 6 +- t/t3427-rebase-subtree.sh | 20 +- t/t3430-rebase-merges.sh | 16 +- t/t3431-rebase-fork-point.sh | 32 +- t/t3432-rebase-fast-forward.sh | 34 +- t/t3434-rebase-i18n.sh | 8 +- t/t3435-rebase-gpg-sign.sh | 4 +- t/t3436-rebase-more-options.sh | 2 +- t/t3500-cherry.sh | 12 +- t/t3501-revert-cherry-pick.sh | 4 +- t/t3502-cherry-pick-merge.sh | 2 +- t/t3503-cherry-pick-root.sh | 10 +- t/t3504-cherry-pick-rerere.sh | 24 +- t/t3505-cherry-pick-empty.sh | 24 +- t/t3506-cherry-pick-ff.sh | 8 +- t/t3507-cherry-pick-conflict.sh | 2 +- t/t3508-cherry-pick-many-commits.sh | 38 +- t/t3509-cherry-pick-merge-df.sh | 2 +- t/t3512-cherry-pick-submodule.sh | 2 +- t/t3600-rm.sh | 10 +- t/t3701-add-interactive.sh | 4 +- t/t3901-i18n-patch.sh | 40 +- t/t3903-stash.sh | 32 +- t/t3910-mac-os-precompose.sh | 6 +- t/t4014-format-patch.sh | 176 +++--- t/t4015-diff-whitespace.sh | 2 +- t/t4017-diff-retval.sh | 2 +- t/t4038-diff-combined.sh | 14 +- t/t4041-diff-submodule-option.sh | 2 +- t/t4048-diff-combined-binary.sh | 10 +- t/t4052-stat-output.sh | 4 +- t/t4056-diff-order.sh | 2 +- t/t4057-diff-combined-paths.sh | 20 +- t/t4061-diff-indent.sh | 24 +- t/t4066-diff-emit-delay.sh | 2 +- t/t4068-diff-symmetric-merge-base.sh | 48 +- t/t4103-apply-binary.sh | 36 +- t/t4108-apply-threeway.sh | 14 +- t/t4121-apply-diffs.sh | 2 +- t/t4122-apply-symlink-inside.sh | 6 +- t/t4150-am.sh | 26 +- t/t4200-rerere.sh | 20 +- t/t4201-shortlog.sh | 2 +- t/t4202-log.sh | 106 ++-- t/t4203-mailmap.sh | 2 +- t/t4204-patch-id.sh | 26 +- t/t4207-log-decoration-colors.sh | 6 +- t/t4208-log-magic-pathspec.sh | 4 +- t/t4211/history.export | 2 +- t/t4214-log-graph-octopus.sh | 2 +- t/t4216-log-bloom.sh | 4 +- t/t4253-am-keep-cr-dos.sh | 20 +- t/t4257-am-interactive.sh | 2 +- t/t5150-request-pull.sh | 34 +- t/t5304-prune.sh | 2 +- t/t5305-include-tag.sh | 2 +- t/t5312-prune-corruption.sh | 16 +- t/t5317-pack-objects-filter-objects.sh | 2 +- t/t5322-pack-objects-sparse.sh | 2 +- t/t5323-pack-redundant.sh | 66 +-- t/t5400-send-pack.sh | 60 +-- t/t5401-update-hooks.sh | 24 +- t/t5402-post-merge-hook.sh | 2 +- t/t5403-post-checkout-hook.sh | 6 +- t/t5404-tracking-branches.sh | 8 +- t/t5405-send-pack-rewind.sh | 6 +- t/t5407-post-rewrite-hook.sh | 2 +- t/t5410-receive-pack-alternates.sh | 4 +- t/t5500-fetch-pack.sh | 28 +- t/t5501-fetch-push-alternates.sh | 4 +- t/t5502-quickfetch.sh | 6 +- t/t5503-tagfollow.sh | 12 +- t/t5504-fetch-receive-strict.sh | 20 +- t/t5505-remote.sh | 148 +++--- t/t5506-remote-groups.sh | 4 +- t/t5509-fetch-push-namespaces.sh | 30 +- t/t5510-fetch.sh | 162 +++--- t/t5511-refspec.sh | 12 +- t/t5512-ls-remote.sh | 26 +- t/t5514-fetch-multiple.sh | 30 +- t/t5516-fetch-push.sh | 500 +++++++++--------- t/t5517-push-mirror.sh | 124 ++--- t/t5518-fetch-exit-status.sh | 6 +- t/t5519-push-alternates.sh | 12 +- t/t5520-pull.sh | 30 +- t/t5521-pull-options.sh | 16 +- t/t5523-push-upstream.sh | 30 +- t/t5527-fetch-odd-refs.sh | 14 +- t/t5528-push-default.sh | 98 ++-- t/t5529-push-errors.sh | 2 +- t/t5530-upload-pack-error.sh | 2 +- t/t5531-deep-submodule-push.sh | 188 +++---- t/t5533-push-cas.sh | 142 ++--- t/t5534-push-signed.sh | 4 +- t/t5537-fetch-shallow.sh | 30 +- t/t5538-push-shallow.sh | 22 +- t/t5539-fetch-http-shallow.sh | 14 +- t/t5540-http-push-webdav.sh | 8 +- t/t5541-http-push-smart.sh | 40 +- t/t5542-push-http-shallow.sh | 8 +- t/t5543-atomic-push.sh | 80 +-- t/t5545-push-options.sh | 62 +-- t/t5548-push-porcelain.sh | 64 +-- t/t5550-http-fetch-dumb.sh | 20 +- t/t5551-http-fetch-smart.sh | 20 +- t/t5552-skipping-fetch-negotiator.sh | 2 +- t/t5553-set-upstream.sh | 82 +-- t/t5561-http-backend.sh | 4 +- t/t556x_common | 8 +- t/t5570-git-daemon.sh | 16 +- t/t5571-pre-push-hook.sh | 4 +- t/t5572-pull-submodule.sh | 4 +- t/t5580-unc-paths.sh | 2 +- t/t5581-http-curl-verbose.sh | 2 +- t/t5582-fetch-negative-refspec.sh | 22 +- t/t5601-clone.sh | 4 +- t/t5604-clone-reference.sh | 12 +- t/t5605-clone-local.sh | 10 +- t/t5606-clone-options.sh | 8 +- t/t5607-clone-bundle.sh | 14 +- t/t5608-clone-2gb.sh | 2 +- t/t5609-clone-branch.sh | 6 +- t/t5610-clone-detached.sh | 4 +- t/t5611-clone-config.sh | 16 +- t/t5612-clone-refspec.sh | 42 +- t/t5614-clone-submodules-shallow.sh | 2 +- t/t5616-partial-clone.sh | 50 +- t/t5617-clone-submodules-remote.sh | 6 +- t/t5700-protocol-v1.sh | 16 +- t/t5701-git-serve.sh | 16 +- t/t5702-protocol-v2.sh | 50 +- t/t5703-upload-pack-ref-in-want.sh | 60 +-- t/t5801-remote-helpers.sh | 24 +- t/t6000-rev-list-misc.sh | 2 +- t/t6001-rev-list-graft.sh | 2 +- t/t6004-rev-list-path-optim.sh | 14 +- t/t6006-rev-list-format.sh | 14 +- t/t6007-rev-list-cherry-pick-file.sh | 4 +- t/t6008-rev-list-submodule.sh | 2 +- t/t6009-rev-list-parent.sh | 6 +- t/t6012-rev-list-simplify.sh | 8 +- t/t6013-rev-list-reverse-parents.sh | 10 +- t/t6016-rev-list-graph-simplify-history.sh | 2 +- t/t6017-rev-list-stdin.sh | 8 +- t/t6018-rev-list-glob.sh | 50 +- t/t6019-rev-list-ancestry-path.sh | 6 +- t/t6030-bisect-porcelain.sh | 10 +- t/t6040-tracking-info.sh | 54 +- t/t6050-replace.sh | 10 +- t/t6101-rev-parse-parents.sh | 2 +- t/t6110-rev-list-sparse.sh | 2 +- t/t6111-rev-list-treesame.sh | 6 +- t/t6112-rev-list-filters-objects.sh | 14 +- t/t6120-describe.sh | 20 +- t/t6200-fmt-merge-msg.sh | 50 +- t/t6302-for-each-ref-filter.sh | 58 +- t/t6400-merge-df.sh | 6 +- t/t6402-merge-rename.sh | 46 +- t/t6404-recursive-merge.sh | 4 +- t/t6405-merge-symlinks.sh | 14 +- t/t6406-merge-attr.sh | 24 +- t/t6407-merge-binary.sh | 6 +- t/t6409-merge-subtree.sh | 16 +- t/t6411-merge-filemode.sh | 10 +- t/t6412-merge-large-rename.sh | 6 +- t/t6413-merge-crlf.sh | 2 +- t/t6414-merge-rename-nocruft.sh | 2 +- t/t6415-merge-dir-to-symlink.sh | 22 +- t/t6416-recursive-corner-cases.sh | 28 +- t/t6417-merge-ours-theirs.sh | 28 +- t/t6418-merge-text-auto.sh | 12 +- t/t6419-merge-ignorecase.sh | 10 +- t/t6422-merge-rename-corner-cases.sh | 12 +- t/t6425-merge-rename-delete.sh | 2 +- t/t6427-diff3-conflict-markers.sh | 14 +- t/t6430-merge-recursive.sh | 18 +- t/t6432-merge-recursive-space-options.sh | 6 +- t/t6433-merge-toplevel.sh | 8 +- t/t6434-merge-recursive-rename-options.sh | 6 +- t/t6436-merge-overwrite.sh | 2 +- t/t6437-submodule-merge.sh | 14 +- t/t6439-merge-co-error-msgs.sh | 6 +- t/t6501-freshen-objects.sh | 2 +- t/t7003-filter-branch.sh | 40 +- t/t7004-tag.sh | 8 +- t/t7030-verify-tag.sh | 2 +- t/t7060-wtstatus.sh | 26 +- t/t7063-status-untracked-cache.sh | 14 +- t/t7102-reset.sh | 6 +- t/t7113-post-index-change-hook.sh | 2 +- t/t7201-co.sh | 110 ++-- t/t7400-submodule-basic.sh | 20 +- t/t7403-submodule-sync.sh | 10 +- t/t7406-submodule-update.sh | 38 +- t/t7407-submodule-foreach.sh | 24 +- t/t7409-submodule-detached-work-tree.sh | 8 +- t/t7417-submodule-path-url.sh | 2 +- t/t7501-commit-basic-functionality.sh | 2 +- t/t7502-commit-porcelain.sh | 12 +- ...3-pre-commit-and-pre-merge-commit-hooks.sh | 42 +- t/t7504-commit-msg-hook.sh | 24 +- t/t7505-prepare-commit-msg-hook.sh | 20 +- t/t7508-status.sh | 58 +- t/t7510-signed-commit.sh | 2 +- t/t7512-status-help.sh | 40 +- t/t7517-per-repo-email.sh | 12 +- t/t7600-merge.sh | 44 +- t/t7606-merge-custom.sh | 2 +- t/t7608-merge-messages.sh | 36 +- t/t7610-mergetool.sh | 174 +++--- t/t7611-merge-abort.sh | 4 +- t/t7612-merge-verify-signatures.sh | 2 +- t/t7614-merge-signoff.sh | 24 +- t/t7701-repack-unpack-unreachable.sh | 2 +- t/t7800-difftool.sh | 38 +- t/t7810-grep.sh | 28 +- t/t8001-annotate.sh | 2 +- t/t8003-blame-corner-cases.sh | 4 +- t/t8004-blame-with-conflicts.sh | 14 +- t/t9001-send-email.sh | 28 +- t/t9100-git-svn-basic.sh | 2 +- t/t9145-git-svn-master-branch.sh | 6 +- t/t9151-svn-mergeinfo.sh | 2 +- t/t9155-git-svn-fetch-deleted-tag.sh | 2 +- t/t9156-git-svn-fetch-deleted-tag-2.sh | 6 +- t/t9163-git-svn-reset-clears-caches.sh | 2 +- t/t9169-git-svn-dcommit-crlf.sh | 2 +- t/t9300-fast-import.sh | 82 +-- t/t9301-fast-import-notes.sh | 14 +- t/t9302-fast-import-unpack-limit.sh | 16 +- t/t9350-fast-export.sh | 86 +-- t/t9351-fast-export-anonymize.sh | 4 +- t/t9400-git-cvsserver-server.sh | 32 +- t/t9401-git-cvsserver-crlf.sh | 16 +- t/t9402-git-cvsserver-refs.sh | 8 +- t/t9500-gitweb-standalone-no-errors.sh | 20 +- t/t9501-gitweb-standalone-http-status.sh | 14 +- t/t9502-gitweb-standalone-parse-output.sh | 16 +- t/t9600-cvsimport.sh | 2 +- t/t9601-cvsimport-vendor-branch.sh | 16 +- t/t9602-cvsimport-branches-tags.sh | 4 +- t/t9603-cvsimport-patchsets.sh | 8 +- t/t9800-git-p4-basic.sh | 2 +- t/t9801-git-p4-branch.sh | 16 +- t/t9806-git-p4-options.sh | 18 +- t/t9807-git-p4-submit.sh | 2 +- t/t9811-git-p4-label-import.sh | 2 +- t/t9903-bash-prompt.sh | 114 ++-- t/test-lib.sh | 13 + 348 files changed, 3879 insertions(+), 3866 deletions(-)
base-commit: aff20da3a209088e7f8f3632077fa11b86453d67
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-762%2Fdscho%2Fuse-main-as-default-branch-name-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-762/dscho/use-main-as-default-branch-name-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/762
Range-diff vs v1:
1: 0a05d319c0 = 1: 0a05d319c0 t0060: preemptively adjust alignment
2: 830130fa9f ! 2: b8fa037791 t[01]*: adjust the references to the default branch name "main"
@@ Commit message
$ (cd t &&
sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
- -e 's/Master/Main/g' -- t[01]*.sh)
+ -e 's/Master/Main/g' -e 's/naster/nain/g' -- t[01]*.sh)
+
+ Note that t5533 contains a variation of the name `master` (`naster`)
+ that we rename here, too.
This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for those tests.
+ Helped-by: Ævar Arnfjörð Bjarmason <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
## t/t0002-gitfile.sh ##
@@ t/t1402-check-ref-format.sh: valid_ref !MINGW "$ref" '--refspec-pattern --allow-
- test "$refname2" = master'
+ test "$refname2" = main'
- test_expect_success 'check-ref-format --branch -naster' '
- test_must_fail git check-ref-format --branch -naster >actual &&
+-test_expect_success 'check-ref-format --branch -naster' '
+- test_must_fail git check-ref-format --branch -naster >actual &&
++test_expect_success 'check-ref-format --branch -nain' '
++ test_must_fail git check-ref-format --branch -nain >actual &&
+ test_must_be_empty actual
+ '
+
@@ t/t1402-check-ref-format.sh: test_expect_success 'check-ref-format --branch from subdir' '
T=$(git write-tree) &&
3: 9b368b1ce1 = 3: 0d4f1275f7 t2*: adjust the references to the default branch name "main"
4: 0697ef9742 = 4: aee29a0528 t3[0-3]*: adjust the references to the default branch name "main"
5: e494152c3e = 5: 041ad86e33 t3416: preemptively adjust alignment in a comment
6: ec7102156e = 6: 2f62b3f469 t34*: adjust the references to the default branch name "main"
7: 7a9349653d = 7: 0cf754646e t3[5-9]*: adjust the references to the default branch name "main"
8: d141e476b1 = 8: cf6c1d1d83 t4*: adjust the references to the default branch name "main"
9: 86c85666d5 = 9: 6ff4594a28 t5323: prepare centered comment for `master` -> `main`
10: 55b6c04fc0 = 10: be29e07892 t5[0-4]*: adjust the references to the default branch name "main"
11: 40cdd5db8c = 11: 5126d90a32 t5503: prepare aligned comment for replacing `master` with `main`
12: b5ca6e9acd = 12: 332677cbf9 t550*: adjust the references to the default branch name "main"
13: 727de6fdf5 = 13: b7333ef201 t551*: adjust the references to the default branch name "main"
14: 3aef39320e ! 14: 4b1b1ee51f t55[23]*: adjust the references to the default branch name "main" @@ Metadata
## Commit message ##
t55[23]*: adjust the references to the default branch name "main"
- This trick was performed via
+ Carefully excluding t5526, which sees independent development elsewhere
+ at the time of writing, we use main as the default branch name in
+ t55[23]*. This trick was performed via
$ (cd t &&
sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
- -e 's/Master/Main/g' -e 's/naster/nain/g' -- t55[23]*.sh)
+ -e 's/Master/Main/g' -e 's/naster/nain/g' -- \
+ t55[23]*.sh &&
+ git checkout HEAD -- t5526\*)
Note that t5533 contains a variation of the name master (naster) that we rename here, too.
@@ t/t5523-push-upstream.sh: test_expect_success TTY 'push --no-progress suppresses
'
- ## t/t5526-fetch-submodules.sh ##
-@@ t/t5526-fetch-submodules.sh: test_expect_success PREPARE_FOR_MAIN_BRANCH "don't fetch submodule when newly re
- test_i18ncmp expect.err actual.err &&
- (
- cd submodule &&
-- git checkout -q master
-+ git checkout -q main
- )
- '
-
-@@ t/t5526-fetch-submodules.sh: test_expect_success 'fetch new submodule commits on-demand without .gitmodules e
- git config -f .gitmodules --remove-section submodule.sub1 &&
- git add .gitmodules &&
- git commit -m "delete gitmodules file" &&
-- git checkout -B master &&
-+ git checkout -B main &&
- git -C downstream fetch &&
-- git -C downstream checkout origin/master &&
-+ git -C downstream checkout origin/main &&
-
- C=$(git -C submodule commit-tree -m "yet another change outside refs/heads" HEAD^{tree}) &&
- git -C submodule update-ref refs/changes/7 $C &&
-
## t/t5527-fetch-odd-refs.sh ##
@@ t/t5527-fetch-odd-refs.sh: test_description='test fetching of oddly-named refs'
@@ t/t5539-fetch-http-shallow.sh: test_expect_success 'fetching deepen' '
three
## t/test-lib.sh ##
-@@ t/test-lib.sh: case "$TEST_NUMBER" in +@@ t/test-lib.sh: case "$TRASH_DIRECTORY" in
+ esac
+
+ case "$TEST_NUMBER" in +-3404|4013|5310) ++3404|4013|5310|5526)
+ # Avoid conflicts with patch series that are cooking at the same time
+ # as the patch series changing the default of init.defaultBranch.
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME ;;
15: 8a2511b38e = 15: c37d97c2d8 t55[4-9]*: adjust the references to the default branch name "main" 16: af24b6d69d = 16: dda6ce098c t5[6-9]*: adjust the references to the default branch name "main" 17: dc8011e4bf ! 17: 27d7994933 t6[0-3]*: adjust the references to the default branch name "main"
@@ t/test-lib.sh: case "$TRASH_DIRECTORY" in
esac
case "$TEST_NUMBER" in
--3404|4013|5310)
-+3404|4013|5310|6300)
+-3404|4013|5310|5526)
++3404|4013|5310|5526|6300)
# Avoid conflicts with patch series that are cooking at the same time # as the patch series changing the default of init.defaultBranch. GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
18: e2f1409399 = 18: 04878e2268 t64*: preemptively adjust alignment to prepare for `master` -> `main` 19: 1ef276c97e = 19: f0fa12b577 t6[4-9]*: adjust the references to the default branch name "main" 20: 7f67471c03 ! 20: f9c30dc516 t7[0-4]*: adjust the references to the default branch name "main"
@@ t/test-lib.sh: case "$TRASH_DIRECTORY" in
esac
case "$TEST_NUMBER" in
--3404|4013|5310|6300)
-+3404|4013|5310|6300|7064)
+-3404|4013|5310|5526|6300)
++3404|4013|5310|5526|6300|7064)
# Avoid conflicts with patch series that are cooking at the same time
# as the patch series changing the default of init.defaultBranch. GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
21: 07714a8c65 ! 21: 2b269ca983 t7[5-9]*: adjust the references to the default branch name "main"
@@ t/test-lib.sh: case "$TRASH_DIRECTORY" in
esac
case "$TEST_NUMBER" in
--3404|4013|5310|6300|7064)
-+3404|4013|5310|6300|7064|7817) +-3404|4013|5310|5526|6300|7064) ++3404|4013|5310|5526|6300|7064|7817)
# Avoid conflicts with patch series that are cooking at the same time # as the patch series changing the default of init.defaultBranch. GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
22: 3a987c452e = 22: 5cac0065c8 t8*: adjust the references to the default branch name "main" 23: e788b61074 = 23: 57e90d459a t9[0-4]*: adjust the references to the default branch name "main" 24: 2367a322c8 = 24: f9e01de17f t9[5-7]*: adjust the references to the default branch name "main" 25: bd32d55eab = 25: 4da4b69114 tests(git-p4): transition to the default branch name `main` 26: 73100477a8 ! 26: cfa29c7f71 t99*: adjust the references to the default branch name "main"
@@ t/test-lib.sh: case "$TRASH_DIRECTORY" in
esac
case "$TEST_NUMBER" in
--3404|4013|5310|6300|7064|7817)
-+3404|4013|5310|6300|7064|7817|9902)
+-3404|4013|5310|5526|6300|7064|7817)
++3404|4013|5310|5526|6300|7064|7817|9902)
# Avoid conflicts with patch series that are cooking at the same time
# as the patch series changing the default of init.defaultBranch. GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
27: 09b611a359 ! 27: fc0c1f6463 tests: drop prereq PREPARE_FOR_MAIN_BRANCH where no longer needed
@@ Commit message
master -> main rename before the automatable ones.
Now that the transition is almost complete, we can stop using it in most
- instances. The only exception is t9902: at the time of writing, there
- are other patches in flight that touch this test script, therefore the
- transition to main is postponed to a later date.
+ instances. The only two exceptions are t5526 and t9902: at the time of
+ writing, there are other patches in flight that touch these test
+ scripts, therefore their transition to main is postponed to a later
+ date.
This patch is the result of this command:
sed -i 's/PREPARE_FOR_MAIN_BRANCH[ ,]//' t/t[0-9]*.sh &&
- git checkout HEAD -- t/t9902\*
+ git checkout HEAD -- t/t5526\* t/t9902\*
@@ t/t5510-fetch.sh: test_expect_success PREPARE_FOR_MAIN_BRANCH,C_LOCALE_OUTPUT 'f
test_commit extraaa &&
(
- ## t/t5526-fetch-submodules.sh ##
-@@ t/t5526-fetch-submodules.sh: test_expect_success setup '
- )
- '
-
--test_expect_success PREPARE_FOR_MAIN_BRANCH "fetch --recurse-submodules recurses into submodules" '
-+test_expect_success "fetch --recurse-submodules recurses into submodules" '
- add_upstream_commit &&
- (
- cd downstream &&
-@@ t/t5526-fetch-submodules.sh: test_expect_success PREPARE_FOR_MAIN_BRANCH "fetch --recurse-submodules recurses
- test_i18ncmp expect.err actual.err
- '
-
--test_expect_success PREPARE_FOR_MAIN_BRANCH "submodule.recurse option triggers recursive fetch" '
-+test_expect_success "submodule.recurse option triggers recursive fetch" '
- add_upstream_commit &&
- (
- cd downstream &&
-@@ t/t5526-fetch-submodules.sh: test_expect_success PREPARE_FOR_MAIN_BRANCH "submodule.recurse option triggers r
- test_i18ncmp expect.err actual.err
- '
-
--test_expect_success PREPARE_FOR_MAIN_BRANCH "fetch --recurse-submodules -j2 has the same output behaviour" '
-+test_expect_success "fetch --recurse-submodules -j2 has the same output behaviour" '
- add_upstream_commit &&
- (
- cd downstream &&
-@@ t/t5526-fetch-submodules.sh: test_expect_success "fetch --no-recurse-submodules only fetches superproject" '
- test_must_be_empty actual.err
- '
-
--test_expect_success PREPARE_FOR_MAIN_BRANCH "using fetchRecurseSubmodules=true in .gitmodules recurses into submodules" ' -+test_expect_success "using fetchRecurseSubmodules=true in .gitmodules recurses into submodules" '
- (
- cd downstream &&
- git config -f .gitmodules submodule.submodule.fetchRecurseSubmodules true &&
-@@ t/t5526-fetch-submodules.sh: test_expect_success "using fetchRecurseSubmodules=false in .git/config overrides
- test_must_be_empty actual.err
- '
-
--test_expect_success PREPARE_FOR_MAIN_BRANCH "--recurse-submodules overrides fetchRecurseSubmodules setting from .git/config" ' -+test_expect_success "--recurse-submodules overrides fetchRecurseSubmodules setting from .git/config" '
- (
- cd downstream &&
- git fetch --recurse-submodules >../actual.out 2>../actual.err &&
-@@ t/t5526-fetch-submodules.sh: test_expect_success "--quiet propagates to parallel submodules" '
- test_must_be_empty actual.err
- '
-
--test_expect_success PREPARE_FOR_MAIN_BRANCH "--dry-run propagates to submodules" '
-+test_expect_success "--dry-run propagates to submodules" '
- add_upstream_commit &&
- (
- cd downstream &&
-@@ t/t5526-fetch-submodules.sh: test_expect_success PREPARE_FOR_MAIN_BRANCH "--dry-run propagates to submodules"
- test_i18ncmp expect.err actual.err
- '
-
--test_expect_success PREPARE_FOR_MAIN_BRANCH "Without --dry-run propagates to submodules" '
-+test_expect_success "Without --dry-run propagates to submodules" '
- (
- cd downstream &&
- git fetch --recurse-submodules >../actual.out 2>../actual.err
-@@ t/t5526-fetch-submodules.sh: test_expect_success PREPARE_FOR_MAIN_BRANCH "Without --dry-run propagates to sub
- test_i18ncmp expect.err actual.err
- '
-
--test_expect_success PREPARE_FOR_MAIN_BRANCH "recurseSubmodules=true propagates into submodules" '
-+test_expect_success "recurseSubmodules=true propagates into submodules" '
- add_upstream_commit &&
- (
- cd downstream &&
-@@ t/t5526-fetch-submodules.sh: test_expect_success PREPARE_FOR_MAIN_BRANCH "recurseSubmodules=true propagates i
- test_i18ncmp expect.err actual.err
- '
-
--test_expect_success PREPARE_FOR_MAIN_BRANCH "--recurse-submodules overrides config in submodule" '
-+test_expect_success "--recurse-submodules overrides config in submodule" '
- add_upstream_commit &&
- (
- cd downstream &&
-@@ t/t5526-fetch-submodules.sh: test_expect_success "--no-recurse-submodules overrides config setting" '
- test_must_be_empty actual.err
- '
-
--test_expect_success PREPARE_FOR_MAIN_BRANCH "Recursion doesn't happen when no new commits are fetched in the superproject" ' -+test_expect_success "Recursion doesn't happen when no new commits are fetched in the superproject" '
- (
- cd downstream &&
- (
-@@ t/t5526-fetch-submodules.sh: test_expect_success PREPARE_FOR_MAIN_BRANCH "Recursion doesn't happen when no ne
- test_must_be_empty actual.err
- '
-
--test_expect_success PREPARE_FOR_MAIN_BRANCH "Recursion stops when no new submodule commits are fetched" '
-+test_expect_success "Recursion stops when no new submodule commits are fetched" '
- head1=$(git rev-parse --short HEAD) &&
- git add submodule &&
- git commit -m "new submodule" &&
-@@ t/t5526-fetch-submodules.sh: test_expect_success PREPARE_FOR_MAIN_BRANCH "Recursion stops when no new submodu
- test_must_be_empty actual.out
- '
-
--test_expect_success PREPARE_FOR_MAIN_BRANCH "Recursion doesn't happen when new superproject commits don't change any submodules" ' -+test_expect_success "Recursion doesn't happen when new superproject commits don't change any submodules" '
- add_upstream_commit &&
- head1=$(git rev-parse --short HEAD) &&
- echo a > file &&
-@@ t/t5526-fetch-submodules.sh: test_expect_success PREPARE_FOR_MAIN_BRANCH "Recursion doesn't happen when new s
- test_i18ncmp expect.err.file actual.err
- '
-
--test_expect_success PREPARE_FOR_MAIN_BRANCH "Recursion picks up config in submodule" '
-+test_expect_success "Recursion picks up config in submodule" '
- (
- cd downstream &&
- git fetch --recurse-submodules &&
-@@ t/t5526-fetch-submodules.sh: test_expect_success PREPARE_FOR_MAIN_BRANCH "Recursion picks up config in submod
- test_must_be_empty actual.out
- '
-
--test_expect_success PREPARE_FOR_MAIN_BRANCH "Recursion picks up all submodules when necessary" '
-+test_expect_success "Recursion picks up all submodules when necessary" '
- add_upstream_commit &&
- (
- cd submodule &&
-@@ t/t5526-fetch-submodules.sh: test_expect_success PREPARE_FOR_MAIN_BRANCH "Recursion picks up all submodules w
- test_must_be_empty actual.out
- '
-
--test_expect_success PREPARE_FOR_MAIN_BRANCH "'--recurse-submodules=on-demand' doesn't recurse when no new commits are fetched in the superproject (and ignores config)" ' -+test_expect_success "'--recurse-submodules=on-demand' doesn't recurse when no new commits are fetched in the superproject (and ignores config)" '
- add_upstream_commit &&
- (
- cd submodule &&
-@@ t/t5526-fetch-submodules.sh: test_expect_success PREPARE_FOR_MAIN_BRANCH "'--recurse-submodules=on-demand' do
- test_must_be_empty actual.err
- '
-
--test_expect_success PREPARE_FOR_MAIN_BRANCH "'--recurse-submodules=on-demand' recurses as deep as necessary (and ignores config)" ' -+test_expect_success "'--recurse-submodules=on-demand' recurses as deep as necessary (and ignores config)" '
- head1=$(git rev-parse --short HEAD) &&
- git add submodule &&
- git commit -m "new submodule" &&
-@@ t/t5526-fetch-submodules.sh: test_expect_success PREPARE_FOR_MAIN_BRANCH "'--recurse-submodules=on-demand' re
- test_i18ncmp expect.err actual.err
- '
-
--test_expect_success PREPARE_FOR_MAIN_BRANCH "'--recurse-submodules=on-demand' stops when no new submodule commits are found in the superproject (and ignores config)" ' -+test_expect_success "'--recurse-submodules=on-demand' stops when no new submodule commits are found in the superproject (and ignores config)" '
- add_upstream_commit &&
- head1=$(git rev-parse --short HEAD) &&
- echo a >> file &&
-@@ t/t5526-fetch-submodules.sh: test_expect_success PREPARE_FOR_MAIN_BRANCH "'--recurse-submodules=on-demand' st
- test_i18ncmp expect.err.file actual.err
- '
-
--test_expect_success PREPARE_FOR_MAIN_BRANCH "'fetch.recurseSubmodules=on-demand' overrides global config" '
-+test_expect_success "'fetch.recurseSubmodules=on-demand' overrides global config" '
- (
- cd downstream &&
- git fetch --recurse-submodules
-@@ t/t5526-fetch-submodules.sh: test_expect_success PREPARE_FOR_MAIN_BRANCH "'fetch.recurseSubmodules=on-demand'
- test_i18ncmp expect.err.2 actual.err
- '
-
--test_expect_success PREPARE_FOR_MAIN_BRANCH "'submodule.<sub>.fetchRecurseSubmodules=on-demand' overrides fetch.recurseSubmodules" ' -+test_expect_success "'submodule.<sub>.fetchRecurseSubmodules=on-demand' overrides fetch.recurseSubmodules" '
- (
- cd downstream &&
- git fetch --recurse-submodules
-@@ t/t5526-fetch-submodules.sh: test_expect_success PREPARE_FOR_MAIN_BRANCH "'submodule.<sub>.fetchRecurseSubmod
- test_i18ncmp expect.err.2 actual.err
- '
-
--test_expect_success PREPARE_FOR_MAIN_BRANCH "don't fetch submodule when newly recorded commits are already present" '
-+test_expect_success "don't fetch submodule when newly recorded commits are already present" '
- (
- cd submodule &&
- git checkout -q HEAD^^
-@@ t/t5526-fetch-submodules.sh: test_expect_success PREPARE_FOR_MAIN_BRANCH "don't fetch submodule when newly re
- )
- '
-
--test_expect_success PREPARE_FOR_MAIN_BRANCH "'fetch.recurseSubmodules=on-demand' works also without .gitmodules entry" ' -+test_expect_success "'fetch.recurseSubmodules=on-demand' works also without .gitmodules entry" '
- (
- cd downstream &&
- git fetch --recurse-submodules
-
## t/t5703-upload-pack-ref-in-want.sh ##
@@ t/t5703-upload-pack-ref-in-want.sh: test_expect_success 'server is initially behind - ref in want' '
test_cmp expected actual
28: f853fa946f < -: ---------- Change the default branch name to main
Signature · 1 line
gitgitgadget
PATCH v2 1/27 t0060: preemptively adjust alignment
From: Johannes Schindelin <[email protected]>
We are about to adjust t0060 for the new default branch name main. This name is two characters shorter and therefore needs two spaces more padding to align correctly.
Adjusting the alignment before the big search-and-replace makes it easier to verify that the final result does not leave any misaligned lines behind.
--- t/t0060-path-utils.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
t/t0060-path-utils.sh +2 -2
@@ -312,8 +312,8 @@ test_git_path GIT_COMMON_DIR=bar info/sparse-checkout .git/info/sparse-check test_git_path GIT_COMMON_DIR=bar info//sparse-checkout .git/info//sparse-checkout test_git_path GIT_COMMON_DIR=bar remotes/bar bar/remotes/bar test_git_path GIT_COMMON_DIR=bar branches/bar bar/branches/bar -test_git_path GIT_COMMON_DIR=bar logs/refs/heads/master bar/logs/refs/heads/master -test_git_path GIT_COMMON_DIR=bar refs/heads/master bar/refs/heads/master +test_git_path GIT_COMMON_DIR=bar logs/refs/heads/master bar/logs/refs/heads/master +test_git_path GIT_COMMON_DIR=bar refs/heads/master bar/refs/heads/master test_git_path GIT_COMMON_DIR=bar refs/bisect/foo .git/refs/bisect/foo test_git_path GIT_COMMON_DIR=bar hooks/me bar/hooks/me test_git_path GIT_COMMON_DIR=bar config bar/config
Signature · 1 line
gitgitgadget
PATCH v2 2/27 t[01]*: adjust the references to the default branch name "main"
In reply to Johannes Schindelin via GitGitGadgetFrom: Johannes Schindelin <[email protected]>
This trick was performed via
$ (cd t && sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \ -e 's/Master/Main/g' -e 's/naster/nain/g' -- t[01]*.sh)
Note that t5533 contains a variation of the name master (naster) that we rename here, too.
This allows us to define GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main for those tests.
--- t/t0002-gitfile.sh | 6 +-- t/t0020-crlf.sh | 8 ++-- t/t0021-conversion.sh | 40 ++++++++-------- t/t0027-auto-crlf.sh | 4 +- t/t0028-working-tree-encoding.sh | 4 +- t/t0041-usage.sh | 10 ++-- t/t0050-filesystem.sh | 6 +-- t/t0060-path-utils.sh | 4 +- t/t0100-previous.sh | 18 ++++---- t/t1004-read-tree-m-u-wf.sh | 40 ++++++++-------- t/t1008-read-tree-overlay.sh | 2 +- t/t1009-read-tree-new-index.sh | 4 +- t/t1011-read-tree-sparse-checkout.sh | 2 +- t/t1021-rerere-in-workdir.sh | 2 +- t/t1090-sparse-checkout-scope.sh | 10 ++-- t/t1091-sparse-checkout-builtin.sh | 2 +- t/t1300-config.sh | 8 ++-- t/t1301-shared-repo.sh | 4 +- t/t1305-config-include.sh | 2 +- t/t1309-early-config.sh | 4 +- t/t1400-update-ref.sh | 68 ++++++++++++++-------------- t/t1402-check-ref-format.sh | 32 ++++++------- t/t1403-show-ref.sh | 18 ++++---- t/t1405-main-ref-store.sh | 42 ++++++++--------- t/t1406-submodule-ref-store.sh | 30 ++++++------ t/t1407-worktree-ref-store.sh | 32 ++++++------- t/t1408-packed-refs.sh | 12 ++--- t/t1410-reflog.sh | 56 +++++++++++------------ t/t1411-reflog-show.sh | 2 +- t/t1413-reflog-detach.sh | 24 +++++----- t/t1414-reflog-walk.sh | 12 ++--- t/t1416-ref-transaction-hooks.sh | 10 ++-- t/t1430-bad-ref-name.sh | 52 ++++++++++----------- t/t1450-fsck.sh | 2 +- t/t1500-rev-parse.sh | 4 +- t/t1503-rev-parse-verify.sh | 28 ++++++------ t/t1505-rev-parse-last.sh | 8 ++-- t/t1506-rev-parse-diagnosis.sh | 4 +- t/t1507-rev-parse-upstream.sh | 40 ++++++++-------- t/t1508-at-combinations.sh | 10 ++-- t/t1511-rev-parse-caret.sh | 26 +++++------ t/t1512-rev-parse-disambiguation.sh | 2 +- t/t1513-rev-parse-prefix.sh | 4 +- t/t1514-rev-parse-push.sh | 16 +++---- t/t1700-split-index.sh | 2 +- t/test-lib.sh | 7 +++ 46 files changed, 365 insertions(+), 358 deletions(-)
t/t0002-gitfile.sh +3 -3
@@ -96,7 +96,7 @@ test_expect_success 'enter_repo non-strict mode' ' git ls-remote enter_repo >actual && cat >expected <<-EOF && $head HEAD - $head refs/heads/master + $head refs/heads/main $head refs/tags/foo EOF test_cmp expected actual
@@ -111,7 +111,7 @@ test_expect_success 'enter_repo linked checkout' ' git ls-remote foo >actual && cat >expected <<-EOF && $head HEAD - $head refs/heads/master + $head refs/heads/main $head refs/tags/foo EOF test_cmp expected actual
@@ -122,7 +122,7 @@ test_expect_success 'enter_repo strict mode' ' git ls-remote --upload-pack="git upload-pack --strict" foo/.git >actual && cat >expected <<-EOF && $head HEAD - $head refs/heads/master + $head refs/heads/main $head refs/tags/foo EOF test_cmp expected actual
t/t0020-crlf.sh +4 -4
@@ -318,8 +318,8 @@ test_expect_success 'checkout with existing .gitattributes' ' git add .gitattributes .file && git commit -m second && - git checkout master~1 && - git checkout master && + git checkout main~1 && + git checkout main && test "$(git diff-files --raw)" = "" '
@@ -331,8 +331,8 @@ test_expect_success 'checkout when deleting .gitattributes' ' git add .file2 && git commit -m third && - git checkout master~1 && - git checkout master && + git checkout main~1 && + git checkout main && has_cr .file2 '
t/t0021-conversion.sh +20 -20
@@ -378,8 +378,8 @@ test_expect_success PERL 'required process filter should filter data' ' test_cmp_count expected.log debug.log && git commit -m "test commit 2" && - MASTER=$(git rev-parse --verify master) && - META="ref=refs/heads/master treeish=$MASTER" && + MAIN=$(git rev-parse --verify main) && + META="ref=refs/heads/main treeish=$MAIN" && rm -f test2.r "testsubdir/test3 '\''sq'\'',\$x=.r" && filter_git checkout --quiet --no-progress . &&
@@ -404,7 +404,7 @@ test_expect_success PERL 'required process filter should filter data' ' EOF test_cmp_exclude_clean expected.log debug.log && - filter_git checkout --quiet --no-progress master && + filter_git checkout --quiet --no-progress main && cat >expected.log <<-EOF && START init handshake complete
@@ -436,15 +436,15 @@ test_expect_success PERL 'required process filter should filter data for various M3=$(git hash-object "testsubdir/test3 '\''sq'\'',\$x=.r") && EMPTY=$(git hash-object /dev/null) && - MASTER=$(git rev-parse --verify master) && + MAIN=$(git rev-parse --verify main) && cp "$TEST_ROOT/test.o" test5.r && git add test5.r && git commit -m "test commit 3" && git checkout empty-branch && - filter_git rebase --onto empty-branch master^^ master && - MASTER2=$(git rev-parse --verify master) && - META="ref=refs/heads/master treeish=$MASTER2" && + filter_git rebase --onto empty-branch main^^ main && + MAIN2=$(git rev-parse --verify main) && + META="ref=refs/heads/main treeish=$MAIN2" && cat >expected.log <<-EOF && START init handshake complete
@@ -458,8 +458,8 @@ test_expect_success PERL 'required process filter should filter data for various test_cmp_exclude_clean expected.log debug.log && git reset --hard empty-branch && - filter_git reset --hard $MASTER && - META="treeish=$MASTER" && + filter_git reset --hard $MAIN && + META="treeish=$MAIN" && cat >expected.log <<-EOF && START init handshake complete
@@ -471,10 +471,10 @@ test_expect_success PERL 'required process filter should filter data for various EOF test_cmp_exclude_clean expected.log debug.log && - git branch old-master $MASTER && + git branch old-main $MAIN && git reset --hard empty-branch && - filter_git reset --hard old-master && - META="ref=refs/heads/old-master treeish=$MASTER" && + filter_git reset --hard old-main && + META="ref=refs/heads/old-main treeish=$MAIN" && cat >expected.log <<-EOF && START init handshake complete
@@ -487,9 +487,9 @@ test_expect_success PERL 'required process filter should filter data for various test_cmp_exclude_clean expected.log debug.log && git checkout -b merge empty-branch && - git branch -f master $MASTER2 && - filter_git merge master && - META="treeish=$MASTER2" && + git branch -f main $MAIN2 && + filter_git merge main && + META="treeish=$MAIN2" && cat >expected.log <<-EOF && START init handshake complete
@@ -502,8 +502,8 @@ test_expect_success PERL 'required process filter should filter data for various EOF test_cmp_exclude_clean expected.log debug.log && - filter_git archive master >/dev/null && - META="ref=refs/heads/master treeish=$MASTER2" && + filter_git archive main >/dev/null && + META="ref=refs/heads/main treeish=$MAIN2" && cat >expected.log <<-EOF && START init handshake complete
@@ -516,7 +516,7 @@ test_expect_success PERL 'required process filter should filter data for various EOF test_cmp_exclude_clean expected.log debug.log && - TREE="$(git rev-parse $MASTER2^{tree})" && + TREE="$(git rev-parse $MAIN2^{tree})" && filter_git archive $TREE >/dev/null && META="treeish=$TREE" && cat >expected.log <<-EOF &&
@@ -856,8 +856,8 @@ test_expect_success PERL 'delayed checkout in process filter' ' ) && S=$(test_file_size "$TEST_ROOT/test.o") && - PM="ref=refs/heads/master treeish=$(git -C repo rev-parse --verify master) " && - M="${PM}blob=$(git -C repo rev-parse --verify master:test.a)" && + PM="ref=refs/heads/main treeish=$(git -C repo rev-parse --verify main) " && + M="${PM}blob=$(git -C repo rev-parse --verify main:test.a)" && cat >a.exp <<-EOF && START init handshake complete
t/t0027-auto-crlf.sh +2 -2
@@ -368,9 +368,9 @@ test_expect_success 'ls-files --eol -o Text/Binary' ' test_cmp expect actual ' -test_expect_success 'setup master' ' +test_expect_success 'setup main' ' echo >.gitattributes && - git checkout -b master && + git checkout -b main && git add .gitattributes && git commit -m "add .gitattributes" . && printf "\$Id: 0000000000000000000000000000000000000000 \$\nLINEONE\nLINETWO\nLINETHREE" >LF &&
t/t0028-working-tree-encoding.sh +2 -2
@@ -215,7 +215,7 @@ test_expect_success 'error if encoding round trip is not the same during refresh TEST_HASH=$(git hash-object --no-filters -w nonsense.utf16le) && git update-index --add --cacheinfo 100644 $TEST_HASH nonsense.utf16le && COMMIT=$(git commit-tree -p $(git rev-parse HEAD) -m "plain commit" $(git write-tree)) && - git update-ref refs/heads/master $COMMIT && + git update-ref refs/heads/main $COMMIT && test_must_fail git checkout HEAD^ 2>err.out && test_i18ngrep "error: .* overwritten by checkout:" err.out
@@ -231,7 +231,7 @@ test_expect_success 'error if encoding garbage is already in Git' ' TEST_HASH=$(git hash-object --no-filters -w nonsense.utf16) && git update-index --add --cacheinfo 100644 $TEST_HASH nonsense.utf16 && COMMIT=$(git commit-tree -p $(git rev-parse HEAD) -m "plain commit" $(git write-tree)) && - git update-ref refs/heads/master $COMMIT && + git update-ref refs/heads/main $COMMIT && git diff 2>err.out && test_i18ngrep "error: BOM is required" err.out
t/t0041-usage.sh +5 -5
@@ -41,8 +41,8 @@ test_expect_success 'tag usage error' ' ' test_expect_success 'branch --contains <existent_commit>' ' - git branch --contains "master" >actual 2>actual.err && - test_i18ngrep "master" actual && + git branch --contains "main" >actual 2>actual.err && + test_i18ngrep "main" actual && test_line_count = 0 actual.err '
@@ -54,7 +54,7 @@ test_expect_success 'branch --contains <inexistent_commit>' ' ' test_expect_success 'branch --no-contains <existent_commit>' ' - git branch --no-contains "master" >actual 2>actual.err && + git branch --no-contains "main" >actual 2>actual.err && test_line_count = 0 actual && test_line_count = 0 actual.err '
@@ -73,7 +73,7 @@ test_expect_success 'branch usage error' ' ' test_expect_success 'for-each-ref --contains <existent_object>' ' - git for-each-ref --contains "master" >actual 2>actual.err && + git for-each-ref --contains "main" >actual 2>actual.err && test_line_count = 2 actual && test_line_count = 0 actual.err '
@@ -86,7 +86,7 @@ test_expect_success 'for-each-ref --contains <inexistent_object>' ' ' test_expect_success 'for-each-ref --no-contains <existent_object>' ' - git for-each-ref --no-contains "master" >actual 2>actual.err && + git for-each-ref --no-contains "main" >actual 2>actual.err && test_line_count = 0 actual && test_line_count = 0 actual.err '
t/t0050-filesystem.sh +3 -3
@@ -65,7 +65,7 @@ test_expect_success "setup case tests" ' git mv camelcase tmp && git mv tmp CamelCase && git commit -m "rename" && - git checkout -f master + git checkout -f main ' test_expect_success 'rename (case change)' '
@@ -118,7 +118,7 @@ test_expect_success "setup unicode normalization tests" ' git mv $aumlcdiar tmp && git mv tmp "$auml" && git commit -m rename && - git checkout -f master + git checkout -f main ' $test_unicode 'rename (silent unicode normalization)' '
@@ -147,7 +147,7 @@ test_expect_success CASE_INSENSITIVE_FS 'checkout with no pathspec and a case in git add gitweb && git commit -m "add gitweb/subdir/file" && - git checkout master + git checkout main ) '
t/t0060-path-utils.sh +2 -2
@@ -312,8 +312,8 @@ test_git_path GIT_COMMON_DIR=bar info/sparse-checkout .git/info/sparse-check test_git_path GIT_COMMON_DIR=bar info//sparse-checkout .git/info//sparse-checkout test_git_path GIT_COMMON_DIR=bar remotes/bar bar/remotes/bar test_git_path GIT_COMMON_DIR=bar branches/bar bar/branches/bar -test_git_path GIT_COMMON_DIR=bar logs/refs/heads/master bar/logs/refs/heads/master -test_git_path GIT_COMMON_DIR=bar refs/heads/master bar/refs/heads/master +test_git_path GIT_COMMON_DIR=bar logs/refs/heads/main bar/logs/refs/heads/main +test_git_path GIT_COMMON_DIR=bar refs/heads/main bar/refs/heads/main test_git_path GIT_COMMON_DIR=bar refs/bisect/foo .git/refs/bisect/foo test_git_path GIT_COMMON_DIR=bar hooks/me bar/hooks/me test_git_path GIT_COMMON_DIR=bar config bar/config
t/t0100-previous.sh +9 -9
@@ -8,7 +8,7 @@ test_expect_success 'branch -d @{-1}' ' test_commit A && git checkout -b junk && git checkout - && - test "$(git symbolic-ref HEAD)" = refs/heads/master && + test "$(git symbolic-ref HEAD)" = refs/heads/main && git branch -d @{-1} && test_must_fail git rev-parse --verify refs/heads/junk '
@@ -17,9 +17,9 @@ test_expect_success 'branch -d @{-12} when there is not enough switches yet' ' git reflog expire --expire=now && git checkout -b junk2 && git checkout - && - test "$(git symbolic-ref HEAD)" = refs/heads/master && + test "$(git symbolic-ref HEAD)" = refs/heads/main && test_must_fail git branch -d @{-12} && - git rev-parse --verify refs/heads/master + git rev-parse --verify refs/heads/main ' test_expect_success 'merge @{-1}' '
@@ -28,19 +28,19 @@ test_expect_success 'merge @{-1}' ' git checkout A && test_commit C && test_commit D && - git branch -f master B && + git branch -f main B && git branch -f other && git checkout other && - git checkout master && + git checkout main && git merge @{-1} && git cat-file commit HEAD | grep "Merge branch '\''other'\''" ' test_expect_success 'merge @{-1}~1' ' - git checkout master && + git checkout main && git reset --hard B && git checkout other && - git checkout master && + git checkout main && git merge @{-1}~1 && git cat-file commit HEAD >actual && grep "Merge branch '\''other'\''" actual
@@ -48,11 +48,11 @@ test_expect_success 'merge @{-1}~1' ' test_expect_success 'merge @{-100} before checking out that many branches yet' ' git reflog expire --expire=now && - git checkout -f master && + git checkout -f main && git reset --hard B && git branch -f other C && git checkout other && - git checkout master && + git checkout main && test_must_fail git merge @{-100} '
t/t1004-read-tree-m-u-wf.sh +20 -20
@@ -20,17 +20,17 @@ test_expect_success 'two-way setup' ' git branch side && git tag -f branch-point && - echo file2 is not tracked on the master branch anymore && + echo file2 is not tracked on the main branch anymore && rm -f file2 subdir/file2 && git update-index --remove file2 subdir/file2 && - git commit -a -m "master removes file2 and subdir/file2" + git commit -a -m "main removes file2 and subdir/file2" ' test_expect_success 'two-way not clobbering' ' - echo >file2 master creates untracked file2 && - echo >subdir/file2 master creates untracked subdir/file2 && - if err=$(read_tree_u_must_succeed -m -u master side 2>&1) + echo >file2 main creates untracked file2 && + echo >subdir/file2 main creates untracked subdir/file2 && + if err=$(read_tree_u_must_succeed -m -u main side 2>&1) then echo should have complained false
@@ -43,7 +43,7 @@ echo file2 >.gitignore test_expect_success 'two-way with incorrect --exclude-per-directory (1)' ' - if err=$(read_tree_u_must_succeed -m --exclude-per-directory=.gitignore master side 2>&1) + if err=$(read_tree_u_must_succeed -m --exclude-per-directory=.gitignore main side 2>&1) then echo should have complained false
@@ -54,7 +54,7 @@ test_expect_success 'two-way with incorrect --exclude-per-directory (1)' ' test_expect_success 'two-way with incorrect --exclude-per-directory (2)' ' - if err=$(read_tree_u_must_succeed -m -u --exclude-per-directory=foo --exclude-per-directory=.gitignore master side 2>&1) + if err=$(read_tree_u_must_succeed -m -u --exclude-per-directory=foo --exclude-per-directory=.gitignore main side 2>&1) then echo should have complained false
@@ -65,7 +65,7 @@ test_expect_success 'two-way with incorrect --exclude-per-directory (2)' ' test_expect_success 'two-way clobbering a ignored file' ' - read_tree_u_must_succeed -m -u --exclude-per-directory=.gitignore master side + read_tree_u_must_succeed -m -u --exclude-per-directory=.gitignore main side ' rm -f .gitignore
@@ -81,21 +81,21 @@ test_expect_success 'three-way not complaining on an untracked path in both' ' git update-index --add file3 subdir/file3 && git commit -a -m "side adds file3 and removes file2" && - git checkout master && - echo >file2 file two is untracked on the master side && - echo >subdir/file2 file two is untracked on the master side && + git checkout main && + echo >file2 file two is untracked on the main side && + echo >subdir/file2 file two is untracked on the main side && - read_tree_u_must_succeed -m -u branch-point master side + read_tree_u_must_succeed -m -u branch-point main side ' test_expect_success 'three-way not clobbering a working tree file' ' git reset --hard && rm -f file2 subdir/file2 file3 subdir/file3 && - git checkout master && - echo >file3 file three created in master, untracked && - echo >subdir/file3 file three created in master, untracked && - if err=$(read_tree_u_must_succeed -m -u branch-point master side 2>&1) + git checkout main && + echo >file3 file three created in main, untracked && + echo >subdir/file3 file three created in main, untracked && + if err=$(read_tree_u_must_succeed -m -u branch-point main side 2>&1) then echo should have complained false
@@ -110,11 +110,11 @@ test_expect_success 'three-way not complaining on an untracked file' ' git reset --hard && rm -f file2 subdir/file2 file3 subdir/file3 && - git checkout master && - echo >file3 file three created in master, untracked && - echo >subdir/file3 file three created in master, untracked && + git checkout main && + echo >file3 file three created in main, untracked && + echo >subdir/file3 file three created in main, untracked && - read_tree_u_must_succeed -m -u --exclude-per-directory=.gitignore branch-point master side + read_tree_u_must_succeed -m -u --exclude-per-directory=.gitignore branch-point main side ' test_expect_success '3-way not overwriting local changes (setup)' '
t/t1008-read-tree-overlay.sh +1 -1
@@ -22,7 +22,7 @@ test_expect_success setup ' ' test_expect_success 'multi-read' ' - read_tree_must_succeed initial master side && + read_tree_must_succeed initial main side && test_write_lines a b/c >expect && git ls-files >actual && test_cmp expect actual
t/t1009-read-tree-new-index.sh +2 -2
@@ -12,13 +12,13 @@ test_expect_success setup ' test_expect_success 'non-existent index file' ' rm -f new-index && - GIT_INDEX_FILE=new-index git read-tree master + GIT_INDEX_FILE=new-index git read-tree main ' test_expect_success 'empty index file' ' rm -f new-index && > new-index && - GIT_INDEX_FILE=new-index git read-tree master + GIT_INDEX_FILE=new-index git read-tree main ' test_done
t/t1011-read-tree-sparse-checkout.sh +1 -1
@@ -2,7 +2,7 @@ test_description='sparse checkout tests -* (tag: removed, master) removed +* (tag: removed, main) removed | D sub/added * (HEAD, tag: top) modified and added | M init.t
t/t1021-rerere-in-workdir.sh +1 -1
@@ -19,7 +19,7 @@ test_expect_success SYMLINKS setup ' test_tick && git commit -a -m goodbye && - git checkout master + git checkout main ' test_expect_success SYMLINKS 'rerere in workdir' '
t/t1090-sparse-checkout-scope.sh +5 -5
@@ -20,18 +20,18 @@ test_expect_success 'create feature branch' ' git commit -m "modification" ' -test_expect_success 'perform sparse checkout of master' ' +test_expect_success 'perform sparse checkout of main' ' git config --local --bool core.sparsecheckout true && echo "!/*" >.git/info/sparse-checkout && echo "/a" >>.git/info/sparse-checkout && echo "/c" >>.git/info/sparse-checkout && - git checkout master && + git checkout main && test_path_is_file a && test_path_is_missing b && test_path_is_file c ' -test_expect_success 'merge feature branch into sparse checkout of master' ' +test_expect_success 'merge feature branch into sparse checkout of main' ' git merge feature && test_path_is_file a && test_path_is_missing b &&
@@ -39,10 +39,10 @@ test_expect_success 'merge feature branch into sparse checkout of master' ' test "$(cat c)" = "modified" ' -test_expect_success 'return to full checkout of master' ' +test_expect_success 'return to full checkout of main' ' git checkout feature && echo "/*" >.git/info/sparse-checkout && - git checkout master && + git checkout main && test_path_is_file a && test_path_is_file b && test_path_is_file c &&
t/t1091-sparse-checkout-builtin.sh +1 -1
@@ -117,7 +117,7 @@ test_expect_success 'interaction with clone --no-checkout (unborn index)' ' test_path_is_missing clone_no_checkout/.git/index && # No branch is checked out until we manually switch to one - git -C clone_no_checkout switch master && + git -C clone_no_checkout switch main && test_path_is_file clone_no_checkout/.git/index && check_files clone_no_checkout a folder1 '
t/t1300-config.sh +4 -4
@@ -1054,8 +1054,8 @@ test_expect_success 'check split_cmdline return' " echo foo > foo && git add foo && git commit -m 'initial commit' && - git config branch.master.mergeoptions 'echo \"' && - test_must_fail git merge master + git config branch.main.mergeoptions 'echo \"' && + test_must_fail git merge main " test_expect_success 'git -c "key=value" support' '
@@ -1769,11 +1769,11 @@ test_expect_success '--show-origin blob' ' test_expect_success '--show-origin blob ref' ' cat >expect <<-\EOF && - blob:master:custom.conf user.custom=true + blob:main:custom.conf user.custom=true EOF git add "$CUSTOM_CONFIG_FILE" && git commit -m "new config file" && - git config --blob=master:"$CUSTOM_CONFIG_FILE" --show-origin --list >output && + git config --blob=main:"$CUSTOM_CONFIG_FILE" --show-origin --list >output && test_cmp expect output '
t/t1301-shared-repo.sh +2 -2
@@ -115,13 +115,13 @@ test_expect_success POSIXPERM 'git reflog expire honors core.sharedRepository' ' umask 077 && git config core.sharedRepository group && git reflog expire --all && - actual="$(ls -l .git/logs/refs/heads/master)" && + actual="$(ls -l .git/logs/refs/heads/main)" && case "$actual" in -rw-rw-*) : happy ;; *) - echo Ooops, .git/logs/refs/heads/master is not 0662 [$actual] + echo Ooops, .git/logs/refs/heads/main is not 0662 [$actual] false ;; esac
t/t1305-config-include.sh +1 -1
@@ -312,7 +312,7 @@ test_expect_success SYMLINKS 'conditional include, gitdir matching symlink, icas test_expect_success 'conditional include, onbranch' ' echo "[includeIf \"onbranch:foo-branch\"]path=bar9" >>.git/config && echo "[test]nine=9" >.git/bar9 && - git checkout -b master && + git checkout -b main && test_must_fail git config test.nine && git checkout -b foo-branch && echo 9 >expect &&
t/t1309-early-config.sh +2 -2
@@ -91,11 +91,11 @@ test_expect_failure 'ignore .git/ with invalid config' ' test_expect_success 'early config and onbranch' ' echo "[broken" >broken && - test_with_config "[includeif \"onbranch:master\"]path=../broken" + test_with_config "[includeif \"onbranch:main\"]path=../broken" ' test_expect_success 'onbranch config outside of git repo' ' - test_config_global includeIf.onbranch:master.path non-existent && + test_config_global includeIf.onbranch:main.path non-existent && nongit git help '
t/t1400-update-ref.sh +34 -34
155 lines not on this page · raw message
t/t1402-check-ref-format.sh +16 -16
@@ -134,18 +134,18 @@ valid_ref !MINGW "$ref" '--refspec-pattern --allow-onelevel --normalize' test_expect_success "check-ref-format --branch @{-1}" ' T=$(git write-tree) && sha1=$(echo A | git commit-tree $T) && - git update-ref refs/heads/master $sha1 && - git update-ref refs/remotes/origin/master $sha1 && - git checkout master && - git checkout origin/master && - git checkout master && + git update-ref refs/heads/main $sha1 && + git update-ref refs/remotes/origin/main $sha1 && + git checkout main && + git checkout origin/main && + git checkout main && refname=$(git check-ref-format --branch @{-1}) && test "$refname" = "$sha1" && refname2=$(git check-ref-format --branch @{-2}) && - test "$refname2" = master' + test "$refname2" = main' -test_expect_success 'check-ref-format --branch -naster' ' - test_must_fail git check-ref-format --branch -naster >actual && +test_expect_success 'check-ref-format --branch -nain' ' + test_must_fail git check-ref-format --branch -nain >actual && test_must_be_empty actual '
@@ -154,11 +154,11 @@ test_expect_success 'check-ref-format --branch from subdir' ' T=$(git write-tree) && sha1=$(echo A | git commit-tree $T) && - git update-ref refs/heads/master $sha1 && - git update-ref refs/remotes/origin/master $sha1 && - git checkout master && - git checkout origin/master && - git checkout master && + git update-ref refs/heads/main $sha1 && + git update-ref refs/remotes/origin/main $sha1 && + git checkout main && + git checkout origin/main && + git checkout main && refname=$( cd subdir && git check-ref-format --branch @{-1}
@@ -171,9 +171,9 @@ test_expect_success 'check-ref-format --branch @{-1} from non-repo' ' test_must_be_empty actual ' -test_expect_success 'check-ref-format --branch master from non-repo' ' - echo master >expect && - nongit git check-ref-format --branch master >actual && +test_expect_success 'check-ref-format --branch main from non-repo' ' + echo main >expect && + nongit git check-ref-format --branch main >actual && test_cmp expect actual '
t/t1403-show-ref.sh +9 -9
@@ -9,7 +9,7 @@ test_expect_success setup ' git checkout -b side && test_commit B && git tag -f -a -m "annotated B" B && - git checkout master && + git checkout main && test_commit C && git branch B A^0 '
@@ -92,23 +92,23 @@ test_expect_success 'show-ref -d' ' git show-ref --verify -d refs/tags/A refs/tags/C >actual && test_cmp expect actual && - echo $(git rev-parse refs/heads/master) refs/heads/master >expect && - git show-ref -d master >actual && + echo $(git rev-parse refs/heads/main) refs/heads/main >expect && + git show-ref -d main >actual && test_cmp expect actual && - git show-ref -d heads/master >actual && + git show-ref -d heads/main >actual && test_cmp expect actual && - git show-ref -d refs/heads/master >actual && + git show-ref -d refs/heads/main >actual && test_cmp expect actual && - git show-ref -d --verify refs/heads/master >actual && + git show-ref -d --verify refs/heads/main >actual && test_cmp expect actual && - test_must_fail git show-ref -d --verify master >actual && + test_must_fail git show-ref -d --verify main >actual && test_must_be_empty actual && - test_must_fail git show-ref -d --verify heads/master >actual && + test_must_fail git show-ref -d --verify heads/main >actual && test_must_be_empty actual && test_must_fail git show-ref --verify -d A C >actual &&
@@ -120,7 +120,7 @@ test_expect_success 'show-ref -d' ' ' test_expect_success 'show-ref --heads, --tags, --head, pattern' ' - for branch in B master side + for branch in B main side do echo $(git rev-parse refs/heads/$branch) refs/heads/$branch done >expect.heads &&
t/t1405-main-ref-store.sh +21 -21
91 lines not on this page · raw message
t/t1406-submodule-ref-store.sh +15 -15
@@ -11,7 +11,7 @@ test_expect_success 'setup' ' ( cd sub && test_commit first && - git checkout -b new-master + git checkout -b new-main ) '
@@ -27,7 +27,7 @@ test_expect_success 'peel_ref(new-tag)' ' ' test_expect_success 'create_symref() not allowed' ' - test_must_fail $RUN create-symref FOO refs/heads/master nothing + test_must_fail $RUN create-symref FOO refs/heads/main nothing ' test_expect_success 'delete_refs() not allowed' '
@@ -35,14 +35,14 @@ test_expect_success 'delete_refs() not allowed' ' ' test_expect_success 'rename_refs() not allowed' ' - test_must_fail $RUN rename-ref refs/heads/master refs/heads/new-master + test_must_fail $RUN rename-ref refs/heads/main refs/heads/new-main ' test_expect_success 'for_each_ref(refs/heads/)' ' $RUN for-each-ref refs/heads/ | cut -d" " -f 2- >actual && cat >expected <<-\EOF && - master 0x0 - new-master 0x0 + main 0x0 + new-main 0x0 EOF test_cmp expected actual '
@@ -53,23 +53,23 @@ test_expect_success 'for_each_ref() is sorted' ' test_cmp expected actual ' -test_expect_success 'resolve_ref(master)' ' - SHA1=`git -C sub rev-parse master` && - echo "$SHA1 refs/heads/master 0x0" >expected && - $RUN resolve-ref refs/heads/master 0 >actual && +test_expect_success 'resolve_ref(main)' ' + SHA1=`git -C sub rev-parse main` && + echo "$SHA1 refs/heads/main 0x0" >expected && + $RUN resolve-ref refs/heads/main 0 >actual && test_cmp expected actual ' -test_expect_success 'verify_ref(new-master)' ' - $RUN verify-ref refs/heads/new-master +test_expect_success 'verify_ref(new-main)' ' + $RUN verify-ref refs/heads/new-main ' test_expect_success 'for_each_reflog()' ' $RUN for-each-reflog | sort | cut -d" " -f 2- >actual && cat >expected <<-\EOF && HEAD 0x1 - refs/heads/master 0x0 - refs/heads/new-master 0x0 + refs/heads/main 0x0 + refs/heads/new-main 0x0 EOF test_cmp expected actual '
@@ -77,12 +77,12 @@ test_expect_success 'for_each_reflog()' ' test_expect_success 'for_each_reflog_ent()' ' $RUN for-each-reflog-ent HEAD >actual && head -n1 actual | grep first && - tail -n2 actual | head -n1 | grep master.to.new + tail -n2 actual | head -n1 | grep main.to.new ' test_expect_success 'for_each_reflog_ent_reverse()' ' $RUN for-each-reflog-ent-reverse HEAD >actual && - head -n1 actual | grep master.to.new && + head -n1 actual | grep main.to.new && tail -n2 actual | head -n1 | grep first '
t/t1407-worktree-ref-store.sh +16 -16
@@ -9,7 +9,7 @@ RMAIN="test-tool ref-store worktree:main" test_expect_success 'setup' ' test_commit first && - git worktree add -b wt-master wt && + git worktree add -b wt-main wt && ( cd wt && test_commit second
@@ -17,34 +17,34 @@ test_expect_success 'setup' ' ' test_expect_success 'resolve_ref(<shared-ref>)' ' - SHA1=`git rev-parse master` && - echo "$SHA1 refs/heads/master 0x0" >expected && - $RWT resolve-ref refs/heads/master 0 >actual && + SHA1=`git rev-parse main` && + echo "$SHA1 refs/heads/main 0x0" >expected && + $RWT resolve-ref refs/heads/main 0 >actual && test_cmp expected actual && - $RMAIN resolve-ref refs/heads/master 0 >actual && + $RMAIN resolve-ref refs/heads/main 0 >actual && test_cmp expected actual ' test_expect_success 'resolve_ref(<per-worktree-ref>)' ' SHA1=`git -C wt rev-parse HEAD` && - echo "$SHA1 refs/heads/wt-master 0x1" >expected && + echo "$SHA1 refs/heads/wt-main 0x1" >expected && $RWT resolve-ref HEAD 0 >actual && test_cmp expected actual && SHA1=`git rev-parse HEAD` && - echo "$SHA1 refs/heads/master 0x1" >expected && + echo "$SHA1 refs/heads/main 0x1" >expected && $RMAIN resolve-ref HEAD 0 >actual && test_cmp expected actual ' -test_expect_success 'create_symref(FOO, refs/heads/master)' ' - $RWT create-symref FOO refs/heads/master nothing && - echo refs/heads/master >expected && +test_expect_success 'create_symref(FOO, refs/heads/main)' ' + $RWT create-symref FOO refs/heads/main nothing && + echo refs/heads/main >expected && git -C wt symbolic-ref FOO >actual && test_cmp expected actual && - $RMAIN create-symref FOO refs/heads/wt-master nothing && - echo refs/heads/wt-master >expected && + $RMAIN create-symref FOO refs/heads/wt-main nothing && + echo refs/heads/wt-main >expected && git symbolic-ref FOO >actual && test_cmp expected actual '
@@ -63,8 +63,8 @@ test_expect_success 'for_each_reflog()' ' HEAD 0x1 PSEUDO-WT 0x0 refs/bisect/wt-random 0x0 - refs/heads/master 0x0 - refs/heads/wt-master 0x0 + refs/heads/main 0x0 + refs/heads/wt-main 0x0 EOF test_cmp expected actual &&
@@ -73,8 +73,8 @@ test_expect_success 'for_each_reflog()' ' HEAD 0x1 PSEUDO-MAIN 0x0 refs/bisect/random 0x0 - refs/heads/master 0x0 - refs/heads/wt-master 0x0 + refs/heads/main 0x0 + refs/heads/wt-main 0x0 EOF test_cmp expected actual '
t/t1408-packed-refs.sh +6 -6
@@ -9,32 +9,32 @@ test_expect_success setup ' git commit --allow-empty -m one && one=$(git rev-parse HEAD) && git for-each-ref >actual && - echo "$one commit refs/heads/master" >expect && + echo "$one commit refs/heads/main" >expect && test_cmp expect actual && git pack-refs --all && git for-each-ref >actual && - echo "$one commit refs/heads/master" >expect && + echo "$one commit refs/heads/main" >expect && test_cmp expect actual && git checkout --orphan another && test_tick && git commit --allow-empty -m two && two=$(git rev-parse HEAD) && - git checkout -B master && + git checkout -B main && git branch -D another && git for-each-ref >actual && - echo "$two commit refs/heads/master" >expect && + echo "$two commit refs/heads/main" >expect && test_cmp expect actual && git reflog expire --expire=now --all && git prune && - git tag -m v1.0 v1.0 master + git tag -m v1.0 v1.0 main ' test_expect_success 'no error from stale entry in packed-refs' ' - git describe master >actual 2>&1 && + git describe main >actual 2>&1 && echo "v1.0" >expect && test_cmp expect actual '
t/t1410-reflog.sh +28 -28
161 lines not on this page · raw message
t/t1411-reflog-show.sh +1 -1
@@ -167,7 +167,7 @@ test_expect_success 'git log -g -p shows diffs vs. parents' ' ' test_expect_success 'reflog exists works' ' - git reflog exists refs/heads/master && + git reflog exists refs/heads/main && ! git reflog exists refs/heads/nonexistent '
t/t1413-reflog-detach.sh +12 -12
@@ -4,7 +4,7 @@ test_description='Test reflog interaction with detached HEAD' . ./test-lib.sh reset_state () { - git checkout master && + git checkout main && cp saved_reflog .git/logs/HEAD }
@@ -19,14 +19,14 @@ test_expect_success setup ' test_expect_success baseline ' reset_state && - git rev-parse master master^ >expect && + git rev-parse main main^ >expect && git log -g --format=%H >actual && test_cmp expect actual ' test_expect_success 'switch to branch' ' reset_state && - git rev-parse side master master^ >expect && + git rev-parse side main main^ >expect && git checkout side && git log -g --format=%H >actual && test_cmp expect actual
@@ -34,34 +34,34 @@ test_expect_success 'switch to branch' ' test_expect_success 'detach to other' ' reset_state && - git rev-parse master side master master^ >expect && + git rev-parse main side main main^ >expect && git checkout side && - git checkout master^0 && + git checkout main^0 && git log -g --format=%H >actual && test_cmp expect actual ' test_expect_success 'detach to self' ' reset_state && - git rev-parse master master master^ >expect && - git checkout master^0 && + git rev-parse main main main^ >expect && + git checkout main^0 && git log -g --format=%H >actual && test_cmp expect actual ' test_expect_success 'attach to self' ' reset_state && - git rev-parse master master master master^ >expect && - git checkout master^0 && - git checkout master && + git rev-parse main main main main^ >expect && + git checkout main^0 && + git checkout main && git log -g --format=%H >actual && test_cmp expect actual ' test_expect_success 'attach to other' ' reset_state && - git rev-parse side master master master^ >expect && - git checkout master^0 && + git rev-parse side main main main^ >expect && + git checkout main^0 && git checkout side && git log -g --format=%H >actual && test_cmp expect actual
t/t1414-reflog-walk.sh +6 -6
@@ -8,7 +8,7 @@ test_expect_success 'set up some reflog entries' ' test_commit two && git checkout -b side HEAD^ && test_commit three && - git merge --no-commit master && + git merge --no-commit main && echo evil-merge-content >>one.t && test_tick && git commit --no-edit -a
@@ -20,9 +20,9 @@ do_walk () { test_expect_success 'set up expected reflog' ' cat >expect.all <<-EOF - HEAD@{0} commit (merge): Merge branch ${SQ}master${SQ} into side + HEAD@{0} commit (merge): Merge branch ${SQ}main${SQ} into side HEAD@{1} commit: three - HEAD@{2} checkout: moving from master to side + HEAD@{2} checkout: moving from main to side HEAD@{3} commit: two HEAD@{4} commit (initial): one EOF
@@ -73,15 +73,15 @@ test_expect_success 'walking multiple reflogs shows all' ' # sort ignores the bits after the timestamp. # # 2. POSIX leaves undefined whether this is a stable sort or not. So - # we use "-k 1" to ensure that we see HEAD before master before + # we use "-k 1" to ensure that we see HEAD before main before # side when breaking ties. { do_walk --date=unix HEAD && do_walk --date=unix side && - do_walk --date=unix master + do_walk --date=unix main } >expect.raw && sort -t "{" -k 2nr -k 1 <expect.raw >expect && - do_walk --date=unix HEAD master side >actual && + do_walk --date=unix HEAD main side >actual && test_cmp expect actual '
t/t1416-ref-transaction-hooks.sh +5 -5
@@ -53,11 +53,11 @@ test_expect_success 'hook gets all queued updates in prepared state' ' EOF cat >expect <<-EOF && $ZERO_OID $POST_OID HEAD - $ZERO_OID $POST_OID refs/heads/master + $ZERO_OID $POST_OID refs/heads/main EOF git update-ref HEAD POST <<-EOF && update HEAD $ZERO_OID $POST_OID - update refs/heads/master $ZERO_OID $POST_OID + update refs/heads/main $ZERO_OID $POST_OID EOF test_cmp expect actual '
@@ -76,7 +76,7 @@ test_expect_success 'hook gets all queued updates in committed state' ' EOF cat >expect <<-EOF && $ZERO_OID $POST_OID HEAD - $ZERO_OID $POST_OID refs/heads/master + $ZERO_OID $POST_OID refs/heads/main EOF git update-ref HEAD POST && test_cmp expect actual
@@ -96,12 +96,12 @@ test_expect_success 'hook gets all queued updates in aborted state' ' EOF cat >expect <<-EOF && $ZERO_OID $POST_OID HEAD - $ZERO_OID $POST_OID refs/heads/master + $ZERO_OID $POST_OID refs/heads/main EOF git update-ref --stdin <<-EOF && start update HEAD POST $ZERO_OID - update refs/heads/master POST $ZERO_OID + update refs/heads/main POST $ZERO_OID abort EOF test_cmp expect actual
t/t1430-bad-ref-name.sh +26 -26
193 lines not on this page · raw message
t/t1450-fsck.sh +1 -1
@@ -3,7 +3,7 @@ test_description='git fsck random collection of tests * (HEAD) B -* (master) A +* (main) A ' . ./test-lib.sh
t/t1500-rev-parse.sh +2 -2
@@ -174,8 +174,8 @@ test_expect_success 'showing the superproject correctly' ' test_commit -C super/dir/sub branch1_commit && git -C super add dir/sub && test_commit -C super branch1_commit && - git -C super checkout -b branch2 master && - git -C super/dir/sub checkout -b branch2 master && + git -C super checkout -b branch2 main && + git -C super/dir/sub checkout -b branch2 main && test_commit -C super/dir/sub branch2_commit && git -C super add dir/sub && test_commit -C super branch2_commit &&
t/t1503-rev-parse-verify.sh +14 -14
@@ -51,8 +51,8 @@ test_expect_success 'works with one good rev' ' test "$rev_hash3" = "$HASH3" && rev_hash4=$(git rev-parse --verify $HASH4) && test "$rev_hash4" = "$HASH4" && - rev_master=$(git rev-parse --verify master) && - test "$rev_master" = "$HASH4" && + rev_main=$(git rev-parse --verify main) && + test "$rev_main" = "$HASH4" && rev_head=$(git rev-parse --verify HEAD) && test "$rev_head" = "$HASH4" '
@@ -116,27 +116,27 @@ test_expect_success 'no stdout output on error' ' ' test_expect_success 'use --default' ' - git rev-parse --verify --default master && - git rev-parse --verify --default master HEAD && - git rev-parse --default master --verify && - git rev-parse --default master --verify HEAD && - git rev-parse --verify HEAD --default master && - test_must_fail git rev-parse --verify foo --default master && + git rev-parse --verify --default main && + git rev-parse --verify --default main HEAD && + git rev-parse --default main --verify && + git rev-parse --default main --verify HEAD && + git rev-parse --verify HEAD --default main && + test_must_fail git rev-parse --verify foo --default main && test_must_fail git rev-parse --default HEAD --verify bar && test_must_fail git rev-parse --verify --default HEAD baz && test_must_fail git rev-parse --default foo --verify && test_must_fail git rev-parse --verify --default bar ' -test_expect_success 'master@{n} for various n' ' +test_expect_success 'main@{n} for various n' ' N=$(git reflog | wc -l) && Nm1=$(($N-1)) && Np1=$(($N+1)) && - git rev-parse --verify master@{0} && - git rev-parse --verify master@{1} && - git rev-parse --verify master@{$Nm1} && - test_must_fail git rev-parse --verify master@{$N} && - test_must_fail git rev-parse --verify master@{$Np1} + git rev-parse --verify main@{0} && + git rev-parse --verify main@{1} && + git rev-parse --verify main@{$Nm1} && + test_must_fail git rev-parse --verify main@{$N} && + test_must_fail git rev-parse --verify main@{$Np1} ' test_expect_success SYMLINKS 'ref resolution not confused by broken symlinks' '
t/t1505-rev-parse-last.sh +4 -4
@@ -20,12 +20,12 @@ test_expect_success 'setup' ' make_commit 3 && git checkout side && make_commit 4 && - git merge master && - git checkout master + git merge main && + git checkout main ' -# 1 -- 2 -- 3 master +# 1 -- 2 -- 3 main # \ \ # \ \ # --- 4 --- 5 side
@@ -49,7 +49,7 @@ test_expect_success '@{-1}@{1} works' ' ' test_expect_success '@{-2} works' ' - test_cmp_rev master @{-2} + test_cmp_rev main @{-2} ' test_expect_success '@{-3} fails' '
t/t1506-rev-parse-diagnosis.sh +2 -2
@@ -137,10 +137,10 @@ test_expect_success 'incorrect file in :path and :N:path' ' ' test_expect_success 'invalid @{n} reference' ' - test_must_fail git rev-parse master@{99999} >output 2>error && + test_must_fail git rev-parse main@{99999} >output 2>error && test_must_be_empty output && test_i18ngrep "log for [^ ]* only has [0-9][0-9]* entries" error && - test_must_fail git rev-parse --verify master@{99999} >output 2>error && + test_must_fail git rev-parse --verify main@{99999} >output 2>error && test_must_be_empty output && test_i18ngrep "log for [^ ]* only has [0-9][0-9]* entries" error '
t/t1507-rev-parse-upstream.sh +20 -20
@@ -10,20 +10,20 @@ test_expect_success 'setup' ' test_commit 1 && git checkout -b side && test_commit 2 && - git checkout master && + git checkout main && git clone . clone && test_commit 3 && (cd clone && test_commit 4 && git branch --track my-side origin/side && - git branch --track local-master master && + git branch --track local-main main && git branch --track fun@ny origin/side && git branch --track @funny origin/side && git branch --track funny@ origin/side && - git remote add -t master master-only .. && - git fetch master-only && + git remote add -t main main-only .. && + git fetch main-only && git branch bad-upstream && - git config branch.bad-upstream.remote master-only && + git config branch.bad-upstream.remote main-only && git config branch.bad-upstream.merge refs/heads/side ) '
@@ -39,7 +39,7 @@ error_message () { } test_expect_success '@{upstream} resolves to correct full name' ' - echo refs/remotes/origin/master >expect && + echo refs/remotes/origin/main >expect && git -C clone rev-parse --symbolic-full-name @{upstream} >actual && test_cmp expect actual && git -C clone rev-parse --symbolic-full-name @{UPSTREAM} >actual &&
@@ -49,7 +49,7 @@ test_expect_success '@{upstream} resolves to correct full name' ' ' test_expect_success '@{u} resolves to correct full name' ' - echo refs/remotes/origin/master >expect && + echo refs/remotes/origin/main >expect && git -C clone rev-parse --symbolic-full-name @{u} >actual && test_cmp expect actual && git -C clone rev-parse --symbolic-full-name @{U} >actual &&
@@ -132,7 +132,7 @@ test_expect_success 'checkout -b new my-side@{u} forks from the same' ' test_expect_success 'merge my-side@{u} records the correct name' ' ( cd clone && - git checkout master && + git checkout main && test_might_fail git branch -D new && git branch -t new my-side@{u} && git merge -s ours new@{u} &&
@@ -143,24 +143,24 @@ test_expect_success 'merge my-side@{u} records the correct name' ' ' test_expect_success 'branch -d other@{u}' ' - git checkout -t -b other master && + git checkout -t -b other main && git branch -d @{u} && - git for-each-ref refs/heads/master >actual && + git for-each-ref refs/heads/main >actual && test_must_be_empty actual ' test_expect_success 'checkout other@{u}' ' - git branch -f master HEAD && - git checkout -t -b another master && + git branch -f main HEAD && + git checkout -t -b another main && git checkout @{u} && git symbolic-ref HEAD >actual && - echo refs/heads/master >expect && + echo refs/heads/main >expect && test_cmp expect actual ' test_expect_success 'branch@{u} works when tracking a local branch' ' - echo refs/heads/master >expect && - git -C clone rev-parse --symbolic-full-name local-master@{u} >actual && + echo refs/heads/main >expect && + git -C clone rev-parse --symbolic-full-name local-main@{u} >actual && test_cmp expect actual '
@@ -174,7 +174,7 @@ test_expect_success 'branch@{u} error message when no upstream' ' test_expect_success '@{u} error message when no upstream' ' cat >expect <<-EOF && - fatal: no upstream configured for branch ${SQ}master${SQ} + fatal: no upstream configured for branch ${SQ}main${SQ} EOF test_must_fail git rev-parse --verify @{u} 2>actual && test_i18ncmp expect actual
@@ -208,14 +208,14 @@ test_expect_success 'branch@{u} error message if upstream branch not fetched' ' test_expect_success 'pull works when tracking a local branch' ' ( cd clone && - git checkout local-master && + git checkout local-main && git pull ) ' # makes sense if the previous one succeeded test_expect_success '@{u} works when tracking a local branch' ' - echo refs/heads/master >expect && + echo refs/heads/main >expect && git -C clone rev-parse --symbolic-full-name @{u} >actual && test_cmp expect actual '
@@ -224,7 +224,7 @@ test_expect_success 'log -g other@{u}' ' commit=$(git rev-parse HEAD) && cat >expect <<-EOF && commit $commit - Reflog: master@{0} (C O Mitter <[email protected]>) + Reflog: main@{0} (C O Mitter <[email protected]>) Reflog message: branch: Created from HEAD Author: A U Thor <[email protected]> Date: Thu Apr 7 15:15:13 2005 -0700
@@ -239,7 +239,7 @@ test_expect_success 'log -g other@{u}@{now}' ' commit=$(git rev-parse HEAD) && cat >expect <<-EOF && commit $commit - Reflog: master@{Thu Apr 7 15:17:13 2005 -0700} (C O Mitter <[email protected]>) + Reflog: main@{Thu Apr 7 15:17:13 2005 -0700} (C O Mitter <[email protected]>) Reflog message: branch: Created from HEAD Author: A U Thor <[email protected]> Date: Thu Apr 7 15:15:13 2005 -0700
t/t1508-at-combinations.sh +5 -5
@@ -30,8 +30,8 @@ fail() { } test_expect_success 'setup' ' - test_commit master-one && - test_commit master-two && + test_commit main-one && + test_commit main-two && git checkout -b upstream-branch && test_commit upstream-one && test_commit upstream-two &&
@@ -47,7 +47,7 @@ test_expect_success 'setup' ' git checkout -b new-branch && test_commit new-one && test_commit new-two && - git branch -u master old-branch && + git branch -u main old-branch && git branch -u upstream-branch new-branch '
@@ -62,8 +62,8 @@ check "@{-1}@{1}" commit old-one check "@{u}" ref refs/heads/upstream-branch check "HEAD@{u}" ref refs/heads/upstream-branch check "@{u}@{1}" commit upstream-one -check "@{-1}@{u}" ref refs/heads/master -check "@{-1}@{u}@{1}" commit master-one +check "@{-1}@{u}" ref refs/heads/main +check "@{-1}@{u}@{1}" commit main-one check "@" commit new-two check "@@{u}" ref refs/heads/upstream-branch check "@@/at-test" ref refs/heads/@@/at-test
t/t1511-rev-parse-caret.sh +13 -13
@@ -15,7 +15,7 @@ test_expect_success 'setup' ' git commit -m Initial && git tag -a -m commit commit-tag && git branch ref && - git checkout master && + git checkout main && echo modified >>a-blob && git add -u && git commit -m Modified &&
@@ -73,52 +73,52 @@ test_expect_success 'ref^{tag}' ' ' test_expect_success 'ref^{/.}' ' - git rev-parse master >expected && - git rev-parse master^{/.} >actual && + git rev-parse main >expected && + git rev-parse main^{/.} >actual && test_cmp expected actual ' test_expect_success 'ref^{/non-existent}' ' - test_must_fail git rev-parse master^{/non-existent} + test_must_fail git rev-parse main^{/non-existent} ' test_expect_success 'ref^{/Initial}' ' git rev-parse ref >expected && - git rev-parse master^{/Initial} >actual && + git rev-parse main^{/Initial} >actual && test_cmp expected actual ' test_expect_success 'ref^{/!Exp}' ' - test_must_fail git rev-parse master^{/!Exp} + test_must_fail git rev-parse main^{/!Exp} ' test_expect_success 'ref^{/!}' ' - test_must_fail git rev-parse master^{/!} + test_must_fail git rev-parse main^{/!} ' test_expect_success 'ref^{/!!Exp}' ' git rev-parse expref >expected && - git rev-parse master^{/!!Exp} >actual && + git rev-parse main^{/!!Exp} >actual && test_cmp expected actual ' test_expect_success 'ref^{/!-}' ' - test_must_fail git rev-parse master^{/!-} + test_must_fail git rev-parse main^{/!-} ' test_expect_success 'ref^{/!-.}' ' - test_must_fail git rev-parse master^{/!-.} + test_must_fail git rev-parse main^{/!-.} ' test_expect_success 'ref^{/!-non-existent}' ' - git rev-parse master >expected && - git rev-parse master^{/!-non-existent} >actual && + git rev-parse main >expected && + git rev-parse main^{/!-non-existent} >actual && test_cmp expected actual ' test_expect_success 'ref^{/!-Changed}' ' git rev-parse expref >expected && - git rev-parse master^{/!-Changed} >actual && + git rev-parse main^{/!-Changed} >actual && test_cmp expected actual '
t/t1512-rev-parse-disambiguation.sh +1 -1
@@ -212,7 +212,7 @@ test_expect_success 'more history' ' side=$(git rev-parse HEAD) && # commit 000000000066 - git checkout master && + git checkout main && # If you use recursive, merge will fail and you will need to # clean up a0blgqsjc as well. If you use resolve, merge will
t/t1513-rev-parse-prefix.sh +2 -2
@@ -76,9 +76,9 @@ test_expect_success 'disambiguate path with valid prefix' ' ' test_expect_success 'file and refs with prefix' ' - git rev-parse --prefix sub1/ master file1 >actual && + git rev-parse --prefix sub1/ main file1 >actual && cat <<-EOF >expected && - $(git rev-parse master) + $(git rev-parse main) sub1/file1 EOF test_cmp expected actual
t/t1514-rev-parse-push.sh +8 -8
@@ -16,24 +16,24 @@ test_expect_success 'setup' ' git remote add other other.git && test_commit base && git push origin HEAD && - git branch --set-upstream-to=origin/master master && - git branch --track topic origin/master && + git branch --set-upstream-to=origin/main main && + git branch --track topic origin/main && git push origin topic && git push other topic ' test_expect_success '@{push} with default=nothing' ' test_config push.default nothing && - test_must_fail git rev-parse master@{push} && - test_must_fail git rev-parse master@{PUSH} && - test_must_fail git rev-parse master@{PuSH} + test_must_fail git rev-parse main@{push} && + test_must_fail git rev-parse main@{PUSH} && + test_must_fail git rev-parse main@{PuSH} ' test_expect_success '@{push} with default=simple' ' test_config push.default simple && - resolve master@{push} refs/remotes/origin/master && - resolve master@{PUSH} refs/remotes/origin/master && - resolve master@{pUSh} refs/remotes/origin/master + resolve main@{push} refs/remotes/origin/main && + resolve main@{PUSH} refs/remotes/origin/main && + resolve main@{pUSh} refs/remotes/origin/main ' test_expect_success 'triangular @{push} fails with default=simple' '
t/t1700-split-index.sh +1 -1
@@ -496,7 +496,7 @@ test_expect_success 'do not refresh null base index' ' test_commit initial && git checkout -b side-branch && test_commit extra && - git checkout master && + git checkout main && git update-index --split-index && test_commit more && # must not write a new shareindex, or we wont catch the problem
t/test-lib.sh +7 -0
@@ -256,6 +256,13 @@ case "$TRASH_DIRECTORY" in *) TRASH_DIRECTORY="$TEST_OUTPUT_DIRECTORY/$TRASH_DIRECTORY" ;; esac +case "$TEST_NUMBER" in +[01]*) + GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + ;; +esac + # If --stress was passed, run this test repeatedly in several parallel loops. if test "$GIT_TEST_STRESS_STARTED" = "done" then
Signature · 1 line
gitgitgadget
PATCH v2 3/27 t2*: adjust the references to the default branch name "main"
In reply to Johannes Schindelin via GitGitGadgetFrom: Johannes Schindelin <[email protected]>
This trick was performed via
$ (cd t && sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \ -e 's/Master/Main/g' -- t2*.sh)
This allows us to define GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main for those tests.
--- t/t2007-checkout-symlink.sh | 10 ++-- t/t2009-checkout-statinfo.sh | 8 +-- t/t2010-checkout-ambiguous.sh | 4 +- t/t2011-checkout-invalid-head.sh | 16 +++--- t/t2012-checkout-last.sh | 48 ++++++++-------- t/t2015-checkout-unborn.sh | 2 +- t/t2017-checkout-orphan.sh | 44 +++++++-------- t/t2020-checkout-detach.sh | 28 +++++----- t/t2022-checkout-paths.sh | 22 ++++---- t/t2023-checkout-m.sh | 10 ++-- t/t2024-checkout-dwim.sh | 70 ++++++++++++------------ t/t2027-checkout-track.sh | 6 +- t/t2030-unresolve-info.sh | 6 +- t/t2060-switch.sh | 30 +++++----- t/t2070-restore.sh | 4 +- t/t2106-update-index-assume-unchanged.sh | 2 +- t/t2400-worktree-add.sh | 66 +++++++++++----------- t/t2401-worktree-prune.sh | 2 +- t/t2402-worktree-list.sh | 20 +++---- t/t2405-worktree-submodule.sh | 6 +- t/test-lib.sh | 2 +- 21 files changed, 203 insertions(+), 203 deletions(-)
t/t2007-checkout-symlink.sh +5 -5
@@ -12,14 +12,14 @@ test_expect_success setup ' echo hello >frotz/filfre && git add frotz/filfre && test_tick && - git commit -m "master has file frotz/filfre" && + git commit -m "main has file frotz/filfre" && git branch side && echo goodbye >nitfol && git add nitfol && test_tick && - git commit -m "master adds file nitfol" && + git commit -m "main adds file nitfol" && git checkout side &&
@@ -34,13 +34,13 @@ test_expect_success setup ' test_expect_success 'switch from symlink to dir' ' - git checkout master + git checkout main ' -test_expect_success 'Remove temporary directories & switch to master' ' +test_expect_success 'Remove temporary directories & switch to main' ' rm -fr frotz xyzzy nitfol && - git checkout -f master + git checkout -f main ' test_expect_success 'switch from dir to symlink' '
t/t2009-checkout-statinfo.sh +4 -4
@@ -21,13 +21,13 @@ test_expect_success 'branch switching' ' git reset --hard && test "$(git diff-files --raw)" = "" && - git checkout master && + git checkout main && test "$(git diff-files --raw)" = "" && git checkout side && test "$(git diff-files --raw)" = "" && - git checkout master && + git checkout main && test "$(git diff-files --raw)" = "" '
@@ -37,13 +37,13 @@ test_expect_success 'path checkout' ' git reset --hard && test "$(git diff-files --raw)" = "" && - git checkout master world && + git checkout main world && test "$(git diff-files --raw)" = "" && git checkout side world && test "$(git diff-files --raw)" = "" && - git checkout master world && + git checkout main world && test "$(git diff-files --raw)" = "" '
t/t2010-checkout-ambiguous.sh +2 -2
@@ -17,7 +17,7 @@ test_expect_success 'reference must be a tree' ' ' test_expect_success 'branch switching' ' - test "refs/heads/master" = "$(git symbolic-ref HEAD)" && + test "refs/heads/main" = "$(git symbolic-ref HEAD)" && git checkout world -- && test "refs/heads/world" = "$(git symbolic-ref HEAD)" '
@@ -57,7 +57,7 @@ test_expect_success 'disambiguate checking out from a tree-ish' ' ' test_expect_success 'accurate error message with more than one ref' ' - test_must_fail git checkout HEAD master -- 2>actual && + test_must_fail git checkout HEAD main -- 2>actual && test_i18ngrep 2 actual && test_i18ngrep "one reference expected, 2 given" actual '
t/t2011-checkout-invalid-head.sh +8 -8
@@ -11,12 +11,12 @@ test_expect_success 'setup' ' ' test_expect_success 'checkout should not start branch from a tree' ' - test_must_fail git checkout -b newbranch master^{tree} + test_must_fail git checkout -b newbranch main^{tree} ' -test_expect_success 'checkout master from invalid HEAD' ' +test_expect_success 'checkout main from invalid HEAD' ' echo $ZERO_OID >.git/HEAD && - git checkout master -- + git checkout main -- ' test_expect_success 'checkout notices failure to lock HEAD' '
@@ -26,7 +26,7 @@ test_expect_success 'checkout notices failure to lock HEAD' ' ' test_expect_success 'create ref directory/file conflict scenario' ' - git update-ref refs/heads/outer/inner master && + git update-ref refs/heads/outer/inner main && # do not rely on symbolic-ref to get a known state, # as it may use the same code we are testing
@@ -37,12 +37,12 @@ test_expect_success 'create ref directory/file conflict scenario' ' test_expect_success 'checkout away from d/f HEAD (unpacked, to branch)' ' reset_to_df && - git checkout master + git checkout main ' test_expect_success 'checkout away from d/f HEAD (unpacked, to detached)' ' reset_to_df && - git checkout --detach master + git checkout --detach main ' test_expect_success 'pack refs' '
@@ -51,11 +51,11 @@ test_expect_success 'pack refs' ' test_expect_success 'checkout away from d/f HEAD (packed, to branch)' ' reset_to_df && - git checkout master + git checkout main ' test_expect_success 'checkout away from d/f HEAD (packed, to detached)' ' reset_to_df && - git checkout --detach master + git checkout --detach main ' test_done
t/t2012-checkout-last.sh +24 -24
87 lines not on this page · raw message
t/t2015-checkout-unborn.sh +1 -1
@@ -11,7 +11,7 @@ test_expect_success 'setup' ' git add file && git commit -m base ) && - git fetch parent master:origin + git fetch parent main:origin ' test_expect_success 'checkout from unborn preserves untracked files' '
t/t2017-checkout-orphan.sh +22 -22
110 lines not on this page · raw message
t/t2020-checkout-detach.sh +14 -14
@@ -22,7 +22,7 @@ check_no_orphan_warning() { } reset () { - git checkout master && + git checkout main && check_not_detached }
@@ -85,7 +85,7 @@ test_expect_success 'checkout --detach errors out for non-commit' ' test_expect_success 'checkout --detach errors out for extra argument' ' reset && - git checkout master && + git checkout main && test_must_fail git checkout --detach tag one.t && check_not_detached '
@@ -113,7 +113,7 @@ test_expect_success 'checkout warns on orphan commits' ' echo new content >orphan && git commit -a -m orphan2 && orphan2=$(git rev-parse HEAD) && - git checkout master 2>stderr + git checkout main 2>stderr ' test_expect_success 'checkout warns on orphan commits: output' '
@@ -132,7 +132,7 @@ test_expect_success 'checkout warns orphaning 1 of 2 commits: output' ' test_expect_success 'checkout does not warn leaving ref tip' ' reset && git checkout --detach two && - git checkout master 2>stderr + git checkout main 2>stderr ' test_expect_success 'checkout does not warn leaving ref tip' '
@@ -142,7 +142,7 @@ test_expect_success 'checkout does not warn leaving ref tip' ' test_expect_success 'checkout does not warn leaving reachable commit' ' reset && git checkout --detach HEAD^ && - git checkout master 2>stderr + git checkout main 2>stderr ' test_expect_success 'checkout does not warn leaving reachable commit' '
@@ -150,14 +150,14 @@ test_expect_success 'checkout does not warn leaving reachable commit' ' ' cat >expect <<'EOF' -Your branch is behind 'master' by 1 commit, and can be fast-forwarded. +Your branch is behind 'main' by 1 commit, and can be fast-forwarded. (use "git pull" to update your local branch) EOF test_expect_success 'tracking count is accurate after orphan check' ' reset && - git branch child master^ && + git branch child main^ && git config branch.child.remote . && - git config branch.child.merge refs/heads/master && + git config branch.child.merge refs/heads/main && git checkout child^ && git checkout child >stdout && test_i18ncmp expect stdout
@@ -189,9 +189,9 @@ test_expect_success 'no advice given for explicit detached head state' ' # Detached HEAD tests for GIT_PRINT_SHA1_ELLIPSIS (new format) test_expect_success 'describe_detached_head prints no SHA-1 ellipsis when not asked to' " - commit=$(git rev-parse --short=12 master^) && - commit2=$(git rev-parse --short=12 master~2) && - commit3=$(git rev-parse --short=12 master~3) && + commit=$(git rev-parse --short=12 main^) && + commit2=$(git rev-parse --short=12 main~2) && + commit3=$(git rev-parse --short=12 main~3) && # The first detach operation is more chatty than the following ones. cat >1st_detach <<-EOF &&
@@ -271,9 +271,9 @@ test_expect_success 'describe_detached_head prints no SHA-1 ellipsis when not as # Detached HEAD tests for GIT_PRINT_SHA1_ELLIPSIS (old format) test_expect_success 'describe_detached_head does print SHA-1 ellipsis when asked to' " - commit=$(git rev-parse --short=12 master^) && - commit2=$(git rev-parse --short=12 master~2) && - commit3=$(git rev-parse --short=12 master~3) && + commit=$(git rev-parse --short=12 main^) && + commit2=$(git rev-parse --short=12 main~2) && + commit3=$(git rev-parse --short=12 main~3) && # The first detach operation is more chatty than the following ones. cat >1st_detach <<-EOF &&
t/t2022-checkout-paths.sh +11 -11
@@ -5,15 +5,15 @@ test_description='checkout $tree -- $paths' test_expect_success setup ' mkdir dir && - >dir/master && + >dir/main && echo common >dir/common && - git add dir/master dir/common && - test_tick && git commit -m "master has dir/master" && + git add dir/main dir/common && + test_tick && git commit -m "main has dir/main" && git checkout -b next && - git mv dir/master dir/next0 && + git mv dir/main dir/next0 && echo next >dir/next1 && git add dir && - test_tick && git commit -m "next has dir/next but not dir/master" + test_tick && git commit -m "next has dir/next but not dir/main" ' test_expect_success 'checking out paths out of a tree does not clobber unrelated paths' '
@@ -26,11 +26,11 @@ test_expect_success 'checking out paths out of a tree does not clobber unrelated echo untracked >expect.next2 && cat expect.next2 >dir/next2 && - git checkout master dir && + git checkout main dir && test_cmp expect.common dir/common && - test_path_is_file dir/master && - git diff --exit-code master dir/master && + test_path_is_file dir/main && + git diff --exit-code main dir/main && test_path_is_missing dir/next0 && test_cmp expect.next1 dir/next1 &&
@@ -52,11 +52,11 @@ test_expect_success 'do not touch unmerged entries matching $path but not in $tr EOF git update-index --index-info <expect.next0 && - git checkout master dir && + git checkout main dir && test_cmp expect.common dir/common && - test_path_is_file dir/master && - git diff --exit-code master dir/master && + test_path_is_file dir/main && + git diff --exit-code main dir/main && git ls-files -s dir/next0 >actual.next0 && test_cmp expect.next0 actual.next0 '
t/t2023-checkout-m.sh +5 -5
@@ -10,15 +10,15 @@ test_expect_success setup ' test_tick && test_commit both.txt both.txt initial && git branch topic && - test_commit modified_in_master both.txt in_master && - test_commit added_in_master each.txt in_master && + test_commit modified_in_main both.txt in_main && + test_commit added_in_main each.txt in_main && git checkout topic && test_commit modified_in_topic both.txt in_topic && test_commit added_in_topic each.txt in_topic ' -test_expect_success 'git merge master' ' - test_must_fail git merge master +test_expect_success 'git merge main' ' + test_must_fail git merge main ' clean_branchnames () {
@@ -61,7 +61,7 @@ test_expect_success 'force checkout a conflict file creates stage zero entry' ' git checkout topic && echo c >a && C_OBJ=$(git hash-object a) && - git checkout -m master && + git checkout -m main && test_cmp_rev :1:a $A_OBJ && test_cmp_rev :2:a $B_OBJ && test_cmp_rev :3:a $C_OBJ &&
t/t2024-checkout-dwim.sh +35 -35
238 lines not on this page · raw message
t/t2027-checkout-track.sh +3 -3
@@ -10,14 +10,14 @@ test_expect_success 'setup' ' ' test_expect_success 'checkout --track -b creates a new tracking branch' ' - git checkout --track -b branch1 master && + git checkout --track -b branch1 main && test $(git rev-parse --abbrev-ref HEAD) = branch1 && test $(git config --get branch.branch1.remote) = . && - test $(git config --get branch.branch1.merge) = refs/heads/master + test $(git config --get branch.branch1.merge) = refs/heads/main ' test_expect_success 'checkout --track -b rejects an extra path argument' ' - test_must_fail git checkout --track -b branch2 master one.t 2>err && + test_must_fail git checkout --track -b branch2 main one.t 2>err && test_i18ngrep "cannot be used with updating paths" err '
t/t2030-unresolve-info.sh +3 -3
@@ -59,7 +59,7 @@ test_expect_success setup ' test_commit fourth fi/le fourth && git checkout add-add && test_commit fifth add-differently && - git checkout master + git checkout main ' test_expect_success 'add records switch clears' '
@@ -183,8 +183,8 @@ test_expect_success 'rerere forget (binary)' ' ' test_expect_success 'rerere forget (add-add conflict)' ' - git checkout -f master && - echo master >add-differently && + git checkout -f main && + echo main >add-differently && git add add-differently && git commit -m "add differently" && test_must_fail git merge fifth &&
t/t2060-switch.sh +15 -15
@@ -23,41 +23,41 @@ test_expect_success 'switch branch' ' ' test_expect_success 'switch and detach' ' - test_when_finished git switch master && - test_must_fail git switch master^{commit} && - git switch --detach master^{commit} && + test_when_finished git switch main && + test_must_fail git switch main^{commit} && + git switch --detach main^{commit} && test_must_fail git symbolic-ref HEAD ' test_expect_success 'switch and detach current branch' ' - test_when_finished git switch master && - git switch master && + test_when_finished git switch main && + git switch main && git switch --detach && test_must_fail git symbolic-ref HEAD ' test_expect_success 'switch and create branch' ' - test_when_finished git switch master && - git switch -c temp master^ && - test_cmp_rev master^ refs/heads/temp && + test_when_finished git switch main && + git switch -c temp main^ && + test_cmp_rev main^ refs/heads/temp && echo refs/heads/temp >expected-branch && git symbolic-ref HEAD >actual-branch && test_cmp expected-branch actual-branch ' test_expect_success 'force create branch from HEAD' ' - test_when_finished git switch master && - git switch --detach master && + test_when_finished git switch main && + git switch --detach main && test_must_fail git switch -c temp && git switch -C temp && - test_cmp_rev master refs/heads/temp && + test_cmp_rev main refs/heads/temp && echo refs/heads/temp >expected-branch && git symbolic-ref HEAD >actual-branch && test_cmp expected-branch actual-branch ' test_expect_success 'new orphan branch from empty' ' - test_when_finished git switch master && + test_when_finished git switch main && test_must_fail git switch --orphan new-orphan HEAD && git switch --orphan new-orphan && test_commit orphan &&
@@ -69,7 +69,7 @@ test_expect_success 'new orphan branch from empty' ' ' test_expect_success 'orphan branch works with --discard-changes' ' - test_when_finished git switch master && + test_when_finished git switch main && echo foo >foo.txt && git switch --discard-changes --orphan new-orphan2 && git ls-files >tracked-files &&
@@ -77,7 +77,7 @@ test_expect_success 'orphan branch works with --discard-changes' ' ' test_expect_success 'switching ignores file of same branch name' ' - test_when_finished git switch master && + test_when_finished git switch main && : >first-branch && git switch first-branch && echo refs/heads/first-branch >expected &&
@@ -86,7 +86,7 @@ test_expect_success 'switching ignores file of same branch name' ' ' test_expect_success 'guess and create branch' ' - test_when_finished git switch master && + test_when_finished git switch main && test_must_fail git switch --no-guess foo && test_config checkout.guess false && test_must_fail git switch foo &&
t/t2070-restore.sh +2 -2
@@ -15,7 +15,7 @@ test_expect_success 'setup' ' echo ignored >ignored && echo /ignored >.gitignore && git add one two .gitignore && - git update-ref refs/heads/one master + git update-ref refs/heads/one main ' test_expect_success 'restore without pathspec is not ok' '
@@ -91,7 +91,7 @@ test_expect_success 'restore --ignore-unmerged ignores unmerged entries' ' git switch -c first && echo first >unmerged && git commit -am first && - git switch -c second master && + git switch -c second main && echo second >unmerged && git commit -am second && test_must_fail git merge first &&
t/t2106-update-index-assume-unchanged.sh +1 -1
@@ -19,6 +19,6 @@ test_expect_success 'do not switch branches with dirty file' \ git checkout other && echo dirt >file && git update-index --assume-unchanged file && - test_must_fail git checkout master' + test_must_fail git checkout main' test_done
t/t2400-worktree-add.sh +33 -33
218 lines not on this page · raw message
t/t2401-worktree-prune.sh +1 -1
@@ -87,7 +87,7 @@ test_expect_success 'not prune recent checkouts' ' test_expect_success 'not prune proper checkouts' ' test_when_finished rm -r .git/worktrees && - git worktree add --detach "$PWD/nop" master && + git worktree add --detach "$PWD/nop" main && git worktree prune && test -d .git/worktrees/nop '
t/t2402-worktree-list.sh +10 -10
@@ -21,7 +21,7 @@ test_expect_success 'rev-parse --git-common-dir on main worktree' ' test_expect_success 'rev-parse --git-path objects linked worktree' ' echo "$(git rev-parse --show-toplevel)/.git/objects" >expect && test_when_finished "rm -rf linked-tree actual expect && git worktree prune" && - git worktree add --detach linked-tree master && + git worktree add --detach linked-tree main && git -C linked-tree rev-parse --git-path objects >actual && test_cmp expect actual '
@@ -29,7 +29,7 @@ test_expect_success 'rev-parse --git-path objects linked worktree' ' test_expect_success '"list" all worktrees from main' ' echo "$(git rev-parse --show-toplevel) $(git rev-parse --short HEAD) [$(git symbolic-ref --short HEAD)]" >expect && test_when_finished "rm -rf here out actual expect && git worktree prune" && - git worktree add --detach here master && + git worktree add --detach here main && echo "$(git -C here rev-parse --show-toplevel) $(git rev-parse --short HEAD) (detached HEAD)" >>expect && git worktree list >out && sed "s/ */ /g" <out >actual &&
@@ -39,7 +39,7 @@ test_expect_success '"list" all worktrees from main' ' test_expect_success '"list" all worktrees from linked' ' echo "$(git rev-parse --show-toplevel) $(git rev-parse --short HEAD) [$(git symbolic-ref --short HEAD)]" >expect && test_when_finished "rm -rf here out actual expect && git worktree prune" && - git worktree add --detach here master && + git worktree add --detach here main && echo "$(git -C here rev-parse --show-toplevel) $(git rev-parse --short HEAD) (detached HEAD)" >>expect && git -C here worktree list >out && sed "s/ */ /g" <out >actual &&
@@ -52,7 +52,7 @@ test_expect_success '"list" all worktrees --porcelain' ' echo "branch $(git symbolic-ref HEAD)" >>expect && echo >>expect && test_when_finished "rm -rf here actual expect && git worktree prune" && - git worktree add --detach here master && + git worktree add --detach here main && echo "worktree $(git -C here rev-parse --show-toplevel)" >>expect && echo "HEAD $(git rev-parse HEAD)" >>expect && echo "detached" >>expect &&
@@ -63,8 +63,8 @@ test_expect_success '"list" all worktrees --porcelain' ' test_expect_success '"list" all worktrees with locked annotation' ' test_when_finished "rm -rf locked unlocked out && git worktree prune" && - git worktree add --detach locked master && - git worktree add --detach unlocked master && + git worktree add --detach locked main && + git worktree add --detach unlocked main && git worktree lock locked && git worktree list >out && grep "/locked *[0-9a-f].* locked$" out &&
@@ -76,13 +76,13 @@ test_expect_success 'bare repo setup' ' echo "data" >file1 && git add file1 && git commit -m"File1: add data" && - git push bare1 master && + git push bare1 main && git reset --hard HEAD^ ' test_expect_success '"list" all worktrees from bare main' ' test_when_finished "rm -rf there out actual expect && git -C bare1 worktree prune" && - git -C bare1 worktree add --detach ../there master && + git -C bare1 worktree add --detach ../there main && echo "$(pwd)/bare1 (bare)" >expect && echo "$(git -C there rev-parse --show-toplevel) $(git -C there rev-parse --short HEAD) (detached HEAD)" >>expect && git -C bare1 worktree list >out &&
@@ -92,7 +92,7 @@ test_expect_success '"list" all worktrees from bare main' ' test_expect_success '"list" all worktrees --porcelain from bare main' ' test_when_finished "rm -rf there actual expect && git -C bare1 worktree prune" && - git -C bare1 worktree add --detach ../there master && + git -C bare1 worktree add --detach ../there main && echo "worktree $(pwd)/bare1" >expect && echo "bare" >>expect && echo >>expect &&
@@ -106,7 +106,7 @@ test_expect_success '"list" all worktrees --porcelain from bare main' ' test_expect_success '"list" all worktrees from linked with a bare main' ' test_when_finished "rm -rf there out actual expect && git -C bare1 worktree prune" && - git -C bare1 worktree add --detach ../there master && + git -C bare1 worktree add --detach ../there main && echo "$(pwd)/bare1 (bare)" >expect && echo "$(git -C there rev-parse --show-toplevel) $(git -C there rev-parse --short HEAD) (detached HEAD)" >>expect && git -C there worktree list >out &&
t/t2405-worktree-submodule.sh +3 -3
@@ -31,7 +31,7 @@ test_expect_success 'add superproject worktree' ' ' test_expect_failure 'submodule is checked out just after worktree add' ' - git -C worktree diff --submodule master"^!" >out && + git -C worktree diff --submodule main"^!" >out && grep "file1 updated" out '
@@ -41,7 +41,7 @@ test_expect_success 'add superproject worktree and initialize submodules' ' ' test_expect_success 'submodule is checked out just after submodule update in linked worktree' ' - git -C worktree-submodule-update diff --submodule master"^!" >out && + git -C worktree-submodule-update diff --submodule main"^!" >out && grep "file1 updated" out '
@@ -51,7 +51,7 @@ test_expect_success 'add superproject worktree and manually add submodule worktr ' test_expect_success 'submodule is checked out after manually adding submodule worktree' ' - git -C linked_submodule diff --submodule master"^!" >out && + git -C linked_submodule diff --submodule main"^!" >out && grep "file1 updated" out '
t/test-lib.sh +1 -1
@@ -257,7 +257,7 @@ case "$TRASH_DIRECTORY" in esac case "$TEST_NUMBER" in -[01]*) +[0-2]*) GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME ;;
Signature · 1 line
gitgitgadget
PATCH v2 4/27 t3[0-3]*: adjust the references to the default branch name "main"
In reply to Johannes Schindelin via GitGitGadgetFrom: Johannes Schindelin <[email protected]>
This trick was performed via
$ (cd t && sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \ -e 's/Master/Main/g' -- t3[0-3]*.sh t3206/*)
This allows us to define GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main for those tests.
--- t/t3040-subprojects-basic.sh | 2 +- t/t3200-branch.sh | 242 +++++++++++++------------- t/t3201-branch-contains.sh | 80 ++++----- t/t3202-show-branch-octopus.sh | 2 +- t/t3203-branch-output.sh | 38 ++-- t/t3204-branch-name-interpretation.sh | 6 +- t/t3205-branch-color.sh | 6 +- t/t3206-range-diff.sh | 40 ++--- t/t3206/history.export | 2 +- t/t3210-pack-refs.sh | 4 +- t/t3211-peel-ref.sh | 4 +- t/t3301-notes.sh | 6 +- t/t3302-notes-index-expensive.sh | 2 +- t/t3303-notes-subtrees.sh | 8 +- t/t3304-notes-mixed.sh | 8 +- t/t3308-notes-merge.sh | 2 +- t/t3320-notes-merge-worktrees.sh | 4 +- t/test-lib.sh | 2 +- 18 files changed, 229 insertions(+), 229 deletions(-)
t/t3040-subprojects-basic.sh +1 -1
@@ -80,6 +80,6 @@ test_expect_success 'checkout in superproject' ' ' # just interesting what happened... -# git diff --name-status -M save master +# git diff --name-status -M save main test_done
t/t3200-branch.sh +121 -121
619 lines not on this page · raw message
t/t3201-branch-contains.sh +40 -40
223 lines not on this page · raw message
t/t3202-show-branch-octopus.sh +1 -1
@@ -15,7 +15,7 @@ test_expect_success 'setup' ' for i in $numbers do - git checkout -b branch$i master && + git checkout -b branch$i main && > file$i && git add file$i && test_tick &&
t/t3203-branch-output.sh +19 -19
@@ -26,7 +26,7 @@ test_expect_success 'make remote branches' ' cat >expect <<'EOF' branch-one branch-two -* master +* main EOF test_expect_success 'git branch shows local branches' ' git branch >actual &&
@@ -60,7 +60,7 @@ test_expect_success 'git branch -r shows remote branches' ' cat >expect <<'EOF' branch-one branch-two -* master +* main remotes/origin/HEAD -> origin/branch-one remotes/origin/branch-one remotes/origin/branch-two
@@ -152,7 +152,7 @@ test_expect_success 'git branch shows detached HEAD properly' ' * (HEAD detached at $(git rev-parse --short HEAD^0)) branch-one branch-two - master + main EOF git checkout HEAD^0 && git branch >actual &&
@@ -160,12 +160,12 @@ EOF ' test_expect_success 'git branch shows detached HEAD properly after checkout --detach' ' - git checkout master && + git checkout main && cat >expect <<EOF && * (HEAD detached at $(git rev-parse --short HEAD^0)) branch-one branch-two - master + main EOF git checkout --detach && git branch >actual &&
@@ -177,7 +177,7 @@ test_expect_success 'git branch shows detached HEAD properly after moving' ' * (HEAD detached from $(git rev-parse --short HEAD)) branch-one branch-two - master + main EOF git reset --hard HEAD^1 && git branch >actual &&
@@ -189,9 +189,9 @@ test_expect_success 'git branch shows detached HEAD properly from tag' ' * (HEAD detached at fromtag) branch-one branch-two - master + main EOF - git tag fromtag master && + git tag fromtag main && git checkout fromtag && git branch >actual && test_i18ncmp expect actual
@@ -202,7 +202,7 @@ test_expect_success 'git branch shows detached HEAD properly after moving from t * (HEAD detached from fromtag) branch-one branch-two - master + main EOF git reset --hard HEAD^1 && git branch >actual &&
@@ -214,7 +214,7 @@ test_expect_success 'git branch `--sort` option' ' * (HEAD detached from fromtag) branch-two branch-one - master + main EOF git branch --sort=objectsize >actual && test_i18ncmp expect actual
@@ -223,7 +223,7 @@ test_expect_success 'git branch `--sort` option' ' test_expect_success 'git branch --points-at option' ' cat >expect <<-\EOF && branch-one - master + main EOF git branch --points-at=branch-one >actual && test_cmp expect actual
@@ -260,14 +260,14 @@ test_expect_success 'sort branches, ignore case' ' cat >expected <<-\EOF && BRANCH-two branch-one - master + main EOF test_cmp expected actual && git branch --list -i | awk "{print \$NF}" >actual && cat >expected <<-\EOF && branch-one BRANCH-two - master + main EOF test_cmp expected actual )
@@ -279,7 +279,7 @@ test_expect_success 'git branch --format option' ' Refname is refs/heads/ambiguous Refname is refs/heads/branch-one Refname is refs/heads/branch-two - Refname is refs/heads/master + Refname is refs/heads/main Refname is refs/heads/ref-to-branch Refname is refs/heads/ref-to-remote EOF
@@ -293,7 +293,7 @@ test_expect_success 'worktree colors correct' ' ambiguous<RESET> branch-one<RESET> + <CYAN>branch-two<RESET> - master<RESET> + main<RESET> ref-to-branch<RESET> -> branch-one ref-to-remote<RESET> -> origin/branch-one EOF
@@ -306,9 +306,9 @@ test_expect_success 'worktree colors correct' ' ' test_expect_success "set up color tests" ' - echo "<RED>master<RESET>" >expect.color && - echo "master" >expect.bare && - color_args="--format=%(color:red)%(refname:short) --list master" + echo "<RED>main<RESET>" >expect.color && + echo "main" >expect.bare && + color_args="--format=%(color:red)%(refname:short) --list main" ' test_expect_success '%(color) omitted without tty' '
@@ -331,7 +331,7 @@ test_expect_success '--color overrides auto-color' ' test_expect_success PREPARE_FOR_MAIN_BRANCH 'verbose output lists worktree path' ' one=$(git rev-parse --short HEAD) && - two=$(git rev-parse --short master) && + two=$(git rev-parse --short main) && cat >expect <<-EOF && * (HEAD detached from fromtag) $one one ambiguous $one one
t/t3204-branch-name-interpretation.sh +3 -3
@@ -28,7 +28,7 @@ test_expect_success 'update branch via @{-1}' ' git branch previous one && git checkout previous && - git checkout master && + git checkout main && git branch -f @{-1} two && expect_branch previous two
@@ -58,7 +58,7 @@ test_expect_success 'delete branch via @{-1}' ' git branch previous-del && git checkout previous-del && - git checkout master && + git checkout main && git branch -D @{-1} && expect_deleted previous-del
@@ -98,7 +98,7 @@ test_expect_success 'disallow deleting remote branch via @{-1}' ' git update-ref refs/remotes/origin/previous one && git checkout -b origin/previous two && - git checkout master && + git checkout main && test_must_fail git branch -r -D @{-1} && expect_branch refs/remotes/origin/previous one &&
t/t3205-branch-color.sh +3 -3
@@ -5,7 +5,7 @@ test_description='basic branch output coloring' test_expect_success 'set up some sample branches' ' test_commit foo && - git update-ref refs/remotes/origin/master HEAD && + git update-ref refs/remotes/origin/main HEAD && git update-ref refs/heads/other HEAD '
@@ -19,9 +19,9 @@ test_expect_success 'set up some color config' ' test_expect_success 'regular output shows colors' ' cat >expect <<-\EOF && - * <CYAN>master<RESET> + * <CYAN>main<RESET> <BLUE>other<RESET> - <YELLOW>remotes/origin/master<RESET> + <YELLOW>remotes/origin/main<RESET> EOF git branch --color -a >actual.raw && test_decode_color <actual.raw >actual &&
t/t3206-range-diff.sh +20 -20
@@ -127,7 +127,7 @@ test_expect_success 'setup' ' ' test_expect_success 'simple A..B A..C (unmodified)' ' - git range-diff --no-color master..topic master..unmodified \ + git range-diff --no-color main..topic main..unmodified \ >actual && cat >expect <<-EOF && 1: $(test_oid t1) = 1: $(test_oid u1) s/5/A/
@@ -145,13 +145,13 @@ test_expect_success 'simple B...C (unmodified)' ' ' test_expect_success 'simple A B C (unmodified)' ' - git range-diff --no-color master topic unmodified >actual && + git range-diff --no-color main topic unmodified >actual && # same "expect" as above test_cmp expect actual ' test_expect_success 'trivial reordering' ' - git range-diff --no-color master topic reordered >actual && + git range-diff --no-color main topic reordered >actual && cat >expect <<-EOF && 1: $(test_oid t1) = 1: $(test_oid r1) s/5/A/ 3: $(test_oid t3) = 2: $(test_oid r2) s/11/B/
@@ -162,7 +162,7 @@ test_expect_success 'trivial reordering' ' ' test_expect_success 'removed a commit' ' - git range-diff --no-color master topic removed >actual && + git range-diff --no-color main topic removed >actual && cat >expect <<-EOF && 1: $(test_oid t1) = 1: $(test_oid d1) s/5/A/ 2: $(test_oid t2) < -: $(test_oid __) s/4/A/
@@ -173,7 +173,7 @@ test_expect_success 'removed a commit' ' ' test_expect_success 'added a commit' ' - git range-diff --no-color master topic added >actual && + git range-diff --no-color main topic added >actual && cat >expect <<-EOF && 1: $(test_oid t1) = 1: $(test_oid a1) s/5/A/ 2: $(test_oid t2) = 2: $(test_oid a2) s/4/A/
@@ -185,7 +185,7 @@ test_expect_success 'added a commit' ' ' test_expect_success 'new base, A B C' ' - git range-diff --no-color master topic rebased >actual && + git range-diff --no-color main topic rebased >actual && cat >expect <<-EOF && 1: $(test_oid t1) = 1: $(test_oid b1) s/5/A/ 2: $(test_oid t2) = 2: $(test_oid b2) s/4/A/
@@ -196,7 +196,7 @@ test_expect_success 'new base, A B C' ' ' test_expect_success 'new base, B...C' ' - # this syntax includes the commits from master! + # this syntax includes the commits from main! git range-diff --no-color topic...rebased >actual && cat >expect <<-EOF && -: $(test_oid __) > 1: $(test_oid b5) unrelated
@@ -420,7 +420,7 @@ test_expect_success 'file added and later removed' ' test_expect_success 'no commits on one side' ' git commit --amend -m "new message" && - git range-diff master HEAD@{1} HEAD + git range-diff main HEAD@{1} HEAD ' test_expect_success 'changed message' '
@@ -482,11 +482,11 @@ test_expect_success 'dual-coloring' ' test_cmp expect actual ' -for prev in topic master..topic +for prev in topic main..topic do test_expect_success "format-patch --range-diff=$prev" ' git format-patch --cover-letter --range-diff=$prev \ - master..unmodified >actual && + main..unmodified >actual && test_when_finished "rm 000?-*" && test_line_count = 5 actual && test_i18ngrep "^Range-diff:$" 0000-* &&
@@ -511,19 +511,19 @@ test_expect_success 'range-diff overrides diff.noprefix internally' ' test_expect_success 'basic with modified format.pretty with suffix' ' git -c format.pretty="format:commit %H%d%n" range-diff \ - master..topic master..unmodified + main..topic main..unmodified ' test_expect_success 'basic with modified format.pretty without "commit "' ' git -c format.pretty="format:%H%n" range-diff \ - master..topic master..unmodified + main..topic main..unmodified ' test_expect_success 'range-diff compares notes by default' ' git notes add -m "topic note" topic && git notes add -m "unmodified note" unmodified && test_when_finished git notes remove topic unmodified && - git range-diff --no-color master..topic master..unmodified \ + git range-diff --no-color main..topic main..unmodified \ >actual && sed s/Z/\ /g >expect <<-EOF && 1: $(test_oid t1) = 1: $(test_oid u1) s/5/A/
@@ -547,7 +547,7 @@ test_expect_success 'range-diff with --no-notes' ' git notes add -m "topic note" topic && git notes add -m "unmodified note" unmodified && test_when_finished git notes remove topic unmodified && - git range-diff --no-color --no-notes master..topic master..unmodified \ + git range-diff --no-color --no-notes main..topic main..unmodified \ >actual && cat >expect <<-EOF && 1: $(test_oid t1) = 1: $(test_oid u1) s/5/A/
@@ -565,7 +565,7 @@ test_expect_success 'range-diff with multiple --notes' ' git notes --ref=note2 add -m "topic note2" topic && git notes --ref=note2 add -m "unmodified note2" unmodified && test_when_finished git notes --ref=note2 remove topic unmodified && - git range-diff --no-color --notes=note1 --notes=note2 master..topic master..unmodified \ + git range-diff --no-color --notes=note1 --notes=note2 main..topic main..unmodified \ >actual && sed s/Z/\ /g >expect <<-EOF && 1: $(test_oid t1) = 1: $(test_oid u1) s/5/A/
@@ -595,7 +595,7 @@ test_expect_success 'format-patch --range-diff does not compare notes by default git notes add -m "unmodified note" unmodified && test_when_finished git notes remove topic unmodified && git format-patch --cover-letter --range-diff=$prev \ - master..unmodified >actual && + main..unmodified >actual && test_when_finished "rm 000?-*" && test_line_count = 5 actual && test_i18ngrep "^Range-diff:$" 0000-* &&
@@ -612,7 +612,7 @@ test_expect_success 'format-patch --range-diff with --no-notes' ' git notes add -m "unmodified note" unmodified && test_when_finished git notes remove topic unmodified && git format-patch --no-notes --cover-letter --range-diff=$prev \ - master..unmodified >actual && + main..unmodified >actual && test_when_finished "rm 000?-*" && test_line_count = 5 actual && test_i18ngrep "^Range-diff:$" 0000-* &&
@@ -629,7 +629,7 @@ test_expect_success 'format-patch --range-diff with --notes' ' git notes add -m "unmodified note" unmodified && test_when_finished git notes remove topic unmodified && git format-patch --notes --cover-letter --range-diff=$prev \ - master..unmodified >actual && + main..unmodified >actual && test_when_finished "rm 000?-*" && test_line_count = 5 actual && test_i18ngrep "^Range-diff:$" 0000-* &&
@@ -658,7 +658,7 @@ test_expect_success 'format-patch --range-diff with format.notes config' ' test_when_finished git notes remove topic unmodified && test_config format.notes true && git format-patch --cover-letter --range-diff=$prev \ - master..unmodified >actual && + main..unmodified >actual && test_when_finished "rm 000?-*" && test_line_count = 5 actual && test_i18ngrep "^Range-diff:$" 0000-* &&
@@ -689,7 +689,7 @@ test_expect_success 'format-patch --range-diff with multiple notes' ' git notes --ref=note2 add -m "unmodified note2" unmodified && test_when_finished git notes --ref=note2 remove topic unmodified && git format-patch --notes=note1 --notes=note2 --cover-letter --range-diff=$prev \ - master..unmodified >actual && + main..unmodified >actual && test_when_finished "rm 000?-*" && test_line_count = 5 actual && test_i18ngrep "^Range-diff:$" 0000-* &&
t/t3206/history.export +1 -1
@@ -168,7 +168,7 @@ mark :11 data 10 unrelated -commit refs/heads/master +commit refs/heads/main mark :12 author Thomas Rast <[email protected]> 1374485127 +0200 committer Thomas Rast <[email protected]> 1374485127 +0200
t/t3210-pack-refs.sh +2 -2
@@ -135,7 +135,7 @@ test_expect_success 'delete ref with dangling packed version' ' git commit --allow-empty -m "future garbage" && git pack-refs --all && git reset --hard HEAD^ && - git checkout master && + git checkout main && git reflog expire --expire=all --all && git prune --expire=all && git branch -d lamb 2>result &&
@@ -240,7 +240,7 @@ test_expect_success 'retry acquiring packed-refs.lock' ' test_expect_success SYMLINKS 'pack symlinked packed-refs' ' # First make sure that symlinking works when reading: - git update-ref refs/heads/lossy refs/heads/master && + git update-ref refs/heads/lossy refs/heads/main && git for-each-ref >all-refs-before && mv .git/packed-refs .git/my-deviant-packed-refs && ln -s my-deviant-packed-refs .git/packed-refs &&
t/t3211-peel-ref.sh +2 -2
@@ -19,7 +19,7 @@ print_ref() { test_expect_success 'set up expected show-ref output' ' { - print_ref "refs/heads/master" && + print_ref "refs/heads/main" && print_ref "refs/outside/foo" && print_ref "refs/outside/foo^{}" && print_ref "refs/tags/base" &&
@@ -47,7 +47,7 @@ test_expect_success 'create old-style pack-refs without fully-peeled' ' # know we are emulating exactly what an older git would have written. { echo "# pack-refs with: peeled " && - print_ref "refs/heads/master" && + print_ref "refs/heads/main" && print_ref "refs/outside/foo" && print_ref "refs/tags/base" && print_ref "refs/tags/foo" &&
t/t3301-notes.sh +3 -3
@@ -1295,11 +1295,11 @@ test_expect_success 'git notes copy diagnoses too many or too few parameters' ' test_i18ngrep "too many parameters" error ' -test_expect_success 'git notes get-ref expands refs/heads/master to refs/notes/refs/heads/master' ' +test_expect_success 'git notes get-ref expands refs/heads/main to refs/notes/refs/heads/main' ' test_unconfig core.notesRef && sane_unset GIT_NOTES_REF && - echo refs/notes/refs/heads/master >expect && - git notes --ref=refs/heads/master get-ref >actual && + echo refs/notes/refs/heads/main >expect && + git notes --ref=refs/heads/main get-ref >actual && test_cmp expect actual '
t/t3302-notes-index-expensive.sh +1 -1
@@ -20,7 +20,7 @@ create_repo () { notemark=$(($mark+1)) test_tick && cat <<-INPUT_END && - commit refs/heads/master + commit refs/heads/main mark :$mark committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT
t/t3303-notes-subtrees.sh +4 -4
@@ -40,7 +40,7 @@ test_expect_success "setup: create $number_of_commits commits" ' nr=$(($nr+1)) && test_tick && cat <<INPUT_END -commit refs/heads/master +commit refs/heads/main committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT commit #$nr
@@ -75,7 +75,7 @@ test_sha1_based () { ( start_note_commit && nr=$number_of_commits && - git rev-list refs/heads/master | + git rev-list refs/heads/main | while read sha1; do note_path=$(echo "$sha1" | sed "$1") cat <<INPUT_END &&
@@ -105,7 +105,7 @@ test_same_notes () { ( start_note_commit && nr=$number_of_commits && - git rev-list refs/heads/master | + git rev-list refs/heads/main | while read sha1; do first_note_path=$(echo "$sha1" | sed "$1") second_note_path=$(echo "$sha1" | sed "$2")
@@ -144,7 +144,7 @@ test_concatenated_notes () { ( start_note_commit && nr=$number_of_commits && - git rev-list refs/heads/master | + git rev-list refs/heads/main | while read sha1; do first_note_path=$(echo "$sha1" | sed "$1") second_note_path=$(echo "$sha1" | sed "$2")
t/t3304-notes-mixed.sh +4 -4
@@ -36,7 +36,7 @@ test_expect_success "setup: create a couple of commits" ' test_tick && cat <<INPUT_END >input && -commit refs/heads/master +commit refs/heads/main committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT commit #1
@@ -51,7 +51,7 @@ INPUT_END test_tick && cat <<INPUT_END >>input && -commit refs/heads/master +commit refs/heads/main committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE data <<COMMIT commit #2
@@ -68,8 +68,8 @@ INPUT_END test_expect_success "create a notes tree with both notes and non-notes" ' - commit1=$(git rev-parse refs/heads/master^) && - commit2=$(git rev-parse refs/heads/master) && + commit1=$(git rev-parse refs/heads/main^) && + commit2=$(git rev-parse refs/heads/main) && test_tick && cat <<INPUT_END >input && commit refs/notes/commits
t/t3308-notes-merge.sh +1 -1
@@ -108,7 +108,7 @@ test_expect_success 'fail to merge into various non-notes refs' ' git update-ref refs/notes/dir/foo HEAD && test_must_fail git -c "core.notesRef=refs/notes/dir" notes merge x && test_must_fail git -c "core.notesRef=refs/notes/dir/" notes merge x && - test_must_fail git -c "core.notesRef=refs/heads/master" notes merge x && + test_must_fail git -c "core.notesRef=refs/heads/main" notes merge x && test_must_fail git -c "core.notesRef=refs/notes/y:" notes merge x && test_must_fail git -c "core.notesRef=refs/notes/y:foo" notes merge x && test_must_fail git -c "core.notesRef=refs/notes/foo^{bar" notes merge x
t/t3320-notes-merge-worktrees.sh +2 -2
@@ -36,8 +36,8 @@ test_expect_success 'modify notes ref ourselves (x)' ' ' test_expect_success 'create some new worktrees' ' - git worktree add -b newbranch worktree master && - git worktree add -b newbranch2 worktree2 master + git worktree add -b newbranch worktree main && + git worktree add -b newbranch2 worktree2 main ' test_expect_success 'merge z into y fails and sets NOTES_MERGE_REF' '
t/test-lib.sh +1 -1
@@ -257,7 +257,7 @@ case "$TRASH_DIRECTORY" in esac case "$TEST_NUMBER" in -[0-2]*) +[0-2]*|3[0-3]*) GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME ;;
Signature · 1 line
gitgitgadget
PATCH v2 5/27 t3416: preemptively adjust alignment in a comment
In reply to Johannes Schindelin via GitGitGadgetFrom: Johannes Schindelin <[email protected]>
We are about to adjust t3416 for the new default branch name main. This name is two characters shorter and therefore needs two spaces more padding to align correctly.
Adjusting the alignment before the big search-and-replace makes it easier to verify that the final result does not leave any misaligned lines behind.
--- t/t3416-rebase-onto-threedots.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
t/t3416-rebase-onto-threedots.sh +1 -1
@@ -12,7 +12,7 @@ test_description='git rebase --onto A...B' # # F---G topic G' # / / -# A---B---C---D---E master --> A---B---C---D---E +# A---B---C---D---E master --> A---B---C---D---E # \ \ / # \ x # \ / \
Signature · 1 line
gitgitgadget
PATCH v2 6/27 t34*: adjust the references to the default branch name "main"
In reply to Johannes Schindelin via GitGitGadgetFrom: Johannes Schindelin <[email protected]>
Carefully excluding t3404, which sees independent development elsewhere at the time of writing, we use main as the default branch name in t34*. This trick was performed via
$ (cd t && sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \ -e 's/Master/Main/g' -- t34*.sh && git checkout HEAD -- t34\*)
This allows us to define GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main for those tests.
--- t/t3400-rebase.sh | 60 +++++++++++++++---------------- t/t3402-rebase-merge.sh | 44 +++++++++++------------ t/t3403-rebase-skip.sh | 6 ++-- t/t3405-rebase-malformed.sh | 8 ++--- t/t3406-rebase-message.sh | 24 ++++++------- t/t3407-rebase-abort.sh | 18 +++++----- t/t3408-rebase-multi-line.sh | 2 +- t/t3409-rebase-preserve-merges.sh | 10 +++--- t/t3412-rebase-root.sh | 28 +++++++-------- t/t3413-rebase-hook.sh | 42 +++++++++++----------- t/t3415-rebase-autosquash.sh | 2 +- t/t3416-rebase-onto-threedots.sh | 54 ++++++++++++++-------------- t/t3418-rebase-continue.sh | 24 ++++++------- t/t3419-rebase-patch-id.sh | 12 +++---- t/t3420-rebase-autostash.sh | 8 ++--- t/t3423-rebase-reword.sh | 6 ++-- t/t3427-rebase-subtree.sh | 20 +++++------ t/t3430-rebase-merges.sh | 16 ++++----- t/t3431-rebase-fork-point.sh | 32 ++++++++--------- t/t3432-rebase-fast-forward.sh | 34 +++++++++--------- t/t3434-rebase-i18n.sh | 8 ++--- t/t3435-rebase-gpg-sign.sh | 4 +-- t/t3436-rebase-more-options.sh | 2 +- t/test-lib.sh | 8 ++++- 24 files changed, 239 insertions(+), 233 deletions(-)
t/t3400-rebase.sh +30 -30
@@ -24,15 +24,15 @@ test_expect_success 'prepare repository with topic branches' ' git update-index --add Y && git commit -m "Add Y." && git checkout -b filemove && - git reset --soft master && + git reset --soft main && mkdir D && git mv A D/A && git commit -m "Move A." && - git checkout -b my-topic-branch master && + git checkout -b my-topic-branch main && echo Second >B && git update-index --add B && git commit -m "Add B." && - git checkout -f master && + git checkout -f main && echo Third >>A && git update-index A && git commit -m "Modify A." &&
@@ -46,23 +46,23 @@ test_expect_success 'prepare repository with topic branches' ' test_expect_success 'rebase on dirty worktree' ' echo dirty >>A && - test_must_fail git rebase master + test_must_fail git rebase main ' test_expect_success 'rebase on dirty cache' ' git add A && - test_must_fail git rebase master + test_must_fail git rebase main ' -test_expect_success 'rebase against master' ' +test_expect_success 'rebase against main' ' git reset --hard HEAD && - git rebase master + git rebase main ' test_expect_success 'rebase sets ORIG_HEAD to pre-rebase state' ' git checkout -b orig-head topic && pre="$(git rev-parse --verify HEAD)" && - git rebase master && + git rebase main && test_cmp_rev "$pre" ORIG_HEAD && test_cmp_rev ! "$pre" HEAD '
@@ -93,19 +93,19 @@ test_expect_success 'HEAD was detached during rebase' ' test_expect_success 'rebase from ambiguous branch name' ' git checkout -b topic side && - git rebase master + git rebase main ' test_expect_success 'rebase off of the previous branch using "-"' ' - git checkout master && + git checkout main && git checkout HEAD^ && git rebase @{-1} >expect.messages && - git merge-base master HEAD >expect.forkpoint && + git merge-base main HEAD >expect.forkpoint && - git checkout master && + git checkout main && git checkout HEAD^ && git rebase - >actual.messages && - git merge-base master HEAD >actual.forkpoint && + git merge-base main HEAD >actual.forkpoint && test_cmp expect.forkpoint actual.forkpoint && # the next one is dubious---we may want to say "-",
@@ -114,7 +114,7 @@ test_expect_success 'rebase off of the previous branch using "-"' ' ' test_expect_success 'rebase a single mode change' ' - git checkout master && + git checkout main && git branch -D topic && echo 1 >X && git add X &&
@@ -126,7 +126,7 @@ test_expect_success 'rebase a single mode change' ' test_chmod +x A && test_tick && git commit -m modechange && - GIT_TRACE=1 git rebase master + GIT_TRACE=1 git rebase main ' test_expect_success 'rebase is not broken by diff.renames' '
@@ -162,11 +162,11 @@ test_expect_success 'fail when upstream arg is missing and not configured' ' test_expect_success 'rebase works with format.useAutoBase' ' test_config format.useAutoBase true && git checkout topic && - git rebase master + git rebase main ' test_expect_success 'default to common base in @{upstream}s reflog if no upstream arg (--merge)' ' - git checkout -b default-base master && + git checkout -b default-base main && git checkout -b default topic && git config branch.default.remote . && git config branch.default.merge refs/heads/default-base &&
@@ -184,7 +184,7 @@ test_expect_success 'default to common base in @{upstream}s reflog if no upstrea ' test_expect_success 'default to common base in @{upstream}s reflog if no upstream arg (--apply)' ' - git checkout -B default-base master && + git checkout -B default-base main && git checkout -B default topic && git config branch.default.remote . && git config branch.default.merge refs/heads/default-base &&
@@ -226,13 +226,13 @@ test_expect_success 'cherry-picked commits and fork-point work together' ' test_expect_success 'rebase --apply -q is quiet' ' git checkout -b quiet topic && - git rebase --apply -q master >output.out 2>&1 && + git rebase --apply -q main >output.out 2>&1 && test_must_be_empty output.out ' test_expect_success 'rebase --merge -q is quiet' ' git checkout -B quiet topic && - git rebase --merge -q master >output.out 2>&1 && + git rebase --merge -q main >output.out 2>&1 && test_must_be_empty output.out '
@@ -294,7 +294,7 @@ test_expect_success 'rebase commit with an ancient timestamp' ' ' test_expect_success 'rebase with "From " line in commit message' ' - git checkout -b preserve-from master~1 && + git checkout -b preserve-from main~1 && cat >From_.msg <<EOF && Somebody embedded an mbox in a commit message
@@ -310,7 +310,7 @@ EOF >From_ && git add From_ && git commit -F From_.msg && - git rebase master && + git rebase main && git log -1 --pretty=format:%B >out && test_cmp From_.msg out '
@@ -357,12 +357,12 @@ test_expect_success 'rebase --apply and .gitattributes' ' git cherry-pick test && git checkout test && - git rebase master && + git rebase main && grep "smudged" a.txt && git checkout removal && git reset --hard && - git rebase master && + git rebase main && grep "clean" a.txt ) '
@@ -402,20 +402,20 @@ test_expect_success 'rebase -c rebase.useBuiltin=false warning' ' ' test_expect_success 'switch to branch checked out here' ' - git checkout master && - git rebase master master + git checkout main && + git rebase main main ' test_expect_success 'switch to branch not checked out' ' - git checkout master && + git checkout main && git branch other && - git rebase master other + git rebase main other ' test_expect_success 'refuse to switch to branch checked out elsewhere' ' - git checkout master && + git checkout main && git worktree add wt && - test_must_fail git -C wt rebase master master 2>err && + test_must_fail git -C wt rebase main main 2>err && test_i18ngrep "already checked out" err '
t/t3402-rebase-merge.sh +22 -22
132 lines not on this page · raw message
t/t3403-rebase-skip.sh +3 -3
@@ -48,7 +48,7 @@ test_expect_success setup ' ' test_expect_success 'rebase with git am -3 (default)' ' - test_must_fail git rebase master + test_must_fail git rebase main ' test_expect_success 'rebase --skip can not be used with other options' '
@@ -64,7 +64,7 @@ test_expect_success 'rebase moves back to skip-reference' ' test refs/heads/skip-reference = $(git symbolic-ref HEAD) && git branch post-rebase && git reset --hard pre-rebase && - test_must_fail git rebase master && + test_must_fail git rebase main && echo "hello" > hello && git add hello && git rebase --continue &&
@@ -75,7 +75,7 @@ test_expect_success 'rebase moves back to skip-reference' ' test_expect_success 'checkout skip-merge' 'git checkout -f skip-merge' test_expect_success 'rebase with --merge' ' - test_must_fail git rebase --merge master + test_must_fail git rebase --merge main ' test_expect_success 'rebase --skip with --merge' '
t/t3405-rebase-malformed.sh +4 -4
@@ -52,7 +52,7 @@ test_expect_success setup ' git add file3 && git commit --allow-empty-message -m "" && - git checkout master && + git checkout main && echo One >file1 && test_tick &&
@@ -62,7 +62,7 @@ test_expect_success setup ' test_expect_success 'rebase commit with multi-line subject' ' - git rebase master multi-line-subject && + git rebase main multi-line-subject && git cat-file commit HEAD | sed -e "1,/^\$/d" >F1 && test_cmp F0 F1 &&
@@ -70,14 +70,14 @@ test_expect_success 'rebase commit with multi-line subject' ' ' test_expect_success 'rebase commit with diff in message' ' - git rebase master diff-in-message && + git rebase main diff-in-message && git cat-file commit HEAD | sed -e "1,/^$/d" >G1 && test_cmp G0 G1 && test_cmp G G0 ' test_expect_success 'rebase -m commit with empty message' ' - git rebase -m master empty-message-merge + git rebase -m main empty-message-merge ' test_expect_success 'rebase -i commit with empty message' '
t/t3406-rebase-message.sh +12 -12
@@ -18,27 +18,27 @@ test_expect_success 'setup' ' ' test_expect_success 'rebase -m' ' - git rebase -m master >actual && + git rebase -m main >actual && test_must_be_empty actual ' -test_expect_success 'rebase against master twice' ' - git rebase --apply master >out && +test_expect_success 'rebase against main twice' ' + git rebase --apply main >out && test_i18ngrep "Current branch topic is up to date" out ' -test_expect_success 'rebase against master twice with --force' ' - git rebase --force-rebase --apply master >out && +test_expect_success 'rebase against main twice with --force' ' + git rebase --force-rebase --apply main >out && test_i18ngrep "Current branch topic is up to date, rebase forced" out ' -test_expect_success 'rebase against master twice from another branch' ' +test_expect_success 'rebase against main twice from another branch' ' git checkout topic^ && - git rebase --apply master topic >out && + git rebase --apply main topic >out && test_i18ngrep "Current branch topic is up to date" out ' -test_expect_success 'rebase fast-forward to master' ' +test_expect_success 'rebase fast-forward to main' ' git checkout topic^ && git rebase --apply topic >out && test_i18ngrep "Fast-forwarded HEAD to topic" out
@@ -46,21 +46,21 @@ test_expect_success 'rebase fast-forward to master' ' test_expect_success 'rebase --stat' ' git reset --hard start && - git rebase --stat master >diffstat.txt && + git rebase --stat main >diffstat.txt && grep "^ fileX | *1 +$" diffstat.txt ' test_expect_success 'rebase w/config rebase.stat' ' git reset --hard start && git config rebase.stat true && - git rebase master >diffstat.txt && + git rebase main >diffstat.txt && grep "^ fileX | *1 +$" diffstat.txt ' test_expect_success 'rebase -n overrides config rebase.stat config' ' git reset --hard start && git config rebase.stat true && - git rebase -n master >diffstat.txt && + git rebase -n main >diffstat.txt && ! grep "^ fileX | *1 +$" diffstat.txt '
@@ -113,7 +113,7 @@ test_expect_success 'rebase -i onto unrelated history' ' git init unrelated && test_commit -C unrelated 1 && git -C unrelated remote add -f origin "$PWD" && - git -C unrelated branch --set-upstream-to=origin/master && + git -C unrelated branch --set-upstream-to=origin/main && git -C unrelated -c core.editor=true rebase -i -v --stat >actual && test_i18ngrep "Changes to " actual && test_i18ngrep "5 files changed" actual
t/t3407-rebase-abort.sh +9 -9
@@ -37,7 +37,7 @@ testrebase() { cd "$work_dir" && # Clean up the state from the previous one git reset --hard pre-rebase && - test_must_fail git rebase$type master && + test_must_fail git rebase$type main && test_path_is_dir "$dotest" && git rebase --abort && test $(git rev-parse to-rebase) = $(git rev-parse pre-rebase) &&
@@ -48,10 +48,10 @@ testrebase() { cd "$work_dir" && # Clean up the state from the previous one git reset --hard pre-rebase && - test_must_fail git rebase$type master && + test_must_fail git rebase$type main && test_path_is_dir "$dotest" && test_must_fail git rebase --skip && - test $(git rev-parse HEAD) = $(git rev-parse master) && + test $(git rev-parse HEAD) = $(git rev-parse main) && git rebase --abort && test $(git rev-parse to-rebase) = $(git rev-parse pre-rebase) && test ! -d "$dotest"
@@ -61,13 +61,13 @@ testrebase() { cd "$work_dir" && # Clean up the state from the previous one git reset --hard pre-rebase && - test_must_fail git rebase$type master && + test_must_fail git rebase$type main && test_path_is_dir "$dotest" && echo c > a && echo d >> a && git add a && test_must_fail git rebase --continue && - test $(git rev-parse HEAD) != $(git rev-parse master) && + test $(git rev-parse HEAD) != $(git rev-parse main) && git rebase --abort && test $(git rev-parse to-rebase) = $(git rev-parse pre-rebase) && test ! -d "$dotest"
@@ -78,7 +78,7 @@ testrebase() { # Clean up the state from the previous one git reset --hard pre-rebase && git reflog show to-rebase > reflog_before && - test_must_fail git rebase$type master && + test_must_fail git rebase$type main && git rebase --abort && git reflog show to-rebase > reflog_after && test_cmp reflog_before reflog_after &&
@@ -89,7 +89,7 @@ testrebase() { cd "$work_dir" && # Clean up the state from the previous one git reset --hard pre-rebase && - test_must_fail git rebase$type master && + test_must_fail git rebase$type main && test_must_fail git rebase -v --abort && test_must_fail git rebase --abort -v && git rebase --abort
@@ -103,7 +103,7 @@ test_expect_success 'rebase --apply --quit' ' cd "$work_dir" && # Clean up the state from the previous one git reset --hard pre-rebase && - test_must_fail git rebase --apply master && + test_must_fail git rebase --apply main && test_path_is_dir .git/rebase-apply && head_before=$(git rev-parse HEAD) && git rebase --quit &&
@@ -115,7 +115,7 @@ test_expect_success 'rebase --merge --quit' ' cd "$work_dir" && # Clean up the state from the previous one git reset --hard pre-rebase && - test_must_fail git rebase --merge master && + test_must_fail git rebase --merge main && test_path_is_dir .git/rebase-merge && head_before=$(git rev-parse HEAD) && git rebase --quit &&
t/t3408-rebase-multi-line.sh +1 -1
@@ -46,7 +46,7 @@ But otherwise with a sane description." side2 && test_expect_success rebase ' git checkout side && - git rebase master && + git rebase main && git cat-file commit HEAD | sed -e "1,/^\$/d" >actual && git cat-file commit side@{1} | sed -e "1,/^\$/d" >expect && test_cmp expect actual
t/t3409-rebase-preserve-merges.sh +5 -5
@@ -18,7 +18,7 @@ export GIT_AUTHOR_EMAIL # Clone 2 (conflicting merge): # -# A1--A2--B3 <-- origin/master +# A1--A2--B3 <-- origin/main # \ \ # B1------M <-- topic # \
@@ -26,7 +26,7 @@ export GIT_AUTHOR_EMAIL # # Clone 3 (no-ff merge): # -# A1--A2--B3 <-- origin/master +# A1--A2--B3 <-- origin/main # \ # B1------M <-- topic # \ /
@@ -44,7 +44,7 @@ test_expect_success 'setup for merge-preserving rebase' \ echo Second > B && git add B && git commit -m "Add B1" && - git checkout -f master && + git checkout -f main && echo Third >> A && git commit -a -m "Modify A2" && echo Fifth > B &&
@@ -55,10 +55,10 @@ test_expect_success 'setup for merge-preserving rebase' \ ( cd clone2 && git checkout -b topic origin/topic && - test_must_fail git merge origin/master && + test_must_fail git merge origin/main && echo Resolved >B && git add B && - git commit -m "Merge origin/master into topic" + git commit -m "Merge origin/main into topic" ) && git clone ./. clone3 &&
t/t3412-rebase-root.sh +14 -14
@@ -24,7 +24,7 @@ test_expect_success 'prepare repository' ' test_expect_success 'rebase --root fails with too many args' ' git checkout -B fail other && - test_must_fail git rebase --onto master --root fail fail + test_must_fail git rebase --onto main --root fail fail ' test_expect_success 'setup pre-rebase hook' '
@@ -44,7 +44,7 @@ EOF test_expect_success 'rebase --root --onto <newbase>' ' git checkout -b work other && - git rebase --root --onto master && + git rebase --root --onto main && git log --pretty=tformat:"%s" > rebased && test_cmp expect rebased '
@@ -55,7 +55,7 @@ test_expect_success 'pre-rebase got correct input (1)' ' test_expect_success 'rebase --root --onto <newbase> <branch>' ' git branch work2 other && - git rebase --root --onto master work2 && + git rebase --root --onto main work2 && git log --pretty=tformat:"%s" > rebased2 && test_cmp expect rebased2 '
@@ -66,7 +66,7 @@ test_expect_success 'pre-rebase got correct input (2)' ' test_expect_success 'rebase -i --root --onto <newbase>' ' git checkout -b work3 other && - git rebase -i --root --onto master && + git rebase -i --root --onto main && git log --pretty=tformat:"%s" > rebased3 && test_cmp expect rebased3 '
@@ -77,7 +77,7 @@ test_expect_success 'pre-rebase got correct input (3)' ' test_expect_success 'rebase -i --root --onto <newbase> <branch>' ' git branch work4 other && - git rebase -i --root --onto master work4 && + git rebase -i --root --onto main work4 && git log --pretty=tformat:"%s" > rebased4 && test_cmp expect rebased4 '
@@ -88,7 +88,7 @@ test_expect_success 'pre-rebase got correct input (4)' ' test_expect_success REBASE_P 'rebase -i -p with linear history' ' git checkout -b work5 other && - git rebase -i -p --root --onto master && + git rebase -i -p --root --onto main && git log --pretty=tformat:"%s" > rebased5 && test_cmp expect rebased5 '
@@ -122,7 +122,7 @@ EOF test_expect_success REBASE_P 'rebase -i -p with merge' ' git checkout -b work6 other && - git rebase -i -p --root --onto master && + git rebase -i -p --root --onto main && log_with_names work6 > rebased6 && test_cmp expect-side rebased6 '
@@ -157,7 +157,7 @@ EOF test_expect_success REBASE_P 'rebase -i -p with two roots' ' git checkout -b work7 other && - git rebase -i -p --root --onto master && + git rebase -i -p --root --onto main && log_with_names work7 > rebased7 && test_cmp expect-third rebased7 '
@@ -173,14 +173,14 @@ EOF test_expect_success 'pre-rebase hook stops rebase' ' git checkout -b stops1 other && - test_must_fail git rebase --root --onto master && + test_must_fail git rebase --root --onto main && test "z$(git symbolic-ref HEAD)" = zrefs/heads/stops1 && test 0 = $(git rev-list other...stops1 | wc -l) ' test_expect_success 'pre-rebase hook stops rebase -i' ' git checkout -b stops2 other && - test_must_fail git rebase --root --onto master && + test_must_fail git rebase --root --onto main && test "z$(git symbolic-ref HEAD)" = zrefs/heads/stops2 && test 0 = $(git rev-list other...stops2 | wc -l) '
@@ -190,7 +190,7 @@ test_expect_success 'remove pre-rebase hook' ' ' test_expect_success 'set up a conflict' ' - git checkout master && + git checkout main && echo conflict > B && git add B && git commit -m conflict
@@ -198,7 +198,7 @@ test_expect_success 'set up a conflict' ' test_expect_success 'rebase --root with conflict (first part)' ' git checkout -b conflict1 other && - test_must_fail git rebase --root --onto master && + test_must_fail git rebase --root --onto main && git ls-files -u | grep "B$" '
@@ -225,7 +225,7 @@ test_expect_success 'rebase --root with conflict (second part)' ' test_expect_success 'rebase -i --root with conflict (first part)' ' git checkout -b conflict2 other && - test_must_fail git rebase -i --root --onto master && + test_must_fail git rebase -i --root --onto main && git ls-files -u | grep "B$" '
@@ -263,7 +263,7 @@ EOF test_expect_success REBASE_P 'rebase -i -p --root with conflict (first part)' ' git checkout -b conflict3 other && - test_must_fail git rebase -i -p --root --onto master && + test_must_fail git rebase -i -p --root --onto main && git ls-files -u | grep "B$" '
t/t3413-rebase-hook.sh +21 -21
123 lines not on this page · raw message
t/t3415-rebase-autosquash.sh +1 -1
@@ -407,7 +407,7 @@ test_expect_success 'wrapped original subject' ' test_expect_success 'abort last squash' ' test_when_finished "test_might_fail git rebase --abort" && - test_when_finished "git checkout master" && + test_when_finished "git checkout main" && git checkout -b some-squashes && git commit --allow-empty -m first &&
t/t3416-rebase-onto-threedots.sh +27 -27
167 lines not on this page · raw message
t/t3418-rebase-continue.sh +12 -12
@@ -15,13 +15,13 @@ test_expect_success 'setup' ' git checkout -b topic HEAD^ && test_commit "commit-new-file-F2-on-topic-branch" F2 22 && - git checkout master + git checkout main ' test_expect_success 'interactive rebase --continue works with touched file' ' rm -fr .git/rebase-* && git reset --hard && - git checkout master && + git checkout main && FAKE_LINES="edit 1" git rebase -i HEAD^ && test-tool chmtime =-60 F1 &&
@@ -31,9 +31,9 @@ test_expect_success 'interactive rebase --continue works with touched file' ' test_expect_success 'non-interactive rebase --continue works with touched file' ' rm -fr .git/rebase-* && git reset --hard && - git checkout master && + git checkout main && - test_must_fail git rebase --onto master master topic && + test_must_fail git rebase --onto main main topic && echo "Resolved" >F2 && git add F2 && test-tool chmtime =-60 F1 &&
@@ -61,7 +61,7 @@ test_expect_success 'rebase --continue remembers merge strategy and options' ' chmod +x test-bin/git-merge-funny && ( PATH=./test-bin:$PATH && - test_must_fail git rebase -s funny -Xopt master topic + test_must_fail git rebase -s funny -Xopt main topic ) && test -f funny.was.run && rm funny.was.run &&
@@ -93,7 +93,7 @@ test_expect_success 'rebase -i --continue handles merge strategy and options' ' chmod +x test-bin/git-merge-funny && ( PATH=./test-bin:$PATH && - test_must_fail git rebase -i -s funny -Xopt -Xfoo master topic + test_must_fail git rebase -i -s funny -Xopt -Xfoo main topic ) && test -f funny.was.run && rm funny.was.run &&
@@ -188,11 +188,11 @@ test_expect_success '--skip after failed fixup cleans commit message' ' test_expect_success 'setup rerere database' ' rm -fr .git/rebase-* && git reset --hard commit-new-file-F3-on-topic-branch && - git checkout master && + git checkout main && test_commit "commit-new-file-F3" F3 3 && test_config rerere.enabled true && git update-ref refs/heads/topic commit-new-file-F3-on-topic-branch && - test_must_fail git rebase -m master topic && + test_must_fail git rebase -m main topic && echo "Resolved" >F2 && cp F2 expected-F2 && git add F2 &&
@@ -207,7 +207,7 @@ test_expect_success 'setup rerere database' ' prepare () { rm -fr .git/rebase-* && git reset --hard commit-new-file-F3-on-topic-branch && - git checkout master && + git checkout main && test_config rerere.enabled true }
@@ -215,7 +215,7 @@ test_rerere_autoupdate () { action=$1 && test_expect_success "rebase $action --continue remembers --rerere-autoupdate" ' prepare && - test_must_fail git rebase $action --rerere-autoupdate master topic && + test_must_fail git rebase $action --rerere-autoupdate main topic && test_cmp expected-F2 F2 && git diff-files --quiet && test_must_fail git rebase --continue &&
@@ -227,7 +227,7 @@ test_rerere_autoupdate () { test_expect_success "rebase $action --continue honors rerere.autoUpdate" ' prepare && test_config rerere.autoupdate true && - test_must_fail git rebase $action master topic && + test_must_fail git rebase $action main topic && test_cmp expected-F2 F2 && git diff-files --quiet && test_must_fail git rebase --continue &&
@@ -239,7 +239,7 @@ test_rerere_autoupdate () { test_expect_success "rebase $action --continue remembers --no-rerere-autoupdate" ' prepare && test_config rerere.autoupdate true && - test_must_fail git rebase $action --no-rerere-autoupdate master topic && + test_must_fail git rebase $action --no-rerere-autoupdate main topic && test_cmp expected-F2 F2 && test_must_fail git diff-files --quiet && git add F2 &&
t/t3419-rebase-patch-id.sh +6 -6
@@ -24,7 +24,7 @@ test_expect_success 'setup' ' test_expect_success 'setup: 500 lines' ' rm -f .gitattributes && - git checkout -q -f master && + git checkout -q -f main && git reset --hard root && test_seq 500 >file && git add file &&
@@ -40,7 +40,7 @@ test_expect_success 'setup: 500 lines' ' git add newfile && git commit -q -m "add small file" && - git cherry-pick master >/dev/null 2>&1 + git cherry-pick main >/dev/null 2>&1 ' test_expect_success 'setup attributes' '
@@ -48,18 +48,18 @@ test_expect_success 'setup attributes' ' ' test_expect_success 'detect upstream patch' ' - git checkout -q master && + git checkout -q main && scramble file && git add file && git commit -q -m "change big file again" && git checkout -q other^{} && - git rebase master && - git rev-list master...HEAD~ >revs && + git rebase main && + git rev-list main...HEAD~ >revs && test_must_be_empty revs ' test_expect_success 'do not drop patch' ' - git branch -f squashed master && + git branch -f squashed main && git checkout -q -f squashed && git reset -q --soft HEAD~2 && git commit -q -m squashed &&
t/t3420-rebase-autostash.sh +4 -4
@@ -21,12 +21,12 @@ test_expect_success setup ' git add . && test_tick && git commit -m "third commit" && - git checkout -b unrelated-onto-branch master && + git checkout -b unrelated-onto-branch main && echo unrelated >file4 && git add . && test_tick && git commit -m "unrelated commit" && - git checkout -b related-onto-branch master && + git checkout -b related-onto-branch main && echo conflicting-change >file2 && git add . && test_tick &&
@@ -305,7 +305,7 @@ test_expect_success 'autostash is saved on editor failure with conflict' ' ' test_expect_success 'autostash with dirty submodules' ' - test_when_finished "git reset --hard && git checkout master" && + test_when_finished "git reset --hard && git checkout main" && git checkout -b with-submodule && git submodule add ./ sub && test_tick &&
@@ -324,7 +324,7 @@ test_expect_success 'branch is left alone when possible' ' test_expect_success 'never change active branch' ' git checkout -b not-the-feature-branch unrelated-onto-branch && - test_when_finished "git reset --hard && git checkout master" && + test_when_finished "git reset --hard && git checkout main" && echo changed >file0 && git rebase --autostash not-the-feature-branch feature-branch && test_cmp_rev not-the-feature-branch unrelated-onto-branch
t/t3423-rebase-reword.sh +3 -3
@@ -7,7 +7,7 @@ test_description='git rebase interactive with rewording' . "$TEST_DIRECTORY"/lib-rebase.sh test_expect_success 'setup' ' - test_commit master file-1 test && + test_commit main file-1 test && git checkout -b stuff &&
@@ -22,7 +22,7 @@ test_expect_success 'reword without issues functions as intended' ' set_fake_editor && FAKE_LINES="pick 1 reword 2" FAKE_COMMIT_MESSAGE="feature_b_reworded" \ - git rebase -i -v master && + git rebase -i -v main && test "$(git log -1 --format=%B)" = "feature_b_reworded" && test $(git rev-list --count HEAD) = 3
@@ -35,7 +35,7 @@ test_expect_success 'reword after a conflict preserves commit' ' set_fake_editor && test_must_fail env FAKE_LINES="reword 2" \ - git rebase -i -v master && + git rebase -i -v main && git checkout --theirs file-2 && git add file-2 &&
t/t3427-rebase-subtree.sh +10 -10
@@ -17,7 +17,7 @@ commit_message() { # # topic_1 - topic_2 - topic_3 # \ -# README ---------------------- Add subproject master - topic_4 - files_subtree/topic_5 +# README ---------------------- Add subproject main - topic_4 - files_subtree/topic_5 # # Where the merge moves the files topic_[123].t into the subdirectory # files_subtree/ and topic_4 as well as files_subtree/topic_5 add files to that
@@ -28,7 +28,7 @@ commit_message() { # an empty commit is added on top. The pre-rebase commit history looks like # this: # -# Add subproject master - topic_4 - files_subtree/topic_5 - Empty commit +# Add subproject main - topic_4 - files_subtree/topic_5 - Empty commit # # where the root commit adds three files: topic_1.t, topic_2.t and topic_3.t. #
@@ -48,11 +48,11 @@ test_expect_success 'setup' ' test_commit -C files topic_3 && : perform subtree merge into files_subtree/ && - git fetch files refs/heads/master:refs/heads/files-master && + git fetch files refs/heads/main:refs/heads/files-main && git merge -s ours --no-commit --allow-unrelated-histories \ - files-master && - git read-tree --prefix=files_subtree -u files-master && - git commit -m "Add subproject master" && + files-main && + git read-tree --prefix=files_subtree -u files-main && + git commit -m "Add subproject main" && : add two extra commits to rebase && test_commit -C files_subtree topic_4 &&
@@ -70,7 +70,7 @@ test_expect_success 'setup' ' test_expect_failure REBASE_P 'Rebase -Xsubtree --preserve-merges --onto commit' ' reset_rebase && git checkout -b rebase-preserve-merges to-rebase && - git rebase -Xsubtree=files_subtree --preserve-merges --onto files-master master && + git rebase -Xsubtree=files_subtree --preserve-merges --onto files-main main && verbose test "$(commit_message HEAD~)" = "topic_4" && verbose test "$(commit_message HEAD)" = "files_subtree/topic_5" '
@@ -79,7 +79,7 @@ test_expect_failure REBASE_P 'Rebase -Xsubtree --preserve-merges --onto commit' test_expect_failure REBASE_P 'Rebase -Xsubtree --keep-empty --preserve-merges --onto commit' ' reset_rebase && git checkout -b rebase-keep-empty to-rebase && - git rebase -Xsubtree=files_subtree --keep-empty --preserve-merges --onto files-master master && + git rebase -Xsubtree=files_subtree --keep-empty --preserve-merges --onto files-main main && verbose test "$(commit_message HEAD~2)" = "topic_4" && verbose test "$(commit_message HEAD~)" = "files_subtree/topic_5" && verbose test "$(commit_message HEAD)" = "Empty commit"
@@ -88,7 +88,7 @@ test_expect_failure REBASE_P 'Rebase -Xsubtree --keep-empty --preserve-merges -- test_expect_success 'Rebase -Xsubtree --empty=ask --onto commit' ' reset_rebase && git checkout -b rebase-onto to-rebase && - test_must_fail git rebase -Xsubtree=files_subtree --empty=ask --onto files-master master && + test_must_fail git rebase -Xsubtree=files_subtree --empty=ask --onto files-main main && : first pick results in no changes && git rebase --skip && verbose test "$(commit_message HEAD~2)" = "topic_4" &&
@@ -99,7 +99,7 @@ test_expect_success 'Rebase -Xsubtree --empty=ask --onto commit' ' test_expect_success 'Rebase -Xsubtree --empty=ask --rebase-merges --onto commit' ' reset_rebase && git checkout -b rebase-merges-onto to-rebase && - test_must_fail git rebase -Xsubtree=files_subtree --empty=ask --rebase-merges --onto files-master --root && + test_must_fail git rebase -Xsubtree=files_subtree --empty=ask --rebase-merges --onto files-main --root && : first pick results in no changes && git rebase --skip && verbose test "$(commit_message HEAD~2)" = "topic_4" &&
t/t3430-rebase-merges.sh +8 -8
@@ -12,7 +12,7 @@ Initial setup: -- B -- (first) / \ - A - C - D - E - H (master) + A - C - D - E - H (main) \ \ / \ F - G (second) \
@@ -37,7 +37,7 @@ test_expect_success 'setup' ' git checkout -b first && test_commit B && b=$(git rev-parse --short HEAD) && - git checkout master && + git checkout main && test_commit C && c=$(git rev-parse --short HEAD) && test_commit D &&
@@ -52,7 +52,7 @@ test_expect_success 'setup' ' f=$(git rev-parse --short HEAD) && test_commit G && g=$(git rev-parse --short HEAD) && - git checkout master && + git checkout main && git merge --no-commit G && test_tick && git commit -m H &&
@@ -82,7 +82,7 @@ test_expect_success 'create completely different structure' ' EOF test_config sequence.editor \""$PWD"/replace-editor.sh\" && test_tick && - git rebase -i -r A master && + git rebase -i -r A main && test_cmp_graph <<-\EOF * Merge the topic branch '\''onebranch'\'' |\
@@ -183,7 +183,7 @@ test_expect_success 'fast-forward merge -c still rewords' ' ' test_expect_success 'with a branch tip that was cherry-picked already' ' - git checkout -b already-upstream master && + git checkout -b already-upstream main && base="$(git rev-parse --verify HEAD)" && test_commit A1 &&
@@ -211,7 +211,7 @@ test_expect_success 'with a branch tip that was cherry-picked already' ' ' test_expect_success 'do not rebase cousins unless asked for' ' - git checkout -b cousins master && + git checkout -b cousins main && before="$(git rev-parse --verify HEAD)" && test_tick && git rebase -r HEAD^ &&
@@ -340,7 +340,7 @@ test_expect_success 'a "merge" into a root commit is a fast-forward' ' test_expect_success 'A root commit can be a cousin, treat it that way' ' git checkout --orphan khnum && test_commit yama && - git checkout -b asherah master && + git checkout -b asherah main && test_commit shamkat && git merge --allow-unrelated-histories khnum && test_tick &&
@@ -367,7 +367,7 @@ test_expect_success 'labels that are object IDs are rewritten' ' git checkout -b third B && test_commit I && third=$(git rev-parse HEAD) && - git checkout -b labels master && + git checkout -b labels main && git merge --no-commit third && test_tick && git commit -m "Merge commit '\''$third'\'' into labels" &&
t/t3431-rebase-fork-point.sh +16 -16
@@ -7,11 +7,11 @@ test_description='git rebase --fork-point test' . ./test-lib.sh -# A---B---D---E (master) +# A---B---D---E (main) # \ # C*---F---G (side) # -# C was formerly part of master but master was rewound to remove C +# C was formerly part of main but main was rewound to remove C # test_expect_success setup ' test_commit A &&
@@ -30,7 +30,7 @@ test_rebase () { expected="$1" && shift && test_expect_success "git rebase $*" " - git checkout master && + git checkout main && git reset --hard E && git checkout side && git reset --hard G &&
@@ -48,26 +48,26 @@ test_rebase 'G F C E D B A' --no-fork-point test_rebase 'G F C D B A' --no-fork-point --onto D test_rebase 'G F C B A' --no-fork-point --keep-base -test_rebase 'G F E D B A' --fork-point refs/heads/master -test_rebase 'G F E D B A' --fork-point master +test_rebase 'G F E D B A' --fork-point refs/heads/main +test_rebase 'G F E D B A' --fork-point main -test_rebase 'G F D B A' --fork-point --onto D refs/heads/master -test_rebase 'G F D B A' --fork-point --onto D master +test_rebase 'G F D B A' --fork-point --onto D refs/heads/main +test_rebase 'G F D B A' --fork-point --onto D main -test_rebase 'G F B A' --fork-point --keep-base refs/heads/master -test_rebase 'G F B A' --fork-point --keep-base master +test_rebase 'G F B A' --fork-point --keep-base refs/heads/main +test_rebase 'G F B A' --fork-point --keep-base main -test_rebase 'G F C E D B A' refs/heads/master -test_rebase 'G F C E D B A' master +test_rebase 'G F C E D B A' refs/heads/main +test_rebase 'G F C E D B A' main -test_rebase 'G F C D B A' --onto D refs/heads/master -test_rebase 'G F C D B A' --onto D master +test_rebase 'G F C D B A' --onto D refs/heads/main +test_rebase 'G F C D B A' --onto D main -test_rebase 'G F C B A' --keep-base refs/heads/master -test_rebase 'G F C B A' --keep-base master +test_rebase 'G F C B A' --keep-base refs/heads/main +test_rebase 'G F C B A' --keep-base main test_expect_success 'git rebase --fork-point with ambigous refname' ' - git checkout master && + git checkout main && git checkout -b one && git checkout side && git tag one &&
t/t3432-rebase-fast-forward.sh +17 -17
@@ -84,19 +84,19 @@ test_rebase_same_head_ () { changes='no changes' test_rebase_same_head success noop same success work same -test_rebase_same_head success noop same success work same master +test_rebase_same_head success noop same success work same main test_rebase_same_head success noop same success work diff --onto B B test_rebase_same_head success noop same success work diff --onto B... B -test_rebase_same_head success noop same success work same --onto master... master -test_rebase_same_head success noop same success work same --keep-base master +test_rebase_same_head success noop same success work same --onto main... main +test_rebase_same_head success noop same success work same --keep-base main test_rebase_same_head success noop same success work same --keep-base test_rebase_same_head success noop same success work same --no-fork-point test_rebase_same_head success noop same success work same --keep-base --no-fork-point -test_rebase_same_head success noop same success work same --fork-point master +test_rebase_same_head success noop same success work same --fork-point main test_rebase_same_head success noop same success work diff --fork-point --onto B B test_rebase_same_head success noop same success work diff --fork-point --onto B... B -test_rebase_same_head success noop same success work same --fork-point --onto master... master -test_rebase_same_head success noop same success work same --keep-base --keep-base master +test_rebase_same_head success noop same success work same --fork-point --onto main... main +test_rebase_same_head success noop same success work same --keep-base --keep-base main test_expect_success 'add work same to side' ' test_commit E
@@ -104,22 +104,22 @@ test_expect_success 'add work same to side' ' changes='our changes' test_rebase_same_head success noop same success work same -test_rebase_same_head success noop same success work same master +test_rebase_same_head success noop same success work same main test_rebase_same_head success noop same success work diff --onto B B test_rebase_same_head success noop same success work diff --onto B... B -test_rebase_same_head success noop same success work same --onto master... master -test_rebase_same_head success noop same success work same --keep-base master +test_rebase_same_head success noop same success work same --onto main... main +test_rebase_same_head success noop same success work same --keep-base main test_rebase_same_head success noop same success work same --keep-base test_rebase_same_head success noop same success work same --no-fork-point test_rebase_same_head success noop same success work same --keep-base --no-fork-point -test_rebase_same_head success noop same success work same --fork-point master +test_rebase_same_head success noop same success work same --fork-point main test_rebase_same_head success noop same success work diff --fork-point --onto B B test_rebase_same_head success noop same success work diff --fork-point --onto B... B -test_rebase_same_head success noop same success work same --fork-point --onto master... master -test_rebase_same_head success noop same success work same --fork-point --keep-base master +test_rebase_same_head success noop same success work same --fork-point --onto main... main +test_rebase_same_head success noop same success work same --fork-point --keep-base main test_expect_success 'add work same to upstream' ' - git checkout master && + git checkout main && test_commit F && git checkout side '
@@ -127,12 +127,12 @@ test_expect_success 'add work same to upstream' ' changes='our and their changes' test_rebase_same_head success noop same success work diff --onto B B test_rebase_same_head success noop same success work diff --onto B... B -test_rebase_same_head success noop same success work diff --onto master... master -test_rebase_same_head success noop same success work diff --keep-base master +test_rebase_same_head success noop same success work diff --onto main... main +test_rebase_same_head success noop same success work diff --keep-base main test_rebase_same_head success noop same success work diff --keep-base test_rebase_same_head failure work same success work diff --fork-point --onto B B test_rebase_same_head failure work same success work diff --fork-point --onto B... B -test_rebase_same_head success noop same success work diff --fork-point --onto master... master -test_rebase_same_head success noop same success work diff --fork-point --keep-base master +test_rebase_same_head success noop same success work diff --fork-point --onto main... main +test_rebase_same_head success noop same success work diff --fork-point --keep-base main test_done
t/t3434-rebase-i18n.sh +4 -4
@@ -7,7 +7,7 @@ test_description='rebase with changing encoding Initial setup: -1 - 2 master +1 - 2 main \ 3 - 4 first \
@@ -41,7 +41,7 @@ test_expect_success 'rebase --rebase-merges update encoding eucJP to UTF-8' ' git config i18n.commitencoding eucJP && git merge -F "$TEST_DIRECTORY/t3434/eucJP.txt" second && git config i18n.commitencoding UTF-8 && - git rebase --rebase-merges master && + git rebase --rebase-merges main && compare_msg eucJP.txt eucJP UTF-8 '
@@ -50,7 +50,7 @@ test_expect_success 'rebase --rebase-merges update encoding eucJP to ISO-2022-JP git config i18n.commitencoding eucJP && git merge -F "$TEST_DIRECTORY/t3434/eucJP.txt" second && git config i18n.commitencoding ISO-2022-JP && - git rebase --rebase-merges master && + git rebase --rebase-merges main && compare_msg eucJP.txt eucJP ISO-2022-JP '
@@ -66,7 +66,7 @@ test_rebase_continue_update_encode () { git config i18n.commitencoding $old && git commit -F "$TEST_DIRECTORY/t3434/$msgfile" && git config i18n.commitencoding $new && - test_must_fail git rebase -m master && + test_must_fail git rebase -m main && test -f .git/rebase-merge/message && git stripspace <.git/rebase-merge/message >two.t && git add two.t &&
t/t3435-rebase-gpg-sign.sh +2 -2
@@ -46,7 +46,7 @@ test_expect_success 'setup: merge commit' ' test_commit fork-point && git switch -c side && test_commit three && - git switch master && + git switch main && git merge --no-ff side && git tag merged '
@@ -64,7 +64,7 @@ test_rebase_gpg_sign false -i --no-gpg-sign --gpg-sign test_expect_failure 'rebase -p --no-gpg-sign override commit.gpgsign' ' git reset --hard merged && git config commit.gpgsign true && - git rebase -p --no-gpg-sign --onto=one fork-point master && + git rebase -p --no-gpg-sign --onto=one fork-point main && test_must_fail git verify-commit HEAD '
t/t3436-rebase-more-options.sh +1 -1
@@ -28,7 +28,7 @@ test_expect_success 'setup' ' test_commit commit2 foo foo2 && test_commit commit3 foo foo3 && - git checkout --orphan master && + git checkout --orphan main && rm foo && test_write_lines "line 1" " line 2" "line 3" >file && git commit -am "add file" &&
t/test-lib.sh +7 -1
@@ -257,7 +257,13 @@ case "$TRASH_DIRECTORY" in esac case "$TEST_NUMBER" in -[0-2]*|3[0-3]*) +3404) + # Avoid conflicts with patch series that are cooking at the same time + # as the patch series changing the default of `init.defaultBranch`. + GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master + export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + ;; +[0-2]*|3[0-4]*) GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME ;;
Signature · 1 line
gitgitgadget