From a731ec5eb827767e0f054641ab1eacc632113c59 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 13 Jan 2007 01:20:53 -0800 Subject: t3901: test "format-patch | am" pipe with i18n This checks combinations of i18n.commitencoding (declares what encoding you are feeding commit-tree to make commits) and i18n.logoutputencoding (instructs what encoding to emit the commit message out to log output, including e-mail format) to make sure the "format-patch | am" pipe used in git-rebase works correctly. I suspect "git cherry-pick" and "git rebase --merge" may fail similar tests. We'll see. Signed-off-by: Junio C Hamano --- t/t3901-8859-1.txt | 4 ++ t/t3901-i18n-patch.sh | 154 ++++++++++++++++++++++++++++++++++++++++++++++++++ t/t3901-utf8.txt | 4 ++ 3 files changed, 162 insertions(+) create mode 100755 t/t3901-8859-1.txt create mode 100755 t/t3901-i18n-patch.sh create mode 100755 t/t3901-utf8.txt (limited to 't') diff --git a/t/t3901-8859-1.txt b/t/t3901-8859-1.txt new file mode 100755 index 0000000000..38c21a6a7f --- /dev/null +++ b/t/t3901-8859-1.txt @@ -0,0 +1,4 @@ +: to be sourced in t3901 -- this is latin-1 +GIT_AUTHOR_NAME="Αιν σϊ" && +GIT_COMMITTER_NAME=$GIT_AUTHOR_NAME && +export GIT_AUTHOR_NAME GIT_COMMITTER_NAME diff --git a/t/t3901-i18n-patch.sh b/t/t3901-i18n-patch.sh new file mode 100755 index 0000000000..7fecfe98d2 --- /dev/null +++ b/t/t3901-i18n-patch.sh @@ -0,0 +1,154 @@ +#!/bin/sh +# +# Copyright (c) 2006 Junio C Hamano +# + +test_description='i18n settings and format-patch | am pipe' + +. ./test-lib.sh + +test_expect_success setup ' + git-repo-config i18n.commitencoding UTF-8 && + + # use UTF-8 in author and committer name to match the + # i18n.commitencoding settings + . ../t3901-utf8.txt && + + test_tick && + echo "$GIT_AUTHOR_NAME" >mine && + git add mine && + git commit -s -m "Initial commit" && + + test_tick && + echo Hello world >mine && + git add mine && + git commit -s -m "Second on main" && + + # the first commit on the side branch is UTF-8 + test_tick && + git checkout -b side master^ && + echo Another file >yours && + git add yours && + git commit -s -m "Second on side" && + + # the second one on the side branch is ISO-8859-1 + git-repo-config i18n.commitencoding ISO-8859-1 && + # use author and committer name in ISO-8859-1 to match it. + . ../t3901-8859-1.txt && + test_tick && + echo Yet another >theirs && + git add theirs && + git commit -s -m "Third on side" && + + # Back to default + git-repo-config i18n.commitencoding UTF-8 +' + +test_expect_success 'format-patch output (ISO-8859-1)' ' + git-repo-config i18n.logoutputencoding ISO-8859-1 && + + git format-patch --stdout master..HEAD^ >out-l1 && + git format-patch --stdout HEAD^ >out-l2 && + grep "^Content-Type: text/plain; charset=ISO-8859-1" out-l1 && + grep "^From: =?ISO-8859-1?q?=C1=E9=ED_=F3=FA?=" out-l1 && + grep "^Content-Type: text/plain; charset=ISO-8859-1" out-l2 && + grep "^From: =?ISO-8859-1?q?=C1=E9=ED_=F3=FA?=" out-l2 +' + +test_expect_success 'format-patch output (UTF-8)' ' + git repo-config i18n.logoutputencoding UTF-8 && + + git format-patch --stdout master..HEAD^ >out-u1 && + git format-patch --stdout HEAD^ >out-u2 && + grep "^Content-Type: text/plain; charset=UTF-8" out-u1 && + grep "^From: =?UTF-8?q?=C3=81=C3=A9=C3=AD_=C3=B3=C3=BA?=" out-u1 && + grep "^Content-Type: text/plain; charset=UTF-8" out-u2 && + grep "^From: =?UTF-8?q?=C3=81=C3=A9=C3=AD_=C3=B3=C3=BA?=" out-u2 +' + +test_expect_success 'rebase (UTF-8)' ' + # We want the result of rebase in UTF-8 + git-repo-config i18n.commitencoding UTF-8 && + + # The test is about logoutputencoding not affecting the + # final outcome -- it is used internally to generate the + # patch and the log. + + git repo-config i18n.logoutputencoding UTF-8 && + + # The result will be committed by GIT_COMMITTER_NAME -- + # we want UTF-8 encoded name. + . ../t3901-utf8.txt && + git checkout -b test && + git-rebase master && + + # Check the results. + git format-patch --stdout HEAD~2..HEAD^ >out-r1 && + git format-patch --stdout HEAD^ >out-r2 && + grep "^From: =?UTF-8?q?=C3=81=C3=A9=C3=AD_=C3=B3=C3=BA?=" out-r1 && + grep "^From: =?UTF-8?q?=C3=81=C3=A9=C3=AD_=C3=B3=C3=BA?=" out-r2 + + ! git-cat-file commit HEAD | grep "^encoding ISO-8859-1" && + ! git-cat-file commit HEAD^ | grep "^encoding ISO-8859-1" +' + +test_expect_success 'rebase (ISO-8859-1)' ' + git-repo-config i18n.commitencoding UTF-8 && + git repo-config i18n.logoutputencoding ISO-8859-1 && + . ../t3901-utf8.txt && + + git reset --hard side && + git-rebase master && + + git repo-config i18n.logoutputencoding UTF-8 && + git format-patch --stdout HEAD~2..HEAD^ >out-r1 && + git format-patch --stdout HEAD^ >out-r2 && + grep "^From: =?UTF-8?q?=C3=81=C3=A9=C3=AD_=C3=B3=C3=BA?=" out-r1 && + grep "^From: =?UTF-8?q?=C3=81=C3=A9=C3=AD_=C3=B3=C3=BA?=" out-r2 && + + ! git-cat-file commit HEAD | grep "^encoding ISO-8859-1" && + ! git-cat-file commit HEAD^ | grep "^encoding ISO-8859-1" +' + +test_expect_success 'rebase (ISO-8859-1)' ' + # In this test we want ISO-8859-1 encoded commits as the result + git-repo-config i18n.commitencoding ISO-8859-1 && + git repo-config i18n.logoutputencoding ISO-8859-1 && + . ../t3901-8859-1.txt && + + git reset --hard side && + git-rebase master && + + # Make sure characters are not corrupted. + git repo-config i18n.logoutputencoding UTF-8 && + git format-patch --stdout HEAD~2..HEAD^ >out-r1 && + git format-patch --stdout HEAD^ >out-r2 && + grep "^From: =?UTF-8?q?=C3=81=C3=A9=C3=AD_=C3=B3=C3=BA?=" out-r1 && + grep "^From: =?UTF-8?q?=C3=81=C3=A9=C3=AD_=C3=B3=C3=BA?=" out-r2 && + + git-cat-file commit HEAD | grep "^encoding ISO-8859-1" && + git-cat-file commit HEAD^ | grep "^encoding ISO-8859-1" +' + +test_expect_success 'rebase (UTF-8)' ' + # This is pathological -- use UTF-8 as intermediate form + # to get ISO-8859-1 results. + git-repo-config i18n.commitencoding ISO-8859-1 && + git repo-config i18n.logoutputencoding UTF-8 && + . ../t3901-8859-1.txt && + + git reset --hard side && + git-rebase master && + + # Make sure characters are not corrupted. + git repo-config i18n.logoutputencoding UTF-8 && + git format-patch --stdout HEAD~2..HEAD^ >out-r1 && + git format-patch --stdout HEAD^ >out-r2 && + grep "^From: =?UTF-8?q?=C3=81=C3=A9=C3=AD_=C3=B3=C3=BA?=" out-r1 && + grep "^From: =?UTF-8?q?=C3=81=C3=A9=C3=AD_=C3=B3=C3=BA?=" out-r2 && + + git-cat-file commit HEAD | grep "^encoding ISO-8859-1" && + git-cat-file commit HEAD^ | grep "^encoding ISO-8859-1" +' + +test_done diff --git a/t/t3901-utf8.txt b/t/t3901-utf8.txt new file mode 100755 index 0000000000..5f5205cd02 --- /dev/null +++ b/t/t3901-utf8.txt @@ -0,0 +1,4 @@ +: to be sourced in t3901 -- this is utf8 +GIT_AUTHOR_NAME="Áéí Γ³ΓΊ" && +GIT_COMMITTER_NAME=$GIT_AUTHOR_NAME && +export GIT_AUTHOR_NAME GIT_COMMITTER_NAME -- cgit v1.2.3 From c34c6008bcf2c66e17a97acc89be1144a6216f3f Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 13 Jan 2007 13:34:44 -0800 Subject: More tests in t3901. This adds tests for "cherry-pick" and "rebase --merge" (and indirectly "commit -C" since it is used in the latter) to make sure they create a new commit with correct encoding. Signed-off-by: Junio C Hamano --- t/t3901-i18n-patch.sh | 173 +++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 137 insertions(+), 36 deletions(-) (limited to 't') diff --git a/t/t3901-i18n-patch.sh b/t/t3901-i18n-patch.sh index 7fecfe98d2..eda0e2d729 100755 --- a/t/t3901-i18n-patch.sh +++ b/t/t3901-i18n-patch.sh @@ -7,6 +7,29 @@ test_description='i18n settings and format-patch | am pipe' . ./test-lib.sh +check_encoding () { + # Make sure characters are not corrupted + cnt="$1" header="$2" i=1 j=0 bad=0 + while test "$i" -le $cnt + do + git format-patch --encoding=UTF-8 --stdout HEAD~$i..HEAD~$j | + grep "^From: =?UTF-8?q?=C3=81=C3=A9=C3=AD_=C3=B3=C3=BA?=" && + git-cat-file commit HEAD~$j | + case "$header" in + 8859) + grep "^encoding ISO-8859-1" ;; + *) + ! grep "^encoding ISO-8859-1" ;; + esac || { + bad=1 + break + } + j=$i + i=$(($i+1)) + done + (exit $bad) +} + test_expect_success setup ' git-repo-config i18n.commitencoding UTF-8 && @@ -66,7 +89,7 @@ test_expect_success 'format-patch output (UTF-8)' ' grep "^From: =?UTF-8?q?=C3=81=C3=A9=C3=AD_=C3=B3=C3=BA?=" out-u2 ' -test_expect_success 'rebase (UTF-8)' ' +test_expect_success 'rebase (U/U)' ' # We want the result of rebase in UTF-8 git-repo-config i18n.commitencoding UTF-8 && @@ -82,17 +105,10 @@ test_expect_success 'rebase (UTF-8)' ' git checkout -b test && git-rebase master && - # Check the results. - git format-patch --stdout HEAD~2..HEAD^ >out-r1 && - git format-patch --stdout HEAD^ >out-r2 && - grep "^From: =?UTF-8?q?=C3=81=C3=A9=C3=AD_=C3=B3=C3=BA?=" out-r1 && - grep "^From: =?UTF-8?q?=C3=81=C3=A9=C3=AD_=C3=B3=C3=BA?=" out-r2 - - ! git-cat-file commit HEAD | grep "^encoding ISO-8859-1" && - ! git-cat-file commit HEAD^ | grep "^encoding ISO-8859-1" + check_encoding 2 ' -test_expect_success 'rebase (ISO-8859-1)' ' +test_expect_success 'rebase (U/L)' ' git-repo-config i18n.commitencoding UTF-8 && git repo-config i18n.logoutputencoding ISO-8859-1 && . ../t3901-utf8.txt && @@ -100,17 +116,10 @@ test_expect_success 'rebase (ISO-8859-1)' ' git reset --hard side && git-rebase master && - git repo-config i18n.logoutputencoding UTF-8 && - git format-patch --stdout HEAD~2..HEAD^ >out-r1 && - git format-patch --stdout HEAD^ >out-r2 && - grep "^From: =?UTF-8?q?=C3=81=C3=A9=C3=AD_=C3=B3=C3=BA?=" out-r1 && - grep "^From: =?UTF-8?q?=C3=81=C3=A9=C3=AD_=C3=B3=C3=BA?=" out-r2 && - - ! git-cat-file commit HEAD | grep "^encoding ISO-8859-1" && - ! git-cat-file commit HEAD^ | grep "^encoding ISO-8859-1" + check_encoding 2 ' -test_expect_success 'rebase (ISO-8859-1)' ' +test_expect_success 'rebase (L/L)' ' # In this test we want ISO-8859-1 encoded commits as the result git-repo-config i18n.commitencoding ISO-8859-1 && git repo-config i18n.logoutputencoding ISO-8859-1 && @@ -119,18 +128,10 @@ test_expect_success 'rebase (ISO-8859-1)' ' git reset --hard side && git-rebase master && - # Make sure characters are not corrupted. - git repo-config i18n.logoutputencoding UTF-8 && - git format-patch --stdout HEAD~2..HEAD^ >out-r1 && - git format-patch --stdout HEAD^ >out-r2 && - grep "^From: =?UTF-8?q?=C3=81=C3=A9=C3=AD_=C3=B3=C3=BA?=" out-r1 && - grep "^From: =?UTF-8?q?=C3=81=C3=A9=C3=AD_=C3=B3=C3=BA?=" out-r2 && - - git-cat-file commit HEAD | grep "^encoding ISO-8859-1" && - git-cat-file commit HEAD^ | grep "^encoding ISO-8859-1" + check_encoding 2 8859 ' -test_expect_success 'rebase (UTF-8)' ' +test_expect_success 'rebase (L/U)' ' # This is pathological -- use UTF-8 as intermediate form # to get ISO-8859-1 results. git-repo-config i18n.commitencoding ISO-8859-1 && @@ -140,15 +141,115 @@ test_expect_success 'rebase (UTF-8)' ' git reset --hard side && git-rebase master && - # Make sure characters are not corrupted. + check_encoding 2 8859 +' + +test_expect_success 'cherry-pick(U/U)' ' + # Both the commitencoding and logoutputencoding is set to UTF-8. + + git-repo-config i18n.commitencoding UTF-8 && + git repo-config i18n.logoutputencoding UTF-8 && + . ../t3901-utf8.txt && + + git reset --hard master && + git cherry-pick side^ && + git cherry-pick side && + EDITOR=: VISUAL=: git revert HEAD && + + check_encoding 3 +' + +test_expect_success 'cherry-pick(L/L)' ' + # Both the commitencoding and logoutputencoding is set to ISO-8859-1 + + git-repo-config i18n.commitencoding ISO-8859-1 && + git repo-config i18n.logoutputencoding ISO-8859-1 && + . ../t3901-8859-1.txt && + + git reset --hard master && + git cherry-pick side^ && + git cherry-pick side && + EDITOR=: VISUAL=: git revert HEAD && + + check_encoding 3 8859 +' + +test_expect_success 'cherry-pick(U/L)' ' + # Commitencoding is set to UTF-8 but logoutputencoding is ISO-8859-1 + + git-repo-config i18n.commitencoding UTF-8 && + git repo-config i18n.logoutputencoding ISO-8859-1 && + . ../t3901-utf8.txt && + + git reset --hard master && + git cherry-pick side^ && + git cherry-pick side && + EDITOR=: VISUAL=: git revert HEAD && + + check_encoding 3 +' + +test_expect_success 'cherry-pick(L/U)' ' + # Again, the commitencoding is set to ISO-8859-1 but + # logoutputencoding is set to UTF-8. + + git-repo-config i18n.commitencoding ISO-8859-1 && git repo-config i18n.logoutputencoding UTF-8 && - git format-patch --stdout HEAD~2..HEAD^ >out-r1 && - git format-patch --stdout HEAD^ >out-r2 && - grep "^From: =?UTF-8?q?=C3=81=C3=A9=C3=AD_=C3=B3=C3=BA?=" out-r1 && - grep "^From: =?UTF-8?q?=C3=81=C3=A9=C3=AD_=C3=B3=C3=BA?=" out-r2 && + . ../t3901-8859-1.txt && + + git reset --hard master && + git cherry-pick side^ && + git cherry-pick side && + EDITOR=: VISUAL=: git revert HEAD && + + check_encoding 3 8859 +' + +test_expect_success 'rebase --merge (U/U)' ' + git-repo-config i18n.commitencoding UTF-8 && + git repo-config i18n.logoutputencoding UTF-8 && + . ../t3901-utf8.txt && + + git reset --hard side && + git-rebase --merge master && + + check_encoding 2 +' + +test_expect_success 'rebase --merge (U/L)' ' + git-repo-config i18n.commitencoding UTF-8 && + git repo-config i18n.logoutputencoding ISO-8859-1 && + . ../t3901-utf8.txt && + + git reset --hard side && + git-rebase --merge master && + + check_encoding 2 +' + +test_expect_success 'rebase --merge (L/L)' ' + # In this test we want ISO-8859-1 encoded commits as the result + git-repo-config i18n.commitencoding ISO-8859-1 && + git repo-config i18n.logoutputencoding ISO-8859-1 && + . ../t3901-8859-1.txt && + + git reset --hard side && + git-rebase --merge master && + + check_encoding 2 8859 +' + +test_expect_success 'rebase --merge (L/U)' ' + # This is pathological -- use UTF-8 as intermediate form + # to get ISO-8859-1 results. + git-repo-config i18n.commitencoding ISO-8859-1 && + git repo-config i18n.logoutputencoding UTF-8 && + . ../t3901-8859-1.txt && + + git reset --hard side && + git-rebase --merge master && - git-cat-file commit HEAD | grep "^encoding ISO-8859-1" && - git-cat-file commit HEAD^ | grep "^encoding ISO-8859-1" + check_encoding 2 8859 ' test_done -- cgit v1.2.3 From 38434f2eed45f42ed706d07564079c23ee686511 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Sun, 14 Jan 2007 03:22:47 -0500 Subject: Hide output about SVN::Core not being found during tests. If the user doesn't have SVN::Core installed or working then the SVN tests properly turn themselves off. But the user doesn't need to know that SVN::Core isn't loadable as a Perl module. Unless of course they are trying to debug the test, so lets relegate the Perl failures to --verbose only. Signed-off-by: Shawn O. Pearce Signed-off-by: Junio C Hamano --- t/lib-git-svn.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't') diff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh index a0f2814083..bb1d7b84bc 100644 --- a/t/lib-git-svn.sh +++ b/t/lib-git-svn.sh @@ -26,7 +26,7 @@ use SVN::Core; use SVN::Repos; \$SVN::Core::VERSION gt '1.1.0' or exit(42); system(qw/svnadmin create --fs-type fsfs/, '$svnrepo') == 0 or exit(41); -" +" >&3 2>&4 x=$? if test $x -ne 0 then -- cgit v1.2.3 From 5312ab11fbf7bac28b671510ac3734a3e604d9fa Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 13 Jan 2007 18:37:32 -0800 Subject: Add describe test. ... with help from Shawn. Signed-off-by: Junio C Hamano --- t/t6120-describe.sh | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100755 t/t6120-describe.sh (limited to 't') diff --git a/t/t6120-describe.sh b/t/t6120-describe.sh new file mode 100755 index 0000000000..3e9edda1ca --- /dev/null +++ b/t/t6120-describe.sh @@ -0,0 +1,97 @@ +#!/bin/sh + +test_description='test describe + + B + .--------------o----o----o----x + / / / + o----o----o----o----o----. / + \ A c / + .------------o---o---o + D e +' +. ./test-lib.sh + +check_describe () { + expect="$1" + shift + R=$(git describe "$@") && + test_expect_success "describe $*" ' + case "$R" in + $expect) echo happy ;; + *) echo "Oops - $R is not $expect"; + false ;; + esac + ' +} + +test_expect_success setup ' + + test_tick && + echo one >file && git-add file && git-commit -m initial && + one=$(git-rev-parse HEAD) && + + test_tick && + echo two >file && git-add file && git-commit -m second && + two=$(git-rev-parse HEAD) && + + test_tick && + echo three >file && git-add file && git-commit -m third && + + test_tick && + echo A >file && git-add file && git-commit -m A && + test_tick && + git-tag -a -m A A && + + test_tick && + echo c >file && git-add file && git-commit -m c && + test_tick && + git-tag c && + + git reset --hard $two && + test_tick && + echo B >side && git-add side && git-commit -m B && + test_tick && + git-tag -a -m B B && + + test_tick && + git-merge -m Merged c && + merged=$(git-rev-parse HEAD) && + + git reset --hard $two && + test_tick && + echo D >another && git-add another && git-commit -m D && + test_tick && + git-tag -a -m D D && + + test_tick && + echo DD >another && git commit -a -m another && + + test_tick && + git-tag e && + + test_tick && + echo DDD >another && git commit -a -m "yet another" && + + test_tick && + git-merge -m Merged $merged && + + test_tick && + echo X >file && echo X >side && git-add file side && + git-commit -m x + +' + +check_describe A-* HEAD +check_describe A-* HEAD^ +check_describe D-* HEAD^^ +check_describe A-* HEAD^^2 +check_describe B HEAD^^2^ + +check_describe A-* --tags HEAD +check_describe A-* --tags HEAD^ +check_describe D-* --tags HEAD^^ +check_describe A-* --tags HEAD^^2 +check_describe B --tags HEAD^^2^ + +test_done -- cgit v1.2.3 From acb4441e0dabaaa666ecae11fdafc27c3691e763 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 14 Jan 2007 22:00:02 -0800 Subject: Use merge-recursive in git-revert/git-cherry-pick This makes revert and cherry-pick to use merge-recursive, to allow them to notice renames. A pair of test scripts demonstrate that an old change before a rename happened can be applied (reverted) after a rename with cherry-pick (with revert). Signed-off-by: Junio C Hamano --- t/t3501-revert-cherry-pick.sh | 62 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100755 t/t3501-revert-cherry-pick.sh (limited to 't') diff --git a/t/t3501-revert-cherry-pick.sh b/t/t3501-revert-cherry-pick.sh new file mode 100755 index 0000000000..552af1c4d2 --- /dev/null +++ b/t/t3501-revert-cherry-pick.sh @@ -0,0 +1,62 @@ +#!/bin/sh + +test_description='test cherry-pick and revert with renames + + -- + + rename2: renames oops to opos + + rename1: renames oops to spoo + + added: adds extra line to oops + ++ initial: has lines in oops + +' + +. ./test-lib.sh + +test_expect_success setup ' + + for l in a b c d e f g h i j k l m n o + do + echo $l$l$l$l$l$l$l$l$l + done >oops && + + test_tick && + git add oops && + git commit -m initial && + git tag initial && + + test_tick && + echo "Add extra line at the end" >>oops && + git commit -a -m added && + git tag added && + + test_tick && + git mv oops spoo && + git commit -m rename1 && + git tag rename1 && + + test_tick && + git checkout -b side initial && + git mv oops opos && + git commit -m rename2 && + git tag rename2 +' + +test_expect_success 'cherry-pick after renaming branch' ' + + git checkout rename2 && + EDITOR=: VISUAL=: git cherry-pick added && + test -f opos && + grep "Add extra line at the end" opos + +' + +test_expect_success 'revert after renaming branch' ' + + git checkout rename1 && + EDITOR=: VISUAL=: git revert added && + test -f spoo && + ! grep "Add extra line at the end" spoo + +' + +test_done -- cgit v1.2.3 From 5ab9cc86ae7a3410d34d3d251877057103945513 Mon Sep 17 00:00:00 2001 From: Jason Riedy Date: Mon, 15 Jan 2007 17:31:49 -0800 Subject: Start all test scripts with /bin/sh. My bash refused to run the two scripts missing a #!, and it's better to use the same line for all the scripts. Signed-off-by: Jason Riedy Signed-off-by: Junio C Hamano --- t/t9102-git-svn-deep-rmdir.sh | 1 + t/t9103-git-svn-graft-branches.sh | 1 + t/t9200-git-cvsexportcommit.sh | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) (limited to 't') diff --git a/t/t9102-git-svn-deep-rmdir.sh b/t/t9102-git-svn-deep-rmdir.sh index 572aaedc06..4e0808380f 100755 --- a/t/t9102-git-svn-deep-rmdir.sh +++ b/t/t9102-git-svn-deep-rmdir.sh @@ -1,3 +1,4 @@ +#!/bin/sh test_description='git-svn rmdir' . ./lib-git-svn.sh diff --git a/t/t9103-git-svn-graft-branches.sh b/t/t9103-git-svn-graft-branches.sh index b5f7677021..4e55778a47 100755 --- a/t/t9103-git-svn-graft-branches.sh +++ b/t/t9103-git-svn-graft-branches.sh @@ -1,3 +1,4 @@ +#!/bin/sh test_description='git-svn graft-branches' . ./lib-git-svn.sh diff --git a/t/t9200-git-cvsexportcommit.sh b/t/t9200-git-cvsexportcommit.sh index 315119abff..fd0a5549fe 100755 --- a/t/t9200-git-cvsexportcommit.sh +++ b/t/t9200-git-cvsexportcommit.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # Copyright (c) Robin Rosenberg # -- cgit v1.2.3 From 2aad957a519b354e248da8c76ee0d3997083dde6 Mon Sep 17 00:00:00 2001 From: Jason Riedy Date: Mon, 15 Jan 2007 17:31:29 -0800 Subject: Replace "echo -n" with printf in shell scripts. Not all echos know -n. This was causing a test failure in t5401-update-hooks.sh, but not t3800-mktag.sh for some reason. Signed-off-by: Jason Riedy Signed-off-by: Junio C Hamano --- t/t3800-mktag.sh | 2 +- t/t5401-update-hooks.sh | 4 ++-- t/t6023-merge-file.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 't') diff --git a/t/t3800-mktag.sh b/t/t3800-mktag.sh index 5b23b7769d..ede4d42495 100755 --- a/t/t3800-mktag.sh +++ b/t/t3800-mktag.sh @@ -88,7 +88,7 @@ check_verify_failure '"type" line label check' # 5. type line eol check echo "object 779e9b33986b1c2670fff52c5067603117b3e895" >tag.sig -echo -n "type tagsssssssssssssssssssssssssssssss" >>tag.sig +printf "type tagsssssssssssssssssssssssssssssss" >>tag.sig cat >expect.pat <victim/.git/hooks/update <<'EOF' #!/bin/sh echo "$@" >$GIT_DIR/update.args -read x; echo -n "$x" >$GIT_DIR/update.stdin +read x; printf "$x" >$GIT_DIR/update.stdin echo STDOUT update echo STDERR update >&2 EOF @@ -32,7 +32,7 @@ chmod u+x victim/.git/hooks/update cat >victim/.git/hooks/post-update <<'EOF' #!/bin/sh echo "$@" >$GIT_DIR/post-update.args -read x; echo -n "$x" >$GIT_DIR/post-update.stdin +read x; printf "$x" >$GIT_DIR/post-update.stdin echo STDOUT post-update echo STDERR post-update >&2 EOF diff --git a/t/t6023-merge-file.sh b/t/t6023-merge-file.sh index 1c21d8c986..f3cd3dba4d 100644 --- a/t/t6023-merge-file.sh +++ b/t/t6023-merge-file.sh @@ -52,7 +52,7 @@ super aquam refectionis educavit me; animam meam convertit, deduxit me super semitas jusitiae, EOF -echo -n "propter nomen suum." >> new4.txt +printf "propter nomen suum." >> new4.txt cp new1.txt test.txt test_expect_success "merge without conflict" \ -- cgit v1.2.3 From c1a4278ee3f99ca9db94bd032b047b3d19ac6e5f Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 16 Jan 2007 20:46:39 -0800 Subject: Use merge-recursive in git-checkout -m (branch switching) This allows "git checkout -m " to notice renames and carry local changes in the working tree forward. Signed-off-by: Junio C Hamano --- t/t7201-co.sh | 41 +++++++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 8 deletions(-) (limited to 't') diff --git a/t/t7201-co.sh b/t/t7201-co.sh index 085d4a096b..315fa3564c 100755 --- a/t/t7201-co.sh +++ b/t/t7201-co.sh @@ -14,15 +14,23 @@ fill () { done } + test_expect_success setup ' - fill 1 2 3 4 5 >one && + fill 1 2 3 4 5 6 7 8 >one && fill a b c d e >two && git add one two && git commit -m "Initial A one, A two" && - git checkout -b side && - fill 1 2 3 >one && + git checkout -b renamer && + rm -f one && + fill 1 3 4 5 6 7 8 >uno && + git add uno && + fill a b c d e f >two && + git commit -a -m "Renamer R one->uno, M two" && + + git checkout -b side master && + fill 1 2 3 4 5 6 7 >one && fill A B C D E >three && rm -f two && git update-index --add --remove one two three && @@ -42,7 +50,7 @@ test_expect_success "checkout from non-existing branch" ' test_expect_success "checkout with dirty tree without -m" ' - fill 0 1 2 3 4 5 >one && + fill 0 1 2 3 4 5 6 7 8 >one && if git checkout side then echo Not happy @@ -58,12 +66,10 @@ test_expect_success "checkout -m with dirty tree" ' git checkout -f master && git clean && - fill 0 1 2 3 4 5 >one && + fill 0 1 2 3 4 5 6 7 8 >one && git checkout -m side && - fill " master" "* side" >expect.branch && - git branch >current.branch && - diff expect.branch current.branch && + test "$(git symbolic-ref HEAD)" = "refs/heads/side" && fill "M one" "A three" "D two" >expect.master && git diff --name-status master >current.master && @@ -78,4 +84,23 @@ test_expect_success "checkout -m with dirty tree" ' diff expect.index current.index ' +test_expect_success "checkout -m with dirty tree, renamed" ' + + git checkout -f master && git clean && + + fill 1 2 3 4 5 7 8 >one && + if git checkout renamer + then + echo Not happy + false + else + echo "happy - failed correctly" + fi && + + git checkout -m renamer && + fill 1 3 4 5 7 8 >expect && + diff expect uno && + ! test -f one +' + test_done -- cgit v1.2.3 From c261e4385e826a4e7f9cf69618fa0b6e39defad2 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 17 Jan 2007 13:51:44 -0800 Subject: Add --summary to git-format-patch by default This adds --summary output in addition to the --stat to the output from git-format-patch by default. I think additions, removals and filemode changes are rare but notable events and always showing it makes sense. Signed-off-by: Junio C Hamano --- t/t4013/diff.format-patch_--attach_--stdout_initial..master | 3 +++ t/t4013/diff.format-patch_--attach_--stdout_initial..master^ | 2 ++ t/t4013/diff.format-patch_--attach_--stdout_initial..side | 1 + t/t4013/diff.format-patch_--stdout_initial..master | 3 +++ t/t4013/diff.format-patch_--stdout_initial..master^ | 2 ++ t/t4013/diff.format-patch_--stdout_initial..side | 1 + 6 files changed, 12 insertions(+) (limited to 't') diff --git a/t/t4013/diff.format-patch_--attach_--stdout_initial..master b/t/t4013/diff.format-patch_--attach_--stdout_initial..master index b4745e1001..e5ddd6fcbb 100644 --- a/t/t4013/diff.format-patch_--attach_--stdout_initial..master +++ b/t/t4013/diff.format-patch_--attach_--stdout_initial..master @@ -19,6 +19,7 @@ This is the second commit. file0 | 3 +++ file2 | 3 --- 3 files changed, 5 insertions(+), 3 deletions(-) + delete mode 100644 file2 --------------g-i-t--v-e-r-s-i-o-n Content-Type: text/x-patch; name="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff" @@ -77,6 +78,7 @@ Content-Transfer-Encoding: 8bit dir/sub | 2 ++ file1 | 3 +++ 2 files changed, 5 insertions(+), 0 deletions(-) + create mode 100644 file1 --------------g-i-t--v-e-r-s-i-o-n Content-Type: text/x-patch; name="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff" @@ -126,6 +128,7 @@ Content-Transfer-Encoding: 8bit file0 | 3 +++ file3 | 4 ++++ 3 files changed, 9 insertions(+), 0 deletions(-) + create mode 100644 file3 --------------g-i-t--v-e-r-s-i-o-n Content-Type: text/x-patch; name="c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a.diff" diff --git a/t/t4013/diff.format-patch_--attach_--stdout_initial..master^ b/t/t4013/diff.format-patch_--attach_--stdout_initial..master^ index a9d1cd368b..d0dd19b623 100644 --- a/t/t4013/diff.format-patch_--attach_--stdout_initial..master^ +++ b/t/t4013/diff.format-patch_--attach_--stdout_initial..master^ @@ -19,6 +19,7 @@ This is the second commit. file0 | 3 +++ file2 | 3 --- 3 files changed, 5 insertions(+), 3 deletions(-) + delete mode 100644 file2 --------------g-i-t--v-e-r-s-i-o-n Content-Type: text/x-patch; name="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff" @@ -77,6 +78,7 @@ Content-Transfer-Encoding: 8bit dir/sub | 2 ++ file1 | 3 +++ 2 files changed, 5 insertions(+), 0 deletions(-) + create mode 100644 file1 --------------g-i-t--v-e-r-s-i-o-n Content-Type: text/x-patch; name="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff" diff --git a/t/t4013/diff.format-patch_--attach_--stdout_initial..side b/t/t4013/diff.format-patch_--attach_--stdout_initial..side index 57b9d0bdc1..67a95c5cba 100644 --- a/t/t4013/diff.format-patch_--attach_--stdout_initial..side +++ b/t/t4013/diff.format-patch_--attach_--stdout_initial..side @@ -17,6 +17,7 @@ Content-Transfer-Encoding: 8bit file0 | 3 +++ file3 | 4 ++++ 3 files changed, 9 insertions(+), 0 deletions(-) + create mode 100644 file3 --------------g-i-t--v-e-r-s-i-o-n Content-Type: text/x-patch; name="c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a.diff" diff --git a/t/t4013/diff.format-patch_--stdout_initial..master b/t/t4013/diff.format-patch_--stdout_initial..master index c33302e92f..8b88ca4927 100644 --- a/t/t4013/diff.format-patch_--stdout_initial..master +++ b/t/t4013/diff.format-patch_--stdout_initial..master @@ -10,6 +10,7 @@ This is the second commit. file0 | 3 +++ file2 | 3 --- 3 files changed, 5 insertions(+), 3 deletions(-) + delete mode 100644 file2 diff --git a/dir/sub b/dir/sub index 35d242b..8422d40 100644 @@ -53,6 +54,7 @@ Subject: [PATCH] Third dir/sub | 2 ++ file1 | 3 +++ 2 files changed, 5 insertions(+), 0 deletions(-) + create mode 100644 file1 diff --git a/dir/sub b/dir/sub index 8422d40..cead32e 100644 @@ -87,6 +89,7 @@ Subject: [PATCH] Side file0 | 3 +++ file3 | 4 ++++ 3 files changed, 9 insertions(+), 0 deletions(-) + create mode 100644 file3 diff --git a/dir/sub b/dir/sub index 35d242b..7289e35 100644 diff --git a/t/t4013/diff.format-patch_--stdout_initial..master^ b/t/t4013/diff.format-patch_--stdout_initial..master^ index 03d0f9693c..47a4b88637 100644 --- a/t/t4013/diff.format-patch_--stdout_initial..master^ +++ b/t/t4013/diff.format-patch_--stdout_initial..master^ @@ -10,6 +10,7 @@ This is the second commit. file0 | 3 +++ file2 | 3 --- 3 files changed, 5 insertions(+), 3 deletions(-) + delete mode 100644 file2 diff --git a/dir/sub b/dir/sub index 35d242b..8422d40 100644 @@ -53,6 +54,7 @@ Subject: [PATCH] Third dir/sub | 2 ++ file1 | 3 +++ 2 files changed, 5 insertions(+), 0 deletions(-) + create mode 100644 file1 diff --git a/dir/sub b/dir/sub index 8422d40..cead32e 100644 diff --git a/t/t4013/diff.format-patch_--stdout_initial..side b/t/t4013/diff.format-patch_--stdout_initial..side index d10a46523b..e765088475 100644 --- a/t/t4013/diff.format-patch_--stdout_initial..side +++ b/t/t4013/diff.format-patch_--stdout_initial..side @@ -9,6 +9,7 @@ Subject: [PATCH] Side file0 | 3 +++ file3 | 4 ++++ 3 files changed, 9 insertions(+), 0 deletions(-) + create mode 100644 file3 diff --git a/dir/sub b/dir/sub index 35d242b..7289e35 100644 -- cgit v1.2.3 From 4700951298ec75283c71e3daa9b18007adc195a2 Mon Sep 17 00:00:00 2001 From: Simon 'corecode' Schubert Date: Thu, 18 Jan 2007 11:18:51 +0100 Subject: Use standard -t option for touch. Non-GNU touch do not have the -d option to take free form date strings. The POSIX -t option should be more widespread. For this to work, date needs to output YYYYMMDDHHMM.SS date strings. Signed-off-by: Simon 'corecode' Schubert Signed-off-by: Junio C Hamano --- t/t4200-rerere.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 't') diff --git a/t/t4200-rerere.sh b/t/t4200-rerere.sh index 5ee5b23095..91be272ac4 100755 --- a/t/t4200-rerere.sh +++ b/t/t4200-rerere.sh @@ -120,29 +120,29 @@ case "$(date -d @11111111 +%s 2>/dev/null)" in just_over_15_days_ago=$(($now-1-15*86400)) almost_60_days_ago=$(($now+60-60*86400)) just_over_60_days_ago=$(($now-1-60*86400)) - predate1="$(date -d "@$almost_60_days_ago" +%c)" - predate2="$(date -d "@$almost_15_days_ago" +%c)" - postdate1="$(date -d "@$just_over_60_days_ago" +%c)" - postdate2="$(date -d "@$just_over_15_days_ago" +%c)" + predate1="$(date -d "@$almost_60_days_ago" +%Y%m%d%H%M.%S)" + predate2="$(date -d "@$almost_15_days_ago" +%Y%m%d%H%M.%S)" + postdate1="$(date -d "@$just_over_60_days_ago" +%Y%m%d%H%M.%S)" + postdate2="$(date -d "@$just_over_15_days_ago" +%Y%m%d%H%M.%S)" ;; *) # it is not GNU date. oh, well. - predate1="$(date)" - predate2="$(date)" - postdate1='1 Oct 2006 00:00:00' - postdate2='1 Dec 2006 00:00:00' + predate1="$(date +%Y%m%d%H%M.%S)" + predate2="$(date +%Y%m%d%H%M.%S)" + postdate1='200610010000.00' + postdate2='200612010000.00' esac -touch -m -d "$predate1" $rr/preimage -touch -m -d "$predate2" $rr2/preimage +touch -m -t "$predate1" $rr/preimage +touch -m -t "$predate2" $rr2/preimage test_expect_success 'garbage collection (part1)' 'git rerere gc' test_expect_success 'young records still live' \ "test -f $rr/preimage -a -f $rr2/preimage" -touch -m -d "$postdate1" $rr/preimage -touch -m -d "$postdate2" $rr2/preimage +touch -m -t "$postdate1" $rr/preimage +touch -m -t "$postdate2" $rr2/preimage test_expect_success 'garbage collection (part2)' 'git rerere gc' -- cgit v1.2.3 From 6f71686e0bac2337cdaf9057893a16a47e7d1033 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sat, 20 Jan 2007 02:25:37 +0100 Subject: config_set_multivar(): disallow newlines in keys This will no longer work: $ git repo-config 'key.with newline' some-value Signed-off-by: Johannes Schindelin --- t/t1300-repo-config.sh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 't') diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh index 60acdd368b..eb7455ba21 100755 --- a/t/t1300-repo-config.sh +++ b/t/t1300-repo-config.sh @@ -418,5 +418,11 @@ EOF test_expect_success 'quoting' 'cmp .git/config expect' +test_expect_failure 'key with newline' 'git repo-config key.with\\\ +newline 123' + +test_expect_success 'value with newline' 'git repo-config key.sub value.with\\\ +newline' + test_done -- cgit v1.2.3 From 16d7cc90dd6e68a170362ae6f0fbfbc504fd246b Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 19 Jan 2007 01:19:05 -0800 Subject: Extend read_ref_at() to be usable from places other than sha1_name. You can pass an extra argument to the function to receive the reflog message information. Also when the log does not go back beyond the point the user asked, the cut-off time and count are given back to the caller for emitting the error messages as appropriately. We could later add configuration for get_sha1_basic() to make it an error instead of it being just a warning. Signed-off-by: Junio C Hamano --- t/t1400-update-ref.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 't') diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh index 5637cb5eac..e48e2b7189 100755 --- a/t/t1400-update-ref.sh +++ b/t/t1400-update-ref.sh @@ -138,19 +138,19 @@ test_expect_success \ 'rm -f o e git-rev-parse --verify "master@{May 25 2005}" >o 2>e && test '"$C"' = $(cat o) && - test "warning: Log .git/logs/'"$m only goes back to $ed"'." = "$(cat e)"' + test "warning: Log for '\'master\'' only goes back to $ed." = "$(cat e)"' test_expect_success \ "Query master@{2005-05-25} (before history)" \ 'rm -f o e git-rev-parse --verify master@{2005-05-25} >o 2>e && test '"$C"' = $(cat o) && - echo test "warning: Log .git/logs/'"$m only goes back to $ed"'." = "$(cat e)"' + echo test "warning: Log for '\'master\'' only goes back to $ed." = "$(cat e)"' test_expect_success \ 'Query "master@{May 26 2005 23:31:59}" (1 second before history)' \ 'rm -f o e git-rev-parse --verify "master@{May 26 2005 23:31:59}" >o 2>e && test '"$C"' = $(cat o) && - test "warning: Log .git/logs/'"$m only goes back to $ed"'." = "$(cat e)"' + test "warning: Log for '\''master'\'' only goes back to $ed." = "$(cat e)"' test_expect_success \ 'Query "master@{May 26 2005 23:32:00}" (exactly history start)' \ 'rm -f o e -- cgit v1.2.3 From 68025633e352264898de44ec4856552d9a3abece Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sat, 20 Jan 2007 03:09:34 +0100 Subject: Do not verify filenames in a bare repository For example, it makes no sense to check the presence of a file named "HEAD" when calling "git log HEAD" in a bare repository. Noticed by Han-Wen Nienhuys. Signed-off-by: Johannes Schindelin --- t/t1020-subdirectory.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 't') diff --git a/t/t1020-subdirectory.sh b/t/t1020-subdirectory.sh index 4409b87f8d..c090c96185 100755 --- a/t/t1020-subdirectory.sh +++ b/t/t1020-subdirectory.sh @@ -106,4 +106,33 @@ test_expect_success 'read-tree' ' cmp ../one ../original.one ' +test_expect_success 'no file/rev ambuguity check inside .git' ' + cd $HERE && + git commit -a -m 1 && + cd $HERE/.git && + git show -s HEAD +' + +test_expect_success 'no file/rev ambuguity check inside a bare repo' ' + cd $HERE && + git clone -s --bare .git foo.git && + cd foo.git && GIT_DIR=. git show -s HEAD +' + +# This still does not work as it should... +: test_expect_success 'no file/rev ambuguity check inside a bare repo' ' + cd $HERE && + git clone -s --bare .git foo.git && + cd foo.git && git show -s HEAD +' + +test_expect_success 'detection should not be fooled by a symlink' ' + cd $HERE && + rm -fr foo.git && + git clone -s .git another && + ln -s another yetanother && + cd yetanother/.git && + git show -s HEAD +' + test_done -- cgit v1.2.3 From 9b088c4e394df84232cfd37aea78349a495b09c1 Mon Sep 17 00:00:00 2001 From: Matthias Lederhofer Date: Fri, 19 Jan 2007 11:49:35 +0100 Subject: prune: --grace=time This option gives grace period to objects that are unreachable from the refs from getting pruned. The default value is 24 hours and may be changed using gc.prunegrace. Signed-off-by: Matthias Lederhofer Signed-off-by: Junio C Hamano --- t/t1410-reflog.sh | 6 +++--- t/t5400-send-pack.sh | 4 ++-- t/t5700-clone-reference.sh | 4 ++-- t/t5710-info-alternate.sh | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 't') diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh index 8e8d526ef2..0c435f9574 100755 --- a/t/t1410-reflog.sh +++ b/t/t1410-reflog.sh @@ -96,7 +96,7 @@ test_expect_success setup ' check_have A B C D E F G H I J K L && - git prune && + git prune --grace=off && check_have A B C D E F G H I J K L && @@ -115,7 +115,7 @@ test_expect_success rewind ' check_have A B C D E F G H I J K L && - git prune && + git prune --grace=off && check_have A B C D E F G H I J K L && @@ -160,7 +160,7 @@ test_expect_success 'reflog expire' ' test_expect_success 'prune and fsck' ' - git prune && + git prune --grace=off && check_fsck && check_have A B C D E H L && diff --git a/t/t5400-send-pack.sh b/t/t5400-send-pack.sh index 2c151912a3..2a55d5ae32 100755 --- a/t/t5400-send-pack.sh +++ b/t/t5400-send-pack.sh @@ -55,13 +55,13 @@ test_expect_success setup ' test_expect_success 'pack the source repository' ' git repack -a -d && - git prune + git prune --grace=off ' test_expect_success 'pack the destination repository' ' cd victim && git repack -a -d && - git prune && + git prune --grace=off && cd .. ' diff --git a/t/t5700-clone-reference.sh b/t/t5700-clone-reference.sh index dd9caad1c2..ab00e8fb6a 100755 --- a/t/t5700-clone-reference.sh +++ b/t/t5700-clone-reference.sh @@ -22,7 +22,7 @@ echo second > file2 && git add file2 && git commit -m addition && git repack -a -d && -git prune' +git prune --grace=off' cd "$base_dir" @@ -56,7 +56,7 @@ echo third > file3 && git add file3 && git commit -m update && git repack -a -d && -git prune' +git prune --grace=off' cd "$base_dir" diff --git a/t/t5710-info-alternate.sh b/t/t5710-info-alternate.sh index b9f6d96363..c30fee81f5 100755 --- a/t/t5710-info-alternate.sh +++ b/t/t5710-info-alternate.sh @@ -29,7 +29,7 @@ echo "Hello World" > file1 && git add file1 && git commit -m "Initial commit" file1 && git repack -a -d && -git prune' +git prune --grace=off' cd "$base_dir" @@ -39,7 +39,7 @@ echo "foo bar" > file2 && git add file2 && git commit -m "next commit" file2 && git repack -a -d -l && -git prune' +git prune --grace=off' cd "$base_dir" @@ -49,7 +49,7 @@ echo "Goodbye, cruel world" > file3 && git add file3 && git commit -m "one more" file3 && git repack -a -d -l && -git prune' +git prune --grace=off' cd "$base_dir" -- cgit v1.2.3 From 026aa93818a536c819a94aae5bbefe1b6251fe0e Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 21 Jan 2007 21:29:44 -0800 Subject: Revert "prune: --grace=time" This reverts commit 9b088c4e394df84232cfd37aea78349a495b09c1. Protecting 'mature' objects does not make it any safer. We should admit that git-prune is inherently unsafe when run in parallel with other operations without involving unwarranted locking overhead, and with the latest git, even rebase and reset would not immediately create crufts anyway. --- t/t1410-reflog.sh | 6 +++--- t/t5400-send-pack.sh | 4 ++-- t/t5700-clone-reference.sh | 4 ++-- t/t5710-info-alternate.sh | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 't') diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh index 0c435f9574..8e8d526ef2 100755 --- a/t/t1410-reflog.sh +++ b/t/t1410-reflog.sh @@ -96,7 +96,7 @@ test_expect_success setup ' check_have A B C D E F G H I J K L && - git prune --grace=off && + git prune && check_have A B C D E F G H I J K L && @@ -115,7 +115,7 @@ test_expect_success rewind ' check_have A B C D E F G H I J K L && - git prune --grace=off && + git prune && check_have A B C D E F G H I J K L && @@ -160,7 +160,7 @@ test_expect_success 'reflog expire' ' test_expect_success 'prune and fsck' ' - git prune --grace=off && + git prune && check_fsck && check_have A B C D E H L && diff --git a/t/t5400-send-pack.sh b/t/t5400-send-pack.sh index 2a55d5ae32..2c151912a3 100755 --- a/t/t5400-send-pack.sh +++ b/t/t5400-send-pack.sh @@ -55,13 +55,13 @@ test_expect_success setup ' test_expect_success 'pack the source repository' ' git repack -a -d && - git prune --grace=off + git prune ' test_expect_success 'pack the destination repository' ' cd victim && git repack -a -d && - git prune --grace=off && + git prune && cd .. ' diff --git a/t/t5700-clone-reference.sh b/t/t5700-clone-reference.sh index ab00e8fb6a..dd9caad1c2 100755 --- a/t/t5700-clone-reference.sh +++ b/t/t5700-clone-reference.sh @@ -22,7 +22,7 @@ echo second > file2 && git add file2 && git commit -m addition && git repack -a -d && -git prune --grace=off' +git prune' cd "$base_dir" @@ -56,7 +56,7 @@ echo third > file3 && git add file3 && git commit -m update && git repack -a -d && -git prune --grace=off' +git prune' cd "$base_dir" diff --git a/t/t5710-info-alternate.sh b/t/t5710-info-alternate.sh index c30fee81f5..b9f6d96363 100755 --- a/t/t5710-info-alternate.sh +++ b/t/t5710-info-alternate.sh @@ -29,7 +29,7 @@ echo "Hello World" > file1 && git add file1 && git commit -m "Initial commit" file1 && git repack -a -d && -git prune --grace=off' +git prune' cd "$base_dir" @@ -39,7 +39,7 @@ echo "foo bar" > file2 && git add file2 && git commit -m "next commit" file2 && git repack -a -d -l && -git prune --grace=off' +git prune' cd "$base_dir" @@ -49,7 +49,7 @@ echo "Goodbye, cruel world" > file3 && git add file3 && git commit -m "one more" file3 && git repack -a -d -l && -git prune --grace=off' +git prune' cd "$base_dir" -- cgit v1.2.3 From d7ebd53d371153f7a61c0fe9f384c9662b751bf6 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 23 Jan 2007 16:51:22 -0800 Subject: git-checkout -m: fix merge case Commit c1a4278e switched the "merging checkout" implementation from 3-way read-tree to merge-recursive, but forgot that merge-recursive will signal an unmerged state with its own exit status code. This prevented the clean-up phase (paths cleanly merged should not be updated in the index) from running. Signed-off-by: Junio C Hamano --- t/t7201-co.sh | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 't') diff --git a/t/t7201-co.sh b/t/t7201-co.sh index 315fa3564c..867bbd26cb 100755 --- a/t/t7201-co.sh +++ b/t/t7201-co.sh @@ -100,7 +100,33 @@ test_expect_success "checkout -m with dirty tree, renamed" ' git checkout -m renamer && fill 1 3 4 5 7 8 >expect && diff expect uno && - ! test -f one + ! test -f one && + git diff --cached >current && + ! test -s current + +' + +test_expect_success 'checkout -m with merge conflict' ' + + git checkout -f master && git clean && + + fill 1 T 3 4 5 6 S 8 >one && + if git checkout renamer + then + echo Not happy + false + else + echo "happy - failed correctly" + fi && + + git checkout -m renamer && + + git diff master:one :3:uno | + sed -e "1,/^@@/d" -e "/^ /d" -e "s/^-/d/" -e "s/^+/a/" >current && + fill d2 aT d7 aS >expect && + diff current expect && + git diff --cached two >current && + ! test -s current ' test_done -- cgit v1.2.3 From 83cd10a05688e6429f9e65cffbe90683e9487800 Mon Sep 17 00:00:00 2001 From: Jakub Narebski Date: Tue, 23 Jan 2007 13:37:25 +0100 Subject: t/t1300-repo-config.sh: value continued on next line Documentation/config.txt: Variable value ending in a '`\`' is continued on the next line in the customary UNIX fashion. Test it. Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- t/t1300-repo-config.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 't') diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh index eb7455ba21..0e4f32d5c9 100755 --- a/t/t1300-repo-config.sh +++ b/t/t1300-repo-config.sh @@ -424,5 +424,25 @@ newline 123' test_expect_success 'value with newline' 'git repo-config key.sub value.with\\\ newline' +cat > .git/config <<\EOF +[section] + ; comment \ + continued = cont\ +inued + noncont = not continued ; \ + quotecont = "cont;\ +inued" +EOF + +cat > expect <<\EOF +section.continued=continued +section.noncont=not continued +section.quotecont=cont;inued +EOF + +git repo-config --list > result + +test_expect_success 'value continued on next line' 'cmp result expect' + test_done -- cgit v1.2.3 From af7cf268f0bf8d4216f9c11d1cb0082cb3550f61 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 24 Jan 2007 16:47:24 -0800 Subject: fetch-pack: remove --keep-auto and make it the default. This makes git-fetch over git native protocol to automatically decide to keep the downloaded pack if the fetch results in more than 100 objects, just like receive-pack invoked by git-push does. This logic is disabled when --keep is explicitly given from the command line, so that a very small clone still keeps the downloaded pack as before. The 100 threshold can be adjusted with fetch.unpacklimit configuration. We might want to introduce transfer.unpacklimit to consolidate the two unpacklimit variables, which will be a topic for the next patch. Signed-off-by: Junio C Hamano --- t/t5500-fetch-pack.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 't') diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh index ef78df67ea..7fd651b1c4 100755 --- a/t/t5500-fetch-pack.sh +++ b/t/t5500-fetch-pack.sh @@ -97,7 +97,8 @@ pull_to_client () { ( mkdir client && cd client && - git-init 2>> log2.txt + git-init 2>> log2.txt && + git repo-config fetch.unpacklimit 0 ) add A1 -- cgit v1.2.3 From e28714c527339a477fca226765163b9361d94285 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 24 Jan 2007 17:02:15 -0800 Subject: Consolidate {receive,fetch}.unpackLimit This allows transfer.unpackLimit to specify what these two configuration variables want to set. We would probably want to deprecate the two separate variables, as I do not see much point in specifying them independently. Signed-off-by: Junio C Hamano --- t/t5500-fetch-pack.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't') diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh index 7fd651b1c4..058cce0775 100755 --- a/t/t5500-fetch-pack.sh +++ b/t/t5500-fetch-pack.sh @@ -98,7 +98,7 @@ pull_to_client () { mkdir client && cd client && git-init 2>> log2.txt && - git repo-config fetch.unpacklimit 0 + git repo-config transfer.unpacklimit 0 ) add A1 -- cgit v1.2.3 From 1b555932cdb7f75239623573cd2ff25fa98ab4e4 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Thu, 25 Jan 2007 16:51:21 -0800 Subject: Fix seriously broken "git pack-refs" Do *NOT* try this on a repository you care about: git pack-refs --all --prune git pack-refs because while the first "pack-refs" does the right thing, the second pack-refs will totally screw you over. This is because the second one tries to pack only tags; we should also pack what are already packed -- otherwise we would lose them. [jc: with an additional test] Signed-off-by: Junio C Hamano --- t/t3210-pack-refs.sh | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 't') diff --git a/t/t3210-pack-refs.sh b/t/t3210-pack-refs.sh index 16bdae4f23..f0c7e22b36 100755 --- a/t/t3210-pack-refs.sh +++ b/t/t3210-pack-refs.sh @@ -96,4 +96,13 @@ test_expect_success \ git-branch -d n/o/p && git-branch n' +test_expect_success 'pack, prune and repack' ' + git-tag foo && + git-pack-refs --all --prune && + git-show-ref >all-of-them && + git-pack-refs && + git-show-ref >again && + diff all-of-them again +' + test_done -- cgit v1.2.3 From e0d10e1c63bc52b37bbec99b07deee794058d9b4 Mon Sep 17 00:00:00 2001 From: Tom Prince Date: Sun, 28 Jan 2007 16:16:53 -0800 Subject: [PATCH] Rename git-repo-config to git-config. Signed-off-by: Tom Prince Signed-off-by: Junio C Hamano --- t/t1300-repo-config.sh | 102 +++++++++++++++++++++++----------------------- t/t1400-update-ref.sh | 4 +- t/t1410-reflog.sh | 2 +- t/t3200-branch.sh | 6 +-- t/t3700-add.sh | 6 +-- t/t3900-i18n-commit.sh | 24 +++++------ t/t3901-i18n-patch.sh | 58 +++++++++++++------------- t/t4000-diff-format.sh | 2 +- t/t4006-diff-mode.sh | 2 +- t/t4013-diff-various.sh | 2 +- t/t4102-apply-rename.sh | 2 +- t/t5301-sliding-window.sh | 14 +++---- t/t5400-send-pack.sh | 2 +- t/t5500-fetch-pack.sh | 2 +- t/t5510-fetch.sh | 10 ++--- t/t6200-fmt-merge-msg.sh | 6 +-- 16 files changed, 122 insertions(+), 122 deletions(-) (limited to 't') diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh index 0e4f32d5c9..49b5666b33 100755 --- a/t/t1300-repo-config.sh +++ b/t/t1300-repo-config.sh @@ -3,13 +3,13 @@ # Copyright (c) 2005 Johannes Schindelin # -test_description='Test git-repo-config in different settings' +test_description='Test git-config in different settings' . ./test-lib.sh test -f .git/config && rm .git/config -git-repo-config core.penguin "little blue" +git-config core.penguin "little blue" cat > expect << EOF [core] @@ -18,7 +18,7 @@ EOF test_expect_success 'initial' 'cmp .git/config expect' -git-repo-config Core.Movie BadPhysics +git-config Core.Movie BadPhysics cat > expect << EOF [core] @@ -28,7 +28,7 @@ EOF test_expect_success 'mixed case' 'cmp .git/config expect' -git-repo-config Cores.WhatEver Second +git-config Cores.WhatEver Second cat > expect << EOF [core] @@ -40,7 +40,7 @@ EOF test_expect_success 'similar section' 'cmp .git/config expect' -git-repo-config CORE.UPPERCASE true +git-config CORE.UPPERCASE true cat > expect << EOF [core] @@ -54,10 +54,10 @@ EOF test_expect_success 'similar section' 'cmp .git/config expect' test_expect_success 'replace with non-match' \ - 'git-repo-config core.penguin kingpin !blue' + 'git-config core.penguin kingpin !blue' test_expect_success 'replace with non-match (actually matching)' \ - 'git-repo-config core.penguin "very blue" !kingpin' + 'git-config core.penguin "very blue" !kingpin' cat > expect << EOF [core] @@ -86,7 +86,7 @@ EOF cp .git/config .git/config2 test_expect_success 'multiple unset' \ - 'git-repo-config --unset-all beta.haha' + 'git-config --unset-all beta.haha' cat > expect << EOF [beta] ; silly comment # another comment @@ -102,7 +102,7 @@ test_expect_success 'multiple unset is correct' 'cmp .git/config expect' mv .git/config2 .git/config test_expect_success '--replace-all' \ - 'git-repo-config --replace-all beta.haha gamma' + 'git-config --replace-all beta.haha gamma' cat > expect << EOF [beta] ; silly comment # another comment @@ -116,7 +116,7 @@ EOF test_expect_success 'all replaced' 'cmp .git/config expect' -git-repo-config beta.haha alpha +git-config beta.haha alpha cat > expect << EOF [beta] ; silly comment # another comment @@ -130,7 +130,7 @@ EOF test_expect_success 'really mean test' 'cmp .git/config expect' -git-repo-config nextsection.nonewline wow +git-config nextsection.nonewline wow cat > expect << EOF [beta] ; silly comment # another comment @@ -145,8 +145,8 @@ EOF test_expect_success 'really really mean test' 'cmp .git/config expect' -test_expect_success 'get value' 'test alpha = $(git-repo-config beta.haha)' -git-repo-config --unset beta.haha +test_expect_success 'get value' 'test alpha = $(git-config beta.haha)' +git-config --unset beta.haha cat > expect << EOF [beta] ; silly comment # another comment @@ -160,7 +160,7 @@ EOF test_expect_success 'unset' 'cmp .git/config expect' -git-repo-config nextsection.NoNewLine "wow2 for me" "for me$" +git-config nextsection.NoNewLine "wow2 for me" "for me$" cat > expect << EOF [beta] ; silly comment # another comment @@ -176,18 +176,18 @@ EOF test_expect_success 'multivar' 'cmp .git/config expect' test_expect_success 'non-match' \ - 'git-repo-config --get nextsection.nonewline !for' + 'git-config --get nextsection.nonewline !for' test_expect_success 'non-match value' \ - 'test wow = $(git-repo-config --get nextsection.nonewline !for)' + 'test wow = $(git-config --get nextsection.nonewline !for)' test_expect_failure 'ambiguous get' \ - 'git-repo-config --get nextsection.nonewline' + 'git-config --get nextsection.nonewline' test_expect_success 'get multivar' \ - 'git-repo-config --get-all nextsection.nonewline' + 'git-config --get-all nextsection.nonewline' -git-repo-config nextsection.nonewline "wow3" "wow$" +git-config nextsection.nonewline "wow3" "wow$" cat > expect << EOF [beta] ; silly comment # another comment @@ -202,15 +202,15 @@ EOF test_expect_success 'multivar replace' 'cmp .git/config expect' -test_expect_failure 'ambiguous value' 'git-repo-config nextsection.nonewline' +test_expect_failure 'ambiguous value' 'git-config nextsection.nonewline' test_expect_failure 'ambiguous unset' \ - 'git-repo-config --unset nextsection.nonewline' + 'git-config --unset nextsection.nonewline' test_expect_failure 'invalid unset' \ - 'git-repo-config --unset somesection.nonewline' + 'git-config --unset somesection.nonewline' -git-repo-config --unset nextsection.nonewline "wow3$" +git-config --unset nextsection.nonewline "wow3$" cat > expect << EOF [beta] ; silly comment # another comment @@ -224,12 +224,12 @@ EOF test_expect_success 'multivar unset' 'cmp .git/config expect' -test_expect_failure 'invalid key' 'git-repo-config inval.2key blabla' +test_expect_failure 'invalid key' 'git-config inval.2key blabla' -test_expect_success 'correct key' 'git-repo-config 123456.a123 987' +test_expect_success 'correct key' 'git-config 123456.a123 987' test_expect_success 'hierarchical section' \ - 'git-repo-config Version.1.2.3eX.Alpha beta' + 'git-config Version.1.2.3eX.Alpha beta' cat > expect << EOF [beta] ; silly comment # another comment @@ -255,7 +255,7 @@ version.1.2.3eX.alpha=beta EOF test_expect_success 'working --list' \ - 'git-repo-config --list > output && cmp output expect' + 'git-config --list > output && cmp output expect' cat > expect << EOF beta.noindent sillyValue @@ -263,9 +263,9 @@ nextsection.nonewline wow2 for me EOF test_expect_success '--get-regexp' \ - 'git-repo-config --get-regexp in > output && cmp output expect' + 'git-config --get-regexp in > output && cmp output expect' -git-repo-config --add nextsection.nonewline "wow4 for you" +git-config --add nextsection.nonewline "wow4 for you" cat > expect << EOF wow2 for me @@ -273,7 +273,7 @@ wow4 for you EOF test_expect_success '--add' \ - 'git-repo-config --get-all nextsection.nonewline > output && cmp output expect' + 'git-config --get-all nextsection.nonewline > output && cmp output expect' cat > .git/config << EOF [novalue] @@ -281,9 +281,9 @@ cat > .git/config << EOF EOF test_expect_success 'get variable with no value' \ - 'git-repo-config --get novalue.variable ^$' + 'git-config --get novalue.variable ^$' -git-repo-config > output 2>&1 +git-config > output 2>&1 test_expect_success 'no arguments, but no crash' \ "test $? = 129 && grep usage output" @@ -293,7 +293,7 @@ cat > .git/config << EOF c = d EOF -git-repo-config a.x y +git-config a.x y cat > expect << EOF [a.b] @@ -304,8 +304,8 @@ EOF test_expect_success 'new section is partial match of another' 'cmp .git/config expect' -git-repo-config b.x y -git-repo-config a.b c +git-config b.x y +git-config a.b c cat > expect << EOF [a.b] @@ -328,11 +328,11 @@ cat > expect << EOF ein.bahn=strasse EOF -GIT_CONFIG=other-config git-repo-config -l > output +GIT_CONFIG=other-config git-config -l > output test_expect_success 'alternative GIT_CONFIG' 'cmp output expect' -GIT_CONFIG=other-config git-repo-config anwohner.park ausweis +GIT_CONFIG=other-config git-config anwohner.park ausweis cat > expect << EOF [ein] @@ -355,7 +355,7 @@ weird EOF test_expect_success "rename section" \ - "git-repo-config --rename-section branch.eins branch.zwei" + "git-config --rename-section branch.eins branch.zwei" cat > expect << EOF # Hallo @@ -371,12 +371,12 @@ EOF test_expect_success "rename succeeded" "diff -u expect .git/config" test_expect_failure "rename non-existing section" \ - 'git-repo-config --rename-section branch."world domination" branch.drei' + 'git-config --rename-section branch."world domination" branch.drei' test_expect_success "rename succeeded" "diff -u expect .git/config" test_expect_success "rename another section" \ - 'git-repo-config --rename-section branch."1 234 blabl/a" branch.drei' + 'git-config --rename-section branch."1 234 blabl/a" branch.drei' cat > expect << EOF # Hallo @@ -393,20 +393,20 @@ test_expect_success "rename succeeded" "diff -u expect .git/config" test_expect_success numbers ' - git-repo-config kilo.gram 1k && - git-repo-config mega.ton 1m && - k=$(git-repo-config --int --get kilo.gram) && + git-config kilo.gram 1k && + git-config mega.ton 1m && + k=$(git-config --int --get kilo.gram) && test z1024 = "z$k" && - m=$(git-repo-config --int --get mega.ton) && + m=$(git-config --int --get mega.ton) && test z1048576 = "z$m" ' rm .git/config -git-repo-config quote.leading " test" -git-repo-config quote.ending "test " -git-repo-config quote.semicolon "test;test" -git-repo-config quote.hash "test#test" +git-config quote.leading " test" +git-config quote.ending "test " +git-config quote.semicolon "test;test" +git-config quote.hash "test#test" cat > expect << EOF [quote] @@ -418,10 +418,10 @@ EOF test_expect_success 'quoting' 'cmp .git/config expect' -test_expect_failure 'key with newline' 'git repo-config key.with\\\ +test_expect_failure 'key with newline' 'git config key.with\\\ newline 123' -test_expect_success 'value with newline' 'git repo-config key.sub value.with\\\ +test_expect_success 'value with newline' 'git config key.sub value.with\\\ newline' cat > .git/config <<\EOF @@ -440,7 +440,7 @@ section.noncont=not continued section.quotecont=cont;inued EOF -git repo-config --list > result +git config --list > result test_expect_success 'value continued on next line' 'cmp result expect' diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh index e48e2b7189..d0aba2c2ae 100755 --- a/t/t1400-update-ref.sh +++ b/t/t1400-update-ref.sh @@ -93,8 +93,8 @@ rm -rf .git/$m .git/logs expect test_expect_success \ 'enable core.logAllRefUpdates' \ - 'git-repo-config core.logAllRefUpdates true && - test true = $(git-repo-config --bool --get core.logAllRefUpdates)' + 'git-config core.logAllRefUpdates true && + test true = $(git-config --bool --get core.logAllRefUpdates)' test_expect_success \ "create $m (logged by config)" \ diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh index 8e8d526ef2..47d124732c 100755 --- a/t/t1410-reflog.sh +++ b/t/t1410-reflog.sh @@ -71,7 +71,7 @@ test_expect_success setup ' check_fsck && chmod +x C && - ( test "`git repo-config --bool core.filemode`" != false || + ( test "`git config --bool core.filemode`" != false || echo executable >>C ) && git add C && test_tick && git commit -m dragon && diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh index bb80e4286a..5565c27033 100755 --- a/t/t3200-branch.sh +++ b/t/t3200-branch.sh @@ -94,7 +94,7 @@ test_expect_failure \ git-branch r && git-branch -m q r/q' -git-repo-config branch.s/s.dummy Hello +git-config branch.s/s.dummy Hello test_expect_success \ 'git branch -m s/s s should work when s/t is deleted' \ @@ -107,8 +107,8 @@ test_expect_success \ test -f .git/logs/refs/heads/s' test_expect_success 'config information was renamed, too' \ - "test $(git-repo-config branch.s.dummy) = Hello && - ! git-repo-config branch.s/s/dummy" + "test $(git-config branch.s.dummy) = Hello && + ! git-config branch.s/s/dummy" test_expect_failure \ 'git-branch -m u v should fail when the reflog for u is a symlink' \ diff --git a/t/t3700-add.sh b/t/t3700-add.sh index e98786de32..caaab26c2f 100755 --- a/t/t3700-add.sh +++ b/t/t3700-add.sh @@ -21,7 +21,7 @@ test_expect_success \ test_expect_success \ 'git-add: Test that executable bit is not used if core.filemode=0' \ - 'git repo-config core.filemode 0 && + 'git config core.filemode 0 && echo foo >xfoo1 && chmod 755 xfoo1 && git-add xfoo1 && @@ -32,7 +32,7 @@ test_expect_success \ test_expect_success \ 'git-update-index --add: Test that executable bit is not used...' \ - 'git repo-config core.filemode 0 && + 'git config core.filemode 0 && echo foo >xfoo2 && chmod 755 xfoo2 && git-update-index --add xfoo2 && @@ -43,7 +43,7 @@ test_expect_success \ test_expect_success \ 'git-update-index --add: Test that executable bit is not used...' \ - 'git repo-config core.filemode 0 && + 'git config core.filemode 0 && ln -s xfoo2 xfoo3 && git-update-index --add xfoo3 && case "`git-ls-files --stage xfoo3`" in diff --git a/t/t3900-i18n-commit.sh b/t/t3900-i18n-commit.sh index 6714b0dd6e..e54fe0f401 100755 --- a/t/t3900-i18n-commit.sh +++ b/t/t3900-i18n-commit.sh @@ -29,7 +29,7 @@ test_expect_success 'no encoding header for base case' ' for H in ISO-8859-1 EUCJP ISO-2022-JP do test_expect_success "$H setup" ' - git-repo-config i18n.commitencoding $H && + git-config i18n.commitencoding $H && git-checkout -b $H C0 && echo $H >F && git-commit -a -F ../t3900/$H.txt @@ -44,16 +44,16 @@ do ' done -test_expect_success 'repo-config to remove customization' ' - git-repo-config --unset-all i18n.commitencoding && - if Z=$(git-repo-config --get-all i18n.commitencoding) +test_expect_success 'config to remove customization' ' + git-config --unset-all i18n.commitencoding && + if Z=$(git-config --get-all i18n.commitencoding) then echo Oops, should have failed. false else test z = "z$Z" fi && - git-repo-config i18n.commitencoding utf-8 + git-config i18n.commitencoding utf-8 ' test_expect_success 'ISO-8859-1 should be shown in UTF-8 now' ' @@ -67,9 +67,9 @@ do ' done -test_expect_success 'repo-config to add customization' ' - git-repo-config --unset-all i18n.commitencoding && - if Z=$(git-repo-config --get-all i18n.commitencoding) +test_expect_success 'config to add customization' ' + git-config --unset-all i18n.commitencoding && + if Z=$(git-config --get-all i18n.commitencoding) then echo Oops, should have failed. false @@ -81,13 +81,13 @@ test_expect_success 'repo-config to add customization' ' for H in ISO-8859-1 EUCJP ISO-2022-JP do test_expect_success "$H should be shown in itself now" ' - git-repo-config i18n.commitencoding '$H' && + git-config i18n.commitencoding '$H' && compare_with '$H' ../t3900/'$H'.txt ' done -test_expect_success 'repo-config to tweak customization' ' - git-repo-config i18n.logoutputencoding utf-8 +test_expect_success 'config to tweak customization' ' + git-config i18n.logoutputencoding utf-8 ' test_expect_success 'ISO-8859-1 should be shown in UTF-8 now' ' @@ -103,7 +103,7 @@ done for J in EUCJP ISO-2022-JP do - git-repo-config i18n.logoutputencoding $J + git-config i18n.logoutputencoding $J for H in EUCJP ISO-2022-JP do test_expect_success "$H should be shown in $J now" ' diff --git a/t/t3901-i18n-patch.sh b/t/t3901-i18n-patch.sh index eda0e2d729..a881797bc7 100755 --- a/t/t3901-i18n-patch.sh +++ b/t/t3901-i18n-patch.sh @@ -31,7 +31,7 @@ check_encoding () { } test_expect_success setup ' - git-repo-config i18n.commitencoding UTF-8 && + git-config i18n.commitencoding UTF-8 && # use UTF-8 in author and committer name to match the # i18n.commitencoding settings @@ -55,7 +55,7 @@ test_expect_success setup ' git commit -s -m "Second on side" && # the second one on the side branch is ISO-8859-1 - git-repo-config i18n.commitencoding ISO-8859-1 && + git-config i18n.commitencoding ISO-8859-1 && # use author and committer name in ISO-8859-1 to match it. . ../t3901-8859-1.txt && test_tick && @@ -64,11 +64,11 @@ test_expect_success setup ' git commit -s -m "Third on side" && # Back to default - git-repo-config i18n.commitencoding UTF-8 + git-config i18n.commitencoding UTF-8 ' test_expect_success 'format-patch output (ISO-8859-1)' ' - git-repo-config i18n.logoutputencoding ISO-8859-1 && + git-config i18n.logoutputencoding ISO-8859-1 && git format-patch --stdout master..HEAD^ >out-l1 && git format-patch --stdout HEAD^ >out-l2 && @@ -79,7 +79,7 @@ test_expect_success 'format-patch output (ISO-8859-1)' ' ' test_expect_success 'format-patch output (UTF-8)' ' - git repo-config i18n.logoutputencoding UTF-8 && + git config i18n.logoutputencoding UTF-8 && git format-patch --stdout master..HEAD^ >out-u1 && git format-patch --stdout HEAD^ >out-u2 && @@ -91,13 +91,13 @@ test_expect_success 'format-patch output (UTF-8)' ' test_expect_success 'rebase (U/U)' ' # We want the result of rebase in UTF-8 - git-repo-config i18n.commitencoding UTF-8 && + git-config i18n.commitencoding UTF-8 && # The test is about logoutputencoding not affecting the # final outcome -- it is used internally to generate the # patch and the log. - git repo-config i18n.logoutputencoding UTF-8 && + git config i18n.logoutputencoding UTF-8 && # The result will be committed by GIT_COMMITTER_NAME -- # we want UTF-8 encoded name. @@ -109,8 +109,8 @@ test_expect_success 'rebase (U/U)' ' ' test_expect_success 'rebase (U/L)' ' - git-repo-config i18n.commitencoding UTF-8 && - git repo-config i18n.logoutputencoding ISO-8859-1 && + git-config i18n.commitencoding UTF-8 && + git config i18n.logoutputencoding ISO-8859-1 && . ../t3901-utf8.txt && git reset --hard side && @@ -121,8 +121,8 @@ test_expect_success 'rebase (U/L)' ' test_expect_success 'rebase (L/L)' ' # In this test we want ISO-8859-1 encoded commits as the result - git-repo-config i18n.commitencoding ISO-8859-1 && - git repo-config i18n.logoutputencoding ISO-8859-1 && + git-config i18n.commitencoding ISO-8859-1 && + git config i18n.logoutputencoding ISO-8859-1 && . ../t3901-8859-1.txt && git reset --hard side && @@ -134,8 +134,8 @@ test_expect_success 'rebase (L/L)' ' test_expect_success 'rebase (L/U)' ' # This is pathological -- use UTF-8 as intermediate form # to get ISO-8859-1 results. - git-repo-config i18n.commitencoding ISO-8859-1 && - git repo-config i18n.logoutputencoding UTF-8 && + git-config i18n.commitencoding ISO-8859-1 && + git config i18n.logoutputencoding UTF-8 && . ../t3901-8859-1.txt && git reset --hard side && @@ -147,8 +147,8 @@ test_expect_success 'rebase (L/U)' ' test_expect_success 'cherry-pick(U/U)' ' # Both the commitencoding and logoutputencoding is set to UTF-8. - git-repo-config i18n.commitencoding UTF-8 && - git repo-config i18n.logoutputencoding UTF-8 && + git-config i18n.commitencoding UTF-8 && + git config i18n.logoutputencoding UTF-8 && . ../t3901-utf8.txt && git reset --hard master && @@ -162,8 +162,8 @@ test_expect_success 'cherry-pick(U/U)' ' test_expect_success 'cherry-pick(L/L)' ' # Both the commitencoding and logoutputencoding is set to ISO-8859-1 - git-repo-config i18n.commitencoding ISO-8859-1 && - git repo-config i18n.logoutputencoding ISO-8859-1 && + git-config i18n.commitencoding ISO-8859-1 && + git config i18n.logoutputencoding ISO-8859-1 && . ../t3901-8859-1.txt && git reset --hard master && @@ -177,8 +177,8 @@ test_expect_success 'cherry-pick(L/L)' ' test_expect_success 'cherry-pick(U/L)' ' # Commitencoding is set to UTF-8 but logoutputencoding is ISO-8859-1 - git-repo-config i18n.commitencoding UTF-8 && - git repo-config i18n.logoutputencoding ISO-8859-1 && + git-config i18n.commitencoding UTF-8 && + git config i18n.logoutputencoding ISO-8859-1 && . ../t3901-utf8.txt && git reset --hard master && @@ -193,8 +193,8 @@ test_expect_success 'cherry-pick(L/U)' ' # Again, the commitencoding is set to ISO-8859-1 but # logoutputencoding is set to UTF-8. - git-repo-config i18n.commitencoding ISO-8859-1 && - git repo-config i18n.logoutputencoding UTF-8 && + git-config i18n.commitencoding ISO-8859-1 && + git config i18n.logoutputencoding UTF-8 && . ../t3901-8859-1.txt && git reset --hard master && @@ -206,8 +206,8 @@ test_expect_success 'cherry-pick(L/U)' ' ' test_expect_success 'rebase --merge (U/U)' ' - git-repo-config i18n.commitencoding UTF-8 && - git repo-config i18n.logoutputencoding UTF-8 && + git-config i18n.commitencoding UTF-8 && + git config i18n.logoutputencoding UTF-8 && . ../t3901-utf8.txt && git reset --hard side && @@ -217,8 +217,8 @@ test_expect_success 'rebase --merge (U/U)' ' ' test_expect_success 'rebase --merge (U/L)' ' - git-repo-config i18n.commitencoding UTF-8 && - git repo-config i18n.logoutputencoding ISO-8859-1 && + git-config i18n.commitencoding UTF-8 && + git config i18n.logoutputencoding ISO-8859-1 && . ../t3901-utf8.txt && git reset --hard side && @@ -229,8 +229,8 @@ test_expect_success 'rebase --merge (U/L)' ' test_expect_success 'rebase --merge (L/L)' ' # In this test we want ISO-8859-1 encoded commits as the result - git-repo-config i18n.commitencoding ISO-8859-1 && - git repo-config i18n.logoutputencoding ISO-8859-1 && + git-config i18n.commitencoding ISO-8859-1 && + git config i18n.logoutputencoding ISO-8859-1 && . ../t3901-8859-1.txt && git reset --hard side && @@ -242,8 +242,8 @@ test_expect_success 'rebase --merge (L/L)' ' test_expect_success 'rebase --merge (L/U)' ' # This is pathological -- use UTF-8 as intermediate form # to get ISO-8859-1 results. - git-repo-config i18n.commitencoding ISO-8859-1 && - git repo-config i18n.logoutputencoding UTF-8 && + git-config i18n.commitencoding ISO-8859-1 && + git config i18n.logoutputencoding UTF-8 && . ../t3901-8859-1.txt && git reset --hard side && diff --git a/t/t4000-diff-format.sh b/t/t4000-diff-format.sh index 67b9681d36..9c58d77cc2 100755 --- a/t/t4000-diff-format.sh +++ b/t/t4000-diff-format.sh @@ -28,7 +28,7 @@ test_expect_success \ 'git-diff-files -p >current' # that's as far as it comes -if [ "$(git repo-config --get core.filemode)" = false ] +if [ "$(git config --get core.filemode)" = false ] then say 'filemode disabled on the filesystem' test_done diff --git a/t/t4006-diff-mode.sh b/t/t4006-diff-mode.sh index 8ad69d1115..ca342f48a1 100755 --- a/t/t4006-diff-mode.sh +++ b/t/t4006-diff-mode.sh @@ -15,7 +15,7 @@ test_expect_success \ tree=`git-write-tree` && echo $tree' -if [ "$(git repo-config --get core.filemode)" = false ] +if [ "$(git config --get core.filemode)" = false ] then say 'filemode disabled on the filesystem, using update-index --chmod=+x' test_expect_success \ diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh index ed37141b6e..3d85ceaae9 100755 --- a/t/t4013-diff-various.sh +++ b/t/t4013-diff-various.sh @@ -73,7 +73,7 @@ test_expect_success setup ' for i in 1 2; do echo $i; done >>dir/sub && git update-index file0 dir/sub && - git repo-config log.showroot false && + git config log.showroot false && git commit --amend && git show-branch ' diff --git a/t/t4102-apply-rename.sh b/t/t4102-apply-rename.sh index 22da6a00cc..b4662b0364 100755 --- a/t/t4102-apply-rename.sh +++ b/t/t4102-apply-rename.sh @@ -31,7 +31,7 @@ test_expect_success setup \ test_expect_success apply \ 'git-apply --index --stat --summary --apply test-patch' -if [ "$(git repo-config --get core.filemode)" = false ] +if [ "$(git config --get core.filemode)" = false ] then say 'filemode disabled on the filesystem' else diff --git a/t/t5301-sliding-window.sh b/t/t5301-sliding-window.sh index 5a7232a577..a6dbb04a86 100755 --- a/t/t5301-sliding-window.sh +++ b/t/t5301-sliding-window.sh @@ -30,19 +30,19 @@ test_expect_success \ test_expect_success \ 'verify-pack -v, packedGitWindowSize == 1 page' \ - 'git-repo-config core.packedGitWindowSize 512 && + 'git-config core.packedGitWindowSize 512 && git-verify-pack -v "$pack1"' test_expect_success \ 'verify-pack -v, packedGit{WindowSize,Limit} == 1 page' \ - 'git-repo-config core.packedGitWindowSize 512 && - git-repo-config core.packedGitLimit 512 && + 'git-config core.packedGitWindowSize 512 && + git-config core.packedGitLimit 512 && git-verify-pack -v "$pack1"' test_expect_success \ 'repack -a -d, packedGit{WindowSize,Limit} == 1 page' \ - 'git-repo-config core.packedGitWindowSize 512 && - git-repo-config core.packedGitLimit 512 && + 'git-config core.packedGitWindowSize 512 && + git-config core.packedGitLimit 512 && commit2=`git-commit-tree $tree -p $commit1 > log2.txt && - git repo-config transfer.unpacklimit 0 + git config transfer.unpacklimit 0 ) add A1 diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh index 3ce9446210..50c64856f0 100755 --- a/t/t5510-fetch.sh +++ b/t/t5510-fetch.sh @@ -22,14 +22,14 @@ test_expect_success "clone and setup child repos" ' cd .. && git clone . two && cd two && - git repo-config branch.master.remote one && - git repo-config remote.one.url ../one/.git/ && - git repo-config remote.one.fetch refs/heads/master:refs/heads/one && + git config branch.master.remote one && + git config remote.one.url ../one/.git/ && + git config remote.one.fetch refs/heads/master:refs/heads/one && cd .. && git clone . three && cd three && - git repo-config branch.master.remote two && - git repo-config branch.master.merge refs/heads/one && + git config branch.master.remote two && + git config branch.master.merge refs/heads/one && mkdir -p .git/remotes && { echo "URL: ../two/.git/" diff --git a/t/t6200-fmt-merge-msg.sh b/t/t6200-fmt-merge-msg.sh index 63e49f310c..ea14023616 100755 --- a/t/t6200-fmt-merge-msg.sh +++ b/t/t6200-fmt-merge-msg.sh @@ -108,7 +108,7 @@ EOF test_expect_success 'merge-msg test #3' ' - git repo-config merge.summary true && + git config merge.summary true && git checkout master && setdate && @@ -138,7 +138,7 @@ EOF test_expect_success 'merge-msg test #4' ' - git repo-config merge.summary true && + git config merge.summary true && git checkout master && setdate && @@ -150,7 +150,7 @@ test_expect_success 'merge-msg test #4' ' test_expect_success 'merge-msg test #5' ' - git repo-config merge.summary yes && + git config merge.summary yes && git checkout master && setdate && -- cgit v1.2.3 From df391b192d285646fe80ca4d3cfe3c0a3beb5989 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 28 Jan 2007 16:33:58 -0800 Subject: git-fsck-objects is now synonym to git-fsck Signed-off-by: Junio C Hamano --- t/t1410-reflog.sh | 2 +- t/t5500-fetch-pack.sh | 6 +++--- t/t5710-info-alternate.sh | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 't') diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh index 47d124732c..e5bbc384f7 100755 --- a/t/t1410-reflog.sh +++ b/t/t1410-reflog.sh @@ -20,7 +20,7 @@ check_have () { } check_fsck () { - output=$(git fsck-objects --full) + output=$(git fsck --full) case "$1" in '') test -z "$output" ;; diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh index e35d60fa3a..48e3d1705f 100755 --- a/t/t5500-fetch-pack.sh +++ b/t/t5500-fetch-pack.sh @@ -63,13 +63,13 @@ pull_to_client () { case "$heads" in *B*) echo $BTIP > .git/refs/heads/B;; esac git-symbolic-ref HEAD refs/heads/`echo $heads | sed -e 's/^\(.\).*$/\1/'` - test_expect_success "fsck" 'git-fsck-objects --full > fsck.txt 2>&1' + test_expect_success "fsck" 'git-fsck --full > fsck.txt 2>&1' test_expect_success 'check downloaded results' \ 'mv .git/objects/pack/pack-* . && p=`ls -1 pack-*.pack` && git-unpack-objects <$p && - git-fsck-objects --full' + git-fsck --full' test_expect_success "new object count after $number pull" \ 'idx=`echo pack-*.idx` && @@ -145,7 +145,7 @@ test_expect_success "clone shallow object count (part 2)" ' ' test_expect_success "fsck in shallow repo" \ - "(cd shallow; git-fsck-objects --full)" + "(cd shallow; git-fsck --full)" #test_done; exit diff --git a/t/t5710-info-alternate.sh b/t/t5710-info-alternate.sh index b9f6d96363..2f8e97cb7e 100755 --- a/t/t5710-info-alternate.sh +++ b/t/t5710-info-alternate.sh @@ -17,7 +17,7 @@ reachable_via() { } test_valid_repo() { - git fsck-objects --full > fsck.log && + git fsck --full > fsck.log && test `wc -l < fsck.log` = 0 } -- cgit v1.2.3