test whitespace - perform trivial whitespace clean ups of test scripts.
cover test whitespace - perform trivial whitespace clean ups of test scripts.
The series applies cleanly to both master and pu.
The first patch contains a script, t/test-cleaner.sh, that can automate whitespace cleanup of tests. The remaining patches are the result of running the example.
For example:
cd t ./test-cleaner.sh fix-whitespace-auto t[0-9]*.sh
will:
* identify test scripts with trivial white space errors
* edit the test to remove the trivial white space errors
* verify that edited test produces same outputs, errors and exit code
* creates a single commit for the edited test
fix-whitespace-manual will do the same for tests that are broken by the edit.
In this case, the commit message is prefixed with FAILED:
These scripts rely on the existence of expand and unexpand on the PATH.
Jon Seymour (40):
test-cleaner: automate whitespace cleaning of test scripts
whitespace: remediate t1001-read-tree-m-2way.sh
whitespace: remediate t1006-cat-file.sh
whitespace: remediate t1300-repo-config.sh
whitespace: remediate t1503-rev-parse-verify.sh
whitespace: remediate t3040-subprojects-basic.sh
whitespace: remediate t3200-branch.sh
whitespace: remediate t3406-rebase-message.sh
whitespace: remediate t4002-diff-basic.sh
whitespace: remediate t4010-diff-pathspec.sh
whitespace: remediate t5300-pack-object.sh
whitespace: remediate t5301-sliding-window.sh
whitespace: remediate t5302-pack-index.sh
whitespace: remediate t5303-pack-corruption-resilience.sh
whitespace: remediate t5400-send-pack.sh
whitespace: remediate t5402-post-merge-hook.sh
whitespace: remediate t5403-post-checkout-hook.sh
whitespace: remediate t5510-fetch.sh
whitespace: remediate t6002-rev-list-bisect.sh
whitespace: remediate t6005-rev-list-count.sh
whitespace: remediate t6030-bisect-porcelain.sh
whitespace: remediate t7003-filter-branch.sh
whitespace: remediate t7004-tag.sh
whitespace: remediate t7403-submodule-sync.sh
whitespace: remediate t7500-commit.sh
whitespace: remediate t7810-grep.sh
whitespace: remediate t9100-git-svn-basic.sh
whitespace: remediate t9104-git-svn-follow-parent.sh
whitespace: remediate t9107-git-svn-migrate.sh
whitespace: remediate t9108-git-svn-glob.sh
whitespace: remediate t9109-git-svn-multi-glob.sh
whitespace: remediate t9110-git-svn-use-svm-props.sh
whitespace: remediate t9118-git-svn-funky-branch-names.sh
whitespace: remediate t9125-git-svn-multi-glob-branch-names.sh
whitespace: remediate t9400-git-cvsserver-server.sh
whitespace: remediate t9401-git-cvsserver-crlf.sh
whitespace: remediate t9500-gitweb-standalone-no-errors.sh
whitespace: remediate t9603-cvsimport-patchsets.sh
whitespace: remediate t1000-read-tree-m-3way.sh
whitespace: remediate t6120-describe.sh
t/t1000-read-tree-m-3way.sh | 12 +- t/t1001-read-tree-m-2way.sh | 10 +- t/t1006-cat-file.sh | 26 ++-- t/t1300-repo-config.sh | 2 +- t/t1503-rev-parse-verify.sh | 10 +- t/t3040-subprojects-basic.sh | 2 +- t/t3200-branch.sh | 30 +++--- t/t3406-rebase-message.sh | 16 ++-- t/t4002-diff-basic.sh | 4 +- t/t4010-diff-pathspec.sh | 4 +- t/t5300-pack-object.sh | 6 +- t/t5301-sliding-window.sh | 6 +- t/t5302-pack-index.sh | 34 +++--- t/t5303-pack-corruption-resilience.sh | 4 +- t/t5400-send-pack.sh | 8 +- t/t5402-post-merge-hook.sh | 12 +- t/t5403-post-checkout-hook.sh | 46 ++++---- t/t5510-fetch.sh | 16 ++-- t/t6002-rev-list-bisect.sh | 2 +- t/t6005-rev-list-count.sh | 6 +- t/t6030-bisect-porcelain.sh | 14 +- t/t6120-describe.sh | 8 +- t/t7003-filter-branch.sh | 2 +- t/t7004-tag.sh | 4 +- t/t7403-submodule-sync.sh | 2 +- t/t7500-commit.sh | 2 +- t/t7810-grep.sh | 2 +- t/t9100-git-svn-basic.sh | 26 ++-- t/t9104-git-svn-follow-parent.sh | 88 +++++++------- t/t9107-git-svn-migrate.sh | 14 +- t/t9108-git-svn-glob.sh | 16 ++-- t/t9109-git-svn-multi-glob.sh | 20 ++-- t/t9110-git-svn-use-svm-props.sh | 4 +- t/t9118-git-svn-funky-branch-names.sh | 6 +- t/t9125-git-svn-multi-glob-branch-names.sh | 6 +- t/t9400-git-cvsserver-server.sh | 6 +- t/t9401-git-cvsserver-crlf.sh | 12 +- t/t9500-gitweb-standalone-no-errors.sh | 4 +- t/t9603-cvsimport-patchsets.sh | 6 +- t/test-cleaner.sh | 185 ++++++++++++++++++++++++++++ 40 files changed, 434 insertions(+), 249 deletions(-) create mode 100755 t/test-cleaner.sh
Signature · 1 line
1.7.6.362.gf0e6
PATCH 1/40 test-cleaner: automate whitespace cleaning of test scripts
This script allows the automated cleaning of test scripts.
Any whitespace fixups of a test script that do not effect the exit status or output of the test are assumed to be safe and are automatically committed.
To check the tests for whitespace issues, change into git's test directory and run:
test-cleaner.sh check-whitespace t*.sh
This will:
* write one line of the form:
AUTO<tab><filename>
for each file that can be fixed automatically.
* write one line of the form:
MANUAL<tab><filename>
for each file that will require manual intervention to fix.
To fix all the automatically correctable errors, run:
./test-cleaner.sh fix-whitespace-auto t[0-9]*.sh
To generate commits for all the errors that require manual correction, run:
./test-cleaner.sh fix-whitespace-manual t[0-9]*.sh
To clean a file without running tests or generating commits, run:
./test-cleaner.sh clean-whitespace foobar.sh
clean-whitespace can be used with files that are not tests.
If no arguments are supplied, file arguments are read from stdin.
The filter itself can be run with:
./test-cleaner.sh whitespace-filter < file > some-other-file
The resulting series of commits should rebased on both the git master and pu branches. Commits that cause merge conflicts should be purged from the series.
--- t/test-cleaner.sh | 185 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 185 insertions(+), 0 deletions(-) create mode 100755 t/test-cleaner.sh
t/test-cleaner.sh new file +185 -0
@@ -0,0 +1,185 @@ +#!/bin/sh + +USAGE="test-cleaner.sh + check-whitespace [<test-file> ...] - report on test files that need cleaning + fix_whitespace [<test-file> ...] - generate commits for files that need white space cleaning + fix-whitespace-auto [<test-file> ...] - generate commits for files that can be automatically cleaned + fix-whitespace-manual [<test-file> ...] - generate commits for files that need manual cleaning + clean-whitespace [<file> ...] - applying the cleaner to the specified file without running tests or generating commits +" +SUBDIRECTORY_OK=t +. "$(git --exec-path)/git-sh-setup" +require_clean_work_tree + +cleaner() +{ + expand -i | unexpand --first-only | sed "s/ *\$//" +} + +clean_whitespace() +{ + rc=0 + list_files "$@" | while read file + do + cleaner <"$file" >$$.tmp && + cat $$.tmp >"$file" || rc=1 + rm -f $$.tmp + test $rc = 0 + done || exit $? +} + +list_files() +{ + if test $# -gt 0 + then + for arg in "$@"; do + echo $arg + done + else + cat + fi +} + +fix_whitespace_auto() +{ + check_whitespace "$@" 2>/dev/null | grep "^AUTO" | fix_whitespace +} + +fix_whitespace_auto() +{ + check_whitespace "$@" 2>/dev/null | grep "^MANUAL" | fix_whitespace +} + +fix_whitespace() +{ + rc=0 + check_whitespace "$@" 2>/dev/null | while read status file + do + case "$status" in + AUTO) + if clean_whitespace "$file" && + git diff --exit-code -w -- "$file" >/dev/null + git add "$file" && + git diff --exit-code -w HEAD -- "$file" >/dev/null + then + git commit -F - 1>&2 <<EOF +whitespace: remediate $file + +This file was edited by applying: + + expand -i | unexpand --first-only | sed "s/ *\$//" + +to the file. + +No change to test outputs or status code was observed. + +Signed-off-by: $(git config user.name) <$(git config user.email)> +EOF + echo "$status $file" + else + rc=1 + fi + rm -f $$.tmp + ;; + MANUAL) + CLEANER_PREFIX=fixer. + check_whitespace "$file" >/dev/null 2>$$.err + if clean_whitespace "$file" && + git diff --exit-code -w -- "$file" >/dev/null + git add "$file" && + git diff --exit-code -w HEAD -- "$file" >/dev/null + then + git commit -F - 1>&2 <<EOF +FAILED: whitespace: remediate $file + +This file was edited by applying: + + expand -i | unexpand --first-only | sed "s/ *\$//" + +to the file. + +The following errors were observed: + +$(cat $$.err | sed "s/^/ /") + +These errors should be fixed before submitting this patch upstream. + +Signed-off-by: $(git config user.name) <$(git config user.email)> +EOF + echo "$status $file" + else + rc=1 + fi + rm -f $$.tmp $$.err + ;; + *) + die "fix-whitespace failed on $file with unexpected output" + ;; + esac + test "$rc" = 0 + done || rc=$? + test "$rc" = 0 +} + +check_whitespace() +{ + list_files "$@" | while read file + do + cleaner <"$file" >$$.${CLEANER_PREFIX}edited && + cmp "$file" $$.${CLEANER_PREFIX}edited 1>/dev/null + rc=$? + if test $rc != 0 + then + sh $file >$$.${CLEANER_PREFIX}before.output 2>$$.${CLEANER_PREFIX}before.error </dev/null + echo $? > $$.${CLEANER_PREFIX}before.exit + sh ./$$.${CLEANER_PREFIX}edited >$$.${CLEANER_PREFIX}after.output 2>$$.${CLEANER_PREFIX}after.error </dev/null + echo $? > $$.${CLEANER_PREFIX}after.exit + + if cmp $$.${CLEANER_PREFIX}before.output $$.${CLEANER_PREFIX}after.output 1>/dev/null && + cmp $$.${CLEANER_PREFIX}before.error $$.${CLEANER_PREFIX}after.error 1>/dev/null && + cmp $$.${CLEANER_PREFIX}before.exit $$.${CLEANER_PREFIX}after.exit 1>/dev/null + then + echo "AUTO $file" + else + echo "MANUAL $file" + diff -u $$.${CLEANER_PREFIX}before.output $$.${CLEANER_PREFIX}after.output 1>&2 + diff -u $$.${CLEANER_PREFIX}before.error $$.${CLEANER_PREFIX}after.error 1>&2 + diff -u $$.${CLEANER_PREFIX}before.exit $$.${CLEANER_PREFIX}after.exit 1>&2 + fi + looprc=1 + fi + rm -f $$.${CLEANER_PREFIX}edited $$.${CLEANER_PREFIX}after.* $$.${CLEANER_PREFIX}before.* + test "$looprc" = 0 + done +} + +case $# in +0) + usage ;; +*) + cmd=$1 + shift + case "$cmd" in + check-whitespace) + check_whitespace "$@" + ;; + fix-whitespace) + fix_whitespace "$@" + ;; + fix-whitespace-auto) + fix_whitespace_auto "$@" + ;; + fix-whitespace-manual) + fix_whitespace_manual "$@" + ;; + clean-whitespace) + clean_whitespace "$@" + ;; + whitespace-filter) + cleaner + ;; + *) + usage + ;; + esac +esac
Signature · 1 line
1.7.6.362.gf0e6
PATCH 2/40 whitespace: remediate t1001-read-tree-m-2way.sh
This file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t1001-read-tree-m-2way.sh | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
t/t1001-read-tree-m-2way.sh +5 -5
@@ -14,11 +14,11 @@ all the combinations described in the two-tree merge "carry forward" rules, found in <Documentation/git read-tree.txt>. In the test, these paths are used: - bozbar - in H, stays in M, modified from bozbar to gnusto - frotz - not in H added in M - nitfol - in H, stays in M unmodified - rezrov - in H, deleted in M - yomin - not in H nor M + bozbar - in H, stays in M, modified from bozbar to gnusto + frotz - not in H added in M + nitfol - in H, stays in M unmodified + rezrov - in H, deleted in M + yomin - not in H nor M ' . ./test-lib.sh . "$TEST_DIRECTORY"/lib-read-tree.sh
Signature · 1 line
1.7.6.362.gf0e6
PATCH 3/40 whitespace: remediate t1006-cat-file.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t1006-cat-file.sh | 26 +++++++++++++------------- 1 files changed, 13 insertions(+), 13 deletions(-)
t/t1006-cat-file.sh +13 -13
@@ -14,7 +14,7 @@ strlen () { maybe_remove_timestamp () { if test -z "$2"; then - echo_without_newline "$1" + echo_without_newline "$1" else echo_without_newline "$(printf '%s\n' "$1" | sed -e 's/ [0-9][0-9]* [-+][0-9][0-9][0-9][0-9]$//')" fi
@@ -36,11 +36,11 @@ $content" ' test_expect_success "Type of $type is correct" ' - test $type = "$(git cat-file -t $sha1)" + test $type = "$(git cat-file -t $sha1)" ' test_expect_success "Size of $type is correct" ' - test $size = "$(git cat-file -s $sha1)" + test $size = "$(git cat-file -s $sha1)" ' test -z "$content" ||
@@ -48,54 +48,54 @@ $content" expect="$(maybe_remove_timestamp "$content" $no_ts)" actual="$(maybe_remove_timestamp "$(git cat-file $type $sha1)" $no_ts)" - if test "z$expect" = "z$actual" + if test "z$expect" = "z$actual" then : happy else echo "Oops: expected $expect" echo "but got $actual" false - fi + fi ' test_expect_success "Pretty content of $type is correct" ' expect="$(maybe_remove_timestamp "$pretty_content" $no_ts)" actual="$(maybe_remove_timestamp "$(git cat-file -p $sha1)" $no_ts)" - if test "z$expect" = "z$actual" + if test "z$expect" = "z$actual" then : happy else echo "Oops: expected $expect" echo "but got $actual" false - fi + fi ' test -z "$content" || test_expect_success "--batch output of $type is correct" ' expect="$(maybe_remove_timestamp "$batch_output" $no_ts)" actual="$(maybe_remove_timestamp "$(echo $sha1 | git cat-file --batch)" $no_ts)" - if test "z$expect" = "z$actual" + if test "z$expect" = "z$actual" then : happy else echo "Oops: expected $expect" echo "but got $actual" false - fi + fi ' test_expect_success "--batch-check output of $type is correct" ' expect="$sha1 $type $size" actual="$(echo_without_newline $sha1 | git cat-file --batch-check)" - if test "z$expect" = "z$actual" + if test "z$expect" = "z$actual" then : happy else echo "Oops: expected $expect" echo "but got $actual" false - fi + fi ' }
@@ -184,7 +184,7 @@ test_expect_success "--batch-check for a non-existent hash" ' test "0000000000000000000000000000000000000042 missing 0000000000000000000000000000000000000084 missing" = \ "$( ( echo 0000000000000000000000000000000000000042; - echo_without_newline 0000000000000000000000000000000000000084; ) \ + echo_without_newline 0000000000000000000000000000000000000084; ) \ | git cat-file --batch-check)" '
@@ -193,7 +193,7 @@ test_expect_success "--batch for an existent and a non-existent hash" ' $tag_content 0000000000000000000000000000000000000000 missing" = \ "$( ( echo $tag_sha1; - echo_without_newline 0000000000000000000000000000000000000000; ) \ + echo_without_newline 0000000000000000000000000000000000000000; ) \ | git cat-file --batch)" '
Signature · 1 line
1.7.6.362.gf0e6
Re: [PATCH 03/40] whitespace: remediate t1006-cat-file.sh
t/t1006-cat-file.sh strlen () { · line 17
Quoted 10 lines · Jon Seymour
t/t1006-cat-file.sh +1
-1@@ -14,7 +14,7 @@ strlen () { maybe_remove_timestamp () { if test -z "$2"; then - echo_without_newline "$1" + echo_without_newline "$1"
Yes, this indent with spaces violates our coding style policy. However, the 4-space indentation does, too (and the space between function name and parentheses). The "right" way is according to our policy is:
maybe_remove_timestamp() {
if test -z "$2"; then
echo_without_newline "$1"So I have to wonder if this automated indentation is really worthwhile. The result still doesn't meet our whitespace criteria (and I am slightly dubious that it is possible to write an accurate general-purpose indenter for shell code).
I suppose you could argue that even taking it partway towards right is better than nothing. But I get the feeling that nobody is really looking at this code; if they were, they would fix the style while they were there. And if not, then who cares if it's 10% right or 30% right?
I dunno. I'm not against a one-time cleanup, but I think making the cleanup script a part of the repo is kind of silly. Between git's whitespace warnings (which I suspect post-date most of these changes) and code review (which we need to catch non-automated style violations, in addition to regular bugs, of course), it seems like we already have a better solution in place. It's just that nobody has bothered to clean up the old code.
-Peff
Re: [PATCH 03/40] whitespace: remediate t1006-cat-file.sh
Quoted 7 lines · Jeff King
Yes, this indent with spaces violates our coding style policy. However, the 4-space indentation does, too (and the space between function name and parentheses). The "right" way is according to our policy is:
maybe_remove_timestamp() { if test -z "$2"; then echo_without_newline "$1"
Hmm, I have always thought that our shell scripts preferred the above to be spelled this way instead:
maybe_remove_timestamp () {
if test -z "$2"
then
echo_without_newline "$1"Quoted 1 line
So I have to wonder if this automated indentation is really worthwhile.
That I agree with.
Quoted 1 line
I dunno. I'm not against a one-time cleanup,...
I actually am slightly against it. One-time whole-tree clean-up can never happen without downside as _some_ parts of the tree always have patches to conflict with it in flight. One-time decision to clearly spell out the rules and cleaning the tree over time, fixing parts that are not actively touched one at a time, is probably feasible, though.
Re: [PATCH 03/40] whitespace: remediate t1006-cat-file.sh
Quoted 8 lines · Junio C Hamano
Jeff King <[email protected]> writes:
I actually am slightly against it. One-time whole-tree clean-up can never happen without downside as _some_ parts of the tree always have patches to conflict with it in flight. One-time decision to clearly spell out the rules and cleaning the tree over time, fixing parts that are not actively touched one at a time, is probably feasible, though.
I certainly agree that whole tree cleanup is disruptive when there is a lot of other stuff going on since it causes lots of merge conflicts. In my day job, I sometimes have to defer otherwise sensible refactorings because of the carnage they would cause for the daily integration.
That's what I think is nice about having an easy way to automate the cleanup+test, especially if it can be applied to arbitrary refactorings. Having earlier invested the effort in creating some refactoring heuristic, you can later easily apply the heuristic completely and consistently to a file as part of some other maintenance activity.
jon.
Re: [PATCH 03/40] whitespace: remediate t1006-cat-file.sh
In reply to Jeff KingQuoted 8 lines · Jeff King
Quoted 6 lines · Jon Seymour
t/t1006-cat-file.sh +0
-0@@ -14,7 +14,7 @@ strlen () {
Quoted 9 lines
Quoted 4 lines
t/t1006-cat-file.sh +0
-0maybe_remove_timestamp () {if test -z "$2"; then
- echo_without_newline "$1"
+echo_without_newline"$1"Yes, this indent with spaces violates our coding style policy. However, the 4-space indentation does, too (and the space between function name and parentheses). The "right" way is according to our policy is:
Sure, but I not claiming the fix up is complete.
Quoted 8 lines
maybe_remove_timestamp() {
if test -z "$2"; then
echo_without_newline "$1"So I have to wonder if this automated indentation is really worthwhile. The result still doesn't meet our whitespace criteria (and I am slightly dubious that it is possible to write an accurate general-purpose indenter for shell code).
Or that complete automation is possible...
Quoted 6 lines
I suppose you could argue that even taking it partway towards right is better than nothing. But I get the feeling that nobody is really looking at this code; if they were, they would fix the style while they were there. And if not, then who cares if it's 10% right or 30% right?
Quoted 7 lines
I dunno. I'm not against a one-time cleanup, but I think making the cleanup script a part of the repo is kind of silly. Between git's whitespace warnings (which I suspect post-date most of these changes) and code review (which we need to catch non-automated style violations, in addition to regular bugs, of course), it seems like we already have a better solution in place. It's just that nobody has bothered to clean up the old code.
Well, the battle against white space errors in an ongoing one. This is just one more tool that might help.
As mentioned elsewhere, It would be more useful, I think to generalise test-cleaner so that it could be used with files other than just tests and, indeed, for edits other than just whitespace cleanup.
I think there is value is ensuring that the slavish application of an automated cleanup doesn't introduce test breaks.
jon.
PATCH 4/40 whitespace: remediate t1300-repo-config.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t1300-repo-config.sh | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
t/t1300-repo-config.sh +1 -1
@@ -588,7 +588,7 @@ test_expect_success bool ' do git config --bool --get bool.true$i >>result git config --bool --get bool.false$i >>result - done && + done && cmp expect result' test_expect_success 'invalid bool (--get)' '
Signature · 1 line
1.7.6.362.gf0e6
PATCH 5/40 whitespace: remediate t1503-rev-parse-verify.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t1503-rev-parse-verify.sh | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
t/t1503-rev-parse-verify.sh +5 -5
@@ -14,12 +14,12 @@ add_line_into_file() _file=$2 if [ -f "$_file" ]; then - echo "$_line" >> $_file || return $? - MSG="Add <$_line> into <$_file>." + echo "$_line" >> $_file || return $? + MSG="Add <$_line> into <$_file>." else - echo "$_line" > $_file || return $? - git add $_file || return $? - MSG="Create file <$_file> with <$_line> inside." + echo "$_line" > $_file || return $? + git add $_file || return $? + MSG="Create file <$_file> with <$_line> inside." fi test_tick
Signature · 1 line
1.7.6.362.gf0e6
PATCH 6/40 whitespace: remediate t3040-subprojects-basic.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t3040-subprojects-basic.sh | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
t/t3040-subprojects-basic.sh +1 -1
@@ -36,7 +36,7 @@ test_expect_success 'check if commit in a subproject detected' \ echo "all:" >>Makefile && echo " true" >>Makefile && git commit -q -a -m "make all" ) && { - git diff-files --exit-code + git diff-files --exit-code test $? = 1 }'
Signature · 1 line
1.7.6.362.gf0e6
PATCH 7/40 whitespace: remediate t3200-branch.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t3200-branch.sh | 30 +++++++++++++++--------------- 1 files changed, 15 insertions(+), 15 deletions(-)
t/t3200-branch.sh +15 -15
@@ -65,30 +65,30 @@ test_expect_success \ test_expect_success \ 'git branch j/k should work after branch j has been deleted' \ 'git branch j && - git branch -d j && - git branch j/k' + git branch -d j && + git branch j/k' test_expect_success \ 'git branch l should work after branch l/m has been deleted' \ 'git branch l/m && - git branch -d l/m && - git branch l' + git branch -d l/m && + git branch l' test_expect_success \ 'git branch -m m m/m should work' \ 'git branch -l m && - git branch -m m m/m && - test -f .git/logs/refs/heads/m/m' + git branch -m m m/m && + test -f .git/logs/refs/heads/m/m' test_expect_success \ 'git branch -m n/n n should work' \ 'git branch -l n/n && - git branch -m n/n n - test -f .git/logs/refs/heads/n' + git branch -m n/n n + test -f .git/logs/refs/heads/n' test_expect_success 'git branch -m o/o o should fail when o/p exists' ' git branch o/o && - git branch o/p && + git branch o/p && test_must_fail git branch -m o/o o '
@@ -112,12 +112,12 @@ git config branch.s/s.dummy Hello test_expect_success \ 'git branch -m s/s s should work when s/t is deleted' \ 'git branch -l s/s && - test -f .git/logs/refs/heads/s/s && - git branch -l s/t && - test -f .git/logs/refs/heads/s/t && - git branch -d s/t && - git branch -m s/s s && - test -f .git/logs/refs/heads/s' + test -f .git/logs/refs/heads/s/s && + git branch -l s/t && + test -f .git/logs/refs/heads/s/t && + git branch -d s/t && + git branch -m s/s s && + test -f .git/logs/refs/heads/s' test_expect_success 'config information was renamed, too' \ "test $(git config branch.s.dummy) = Hello &&
Signature · 1 line
1.7.6.362.gf0e6
PATCH 8/40 whitespace: remediate t3406-rebase-message.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t3406-rebase-message.sh | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-)
t/t3406-rebase-message.sh +8 -8
@@ -44,22 +44,22 @@ test_expect_success 'rebase -m' ' test_expect_success 'rebase --stat' ' git reset --hard start && - git rebase --stat master >diffstat.txt && - grep "^ fileX | *1 +$" diffstat.txt + git rebase --stat master >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 && - grep "^ fileX | *1 +$" diffstat.txt + git config rebase.stat true && + git rebase master >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 && - ! grep "^ fileX | *1 +$" diffstat.txt + git config rebase.stat true && + git rebase -n master >diffstat.txt && + ! grep "^ fileX | *1 +$" diffstat.txt ' test_done
Signature · 1 line
1.7.6.362.gf0e6
PATCH 9/40 whitespace: remediate t4002-diff-basic.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t4002-diff-basic.sh | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
t/t4002-diff-basic.sh +2 -2
@@ -258,9 +258,9 @@ test_expect_success \ test_expect_success \ 'diff can read from stdin' \ 'test_must_fail git diff --no-index -- MN - < NN | - grep -v "^index" | sed "s#/-#/NN#" >.test-a && + grep -v "^index" | sed "s#/-#/NN#" >.test-a && test_must_fail git diff --no-index -- MN NN | - grep -v "^index" >.test-b && + grep -v "^index" >.test-b && test_cmp .test-a .test-b' test_done
Signature · 1 line
1.7.6.362.gf0e6
PATCH 10/40 whitespace: remediate t4010-diff-pathspec.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t4010-diff-pathspec.sh | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
t/t4010-diff-pathspec.sh +2 -2
@@ -6,8 +6,8 @@ test_description='Pathspec restrictions Prepare: - file0 - path1/file1 + file0 + path1/file1 ' . ./test-lib.sh . "$TEST_DIRECTORY"/diff-lib.sh ;# test-lib chdir's into trash
Signature · 1 line
1.7.6.362.gf0e6
PATCH 11/40 whitespace: remediate t5300-pack-object.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t5300-pack-object.sh | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
t/t5300-pack-object.sh +3 -3
@@ -57,7 +57,7 @@ test_expect_success \ '(cd ../.git && find objects -type f -print) | while read path do - cmp $path ../.git/$path || { + cmp $path ../.git/$path || { echo $path differs. return 1 }
@@ -87,7 +87,7 @@ test_expect_success \ '(cd ../.git && find objects -type f -print) | while read path do - cmp $path ../.git/$path || { + cmp $path ../.git/$path || { echo $path differs. return 1 }
@@ -117,7 +117,7 @@ test_expect_success \ '(cd ../.git && find objects -type f -print) | while read path do - cmp $path ../.git/$path || { + cmp $path ../.git/$path || { echo $path differs. return 1 }
Signature · 1 line
1.7.6.362.gf0e6
PATCH 12/40 whitespace: remediate t5301-sliding-window.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t5301-sliding-window.sh | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
t/t5301-sliding-window.sh +3 -3
@@ -11,9 +11,9 @@ test_expect_success \ 'rm -f .git/index* && for i in a b c do - echo $i >$i && - test-genrandom "$i" 32768 >>$i && - git update-index --add $i || return 1 + echo $i >$i && + test-genrandom "$i" 32768 >>$i && + git update-index --add $i || return 1 done && echo d >d && cat c >>d && git update-index --add d && tree=`git write-tree` &&
Signature · 1 line
1.7.6.362.gf0e6
PATCH 13/40 whitespace: remediate t5302-pack-index.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t5302-pack-index.sh | 34 +++++++++++++++++----------------- 1 files changed, 17 insertions(+), 17 deletions(-)
t/t5302-pack-index.sh +17 -17
@@ -14,16 +14,16 @@ test_expect_success \ i=1 && while test $i -le 100 do - iii=`printf '%03i' $i` - test-genrandom "bar" 200 > wide_delta_$iii && - test-genrandom "baz $iii" 50 >> wide_delta_$iii && - test-genrandom "foo"$i 100 > deep_delta_$iii && - test-genrandom "foo"`expr $i + 1` 100 >> deep_delta_$iii && - test-genrandom "foo"`expr $i + 2` 100 >> deep_delta_$iii && - echo $iii >file_$iii && - test-genrandom "$iii" 8192 >>file_$iii && - git update-index --add file_$iii deep_delta_$iii wide_delta_$iii && - i=`expr $i + 1` || return 1 + iii=`printf '%03i' $i` + test-genrandom "bar" 200 > wide_delta_$iii && + test-genrandom "baz $iii" 50 >> wide_delta_$iii && + test-genrandom "foo"$i 100 > deep_delta_$iii && + test-genrandom "foo"`expr $i + 1` 100 >> deep_delta_$iii && + test-genrandom "foo"`expr $i + 2` 100 >> deep_delta_$iii && + echo $iii >file_$iii && + test-genrandom "$iii" 8192 >>file_$iii && + git update-index --add file_$iii deep_delta_$iii wide_delta_$iii && + i=`expr $i + 1` || return 1 done && { echo 101 && test-genrandom 100 8192; } >file_101 && git update-index --add file_101 &&
@@ -154,9 +154,9 @@ test_expect_success \ nr_099=`index_obj_nr 1.idx $sha1_099` && chmod +w ".git/objects/pack/pack-${pack1}.pack" && dd of=".git/objects/pack/pack-${pack1}.pack" seek=$(($offs_101 + 1)) \ - if=".git/objects/pack/pack-${pack1}.idx" \ - skip=$((4 + 256 * 4 + $nr_099 * 24)) \ - bs=1 count=20 conv=notrunc && + if=".git/objects/pack/pack-${pack1}.idx" \ + skip=$((4 + 256 * 4 + $nr_099 * 24)) \ + bs=1 count=20 conv=notrunc && git cat-file blob $sha1_101 > file_101_foo1' test_expect_success \
@@ -195,9 +195,9 @@ test_expect_success \ nr_099=`index_obj_nr 1.idx $sha1_099` && chmod +w ".git/objects/pack/pack-${pack1}.pack" && dd of=".git/objects/pack/pack-${pack1}.pack" seek=$(($offs_101 + 1)) \ - if=".git/objects/pack/pack-${pack1}.idx" \ - skip=$((8 + 256 * 4 + $nr_099 * 20)) \ - bs=1 count=20 conv=notrunc && + if=".git/objects/pack/pack-${pack1}.idx" \ + skip=$((8 + 256 * 4 + $nr_099 * 20)) \ + bs=1 count=20 conv=notrunc && git cat-file blob $sha1_101 > file_101_foo2' test_expect_success \
@@ -222,7 +222,7 @@ test_expect_success \ nr=`index_obj_nr ".git/objects/pack/pack-${pack1}.idx" $obj` && chmod +w ".git/objects/pack/pack-${pack1}.idx" && printf xxxx | dd of=".git/objects/pack/pack-${pack1}.idx" conv=notrunc \ - bs=1 count=4 seek=$((8 + 256 * 4 + `wc -l <obj-list` * 20 + $nr * 4)) && + bs=1 count=4 seek=$((8 + 256 * 4 + `wc -l <obj-list` * 20 + $nr * 4)) && ( while read obj do git cat-file -p $obj >/dev/null || exit 1 done <obj-list ) &&
Signature · 1 line
1.7.6.362.gf0e6
PATCH 14/40 whitespace: remediate t5303-pack-corruption-resilience.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t5303-pack-corruption-resilience.sh | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
t/t5303-pack-corruption-resilience.sh +2 -2
@@ -36,14 +36,14 @@ create_new_pack() { blob_2=`git hash-object -t blob -w file_2` && blob_3=`git hash-object -t blob -w file_3` && pack=`printf "$blob_1\n$blob_2\n$blob_3\n" | - git pack-objects $@ .git/objects/pack/pack` && + git pack-objects $@ .git/objects/pack/pack` && pack=".git/objects/pack/pack-${pack}" && git verify-pack -v ${pack}.pack } do_repack() { pack=`printf "$blob_1\n$blob_2\n$blob_3\n" | - git pack-objects $@ .git/objects/pack/pack` && + git pack-objects $@ .git/objects/pack/pack` && pack=".git/objects/pack/pack-${pack}" }
Signature · 1 line
1.7.6.362.gf0e6
PATCH 15/40 whitespace: remediate t5400-send-pack.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t5400-send-pack.sh | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
t/t5400-send-pack.sh +4 -4
@@ -77,7 +77,7 @@ test_expect_success 'refuse pushing rewound head without --force' ' ' test_expect_success \ - 'push can be used to delete a ref' ' + 'push can be used to delete a ref' ' ( cd victim && git branch extra master ) && git send-pack ./victim :extra master && ( cd victim &&
@@ -187,7 +187,7 @@ test_expect_success 'pushing explicit refspecs respects forcing' ' ( cd child && git send-pack ../parent \ - +refs/heads/master:refs/heads/master + +refs/heads/master:refs/heads/master ) && parent_head=$(cd parent && git rev-parse --verify master) && child_head=$(cd child && git rev-parse --verify master) &&
@@ -200,14 +200,14 @@ test_expect_success 'pushing wildcard refspecs respects forcing' ' ( cd child && test_must_fail git send-pack ../parent \ - "refs/heads/*:refs/heads/*" + "refs/heads/*:refs/heads/*" ) && parent_head=$(cd parent && git rev-parse --verify master) && test "$parent_orig" = "$parent_head" && ( cd child && git send-pack ../parent \ - "+refs/heads/*:refs/heads/*" + "+refs/heads/*:refs/heads/*" ) && parent_head=$(cd parent && git rev-parse --verify master) && child_head=$(cd child && git rev-parse --verify master) &&
Signature · 1 line
1.7.6.362.gf0e6
PATCH 16/40 whitespace: remediate t5402-post-merge-hook.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t5402-post-merge-hook.sh | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)
t/t5402-post-merge-hook.sh +6 -6
@@ -15,7 +15,7 @@ test_expect_success setup ' git update-index a && tree1=$(git write-tree) && commit1=$(echo modify | git commit-tree $tree1 -p $commit0) && - git update-ref refs/heads/master $commit0 && + git update-ref refs/heads/master $commit0 && git clone ./. clone1 && GIT_DIR=clone1/.git git update-index --add a && git clone ./. clone2 &&
@@ -31,26 +31,26 @@ EOF done test_expect_success 'post-merge does not run for up-to-date ' ' - GIT_DIR=clone1/.git git merge $commit0 && + GIT_DIR=clone1/.git git merge $commit0 && ! test -f clone1/.git/post-merge.args ' test_expect_success 'post-merge runs as expected ' ' - GIT_DIR=clone1/.git git merge $commit1 && + GIT_DIR=clone1/.git git merge $commit1 && test -e clone1/.git/post-merge.args ' test_expect_success 'post-merge from normal merge receives the right argument ' ' - grep 0 clone1/.git/post-merge.args + grep 0 clone1/.git/post-merge.args ' test_expect_success 'post-merge from squash merge runs as expected ' ' - GIT_DIR=clone2/.git git merge --squash $commit1 && + GIT_DIR=clone2/.git git merge --squash $commit1 && test -e clone2/.git/post-merge.args ' test_expect_success 'post-merge from squash merge receives the right argument ' ' - grep 1 clone2/.git/post-merge.args + grep 1 clone2/.git/post-merge.args ' test_done
Signature · 1 line
1.7.6.362.gf0e6
PATCH 17/40 whitespace: remediate t5403-post-checkout-hook.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t5403-post-checkout-hook.sh | 46 ++++++++++++++++++++-------------------- 1 files changed, 23 insertions(+), 23 deletions(-)
t/t5403-post-checkout-hook.sh +23 -23
@@ -31,44 +31,44 @@ EOF done test_expect_success 'post-checkout runs as expected ' ' - GIT_DIR=clone1/.git git checkout master && - test -e clone1/.git/post-checkout.args + GIT_DIR=clone1/.git git checkout master && + test -e clone1/.git/post-checkout.args ' test_expect_success 'post-checkout receives the right arguments with HEAD unchanged ' ' - old=$(awk "{print \$1}" clone1/.git/post-checkout.args) && - new=$(awk "{print \$2}" clone1/.git/post-checkout.args) && - flag=$(awk "{print \$3}" clone1/.git/post-checkout.args) && - test $old = $new -a $flag = 1 + old=$(awk "{print \$1}" clone1/.git/post-checkout.args) && + new=$(awk "{print \$2}" clone1/.git/post-checkout.args) && + flag=$(awk "{print \$3}" clone1/.git/post-checkout.args) && + test $old = $new -a $flag = 1 ' test_expect_success 'post-checkout runs as expected ' ' - GIT_DIR=clone1/.git git checkout master && - test -e clone1/.git/post-checkout.args + GIT_DIR=clone1/.git git checkout master && + test -e clone1/.git/post-checkout.args ' test_expect_success 'post-checkout args are correct with git checkout -b ' ' - GIT_DIR=clone1/.git git checkout -b new1 && - old=$(awk "{print \$1}" clone1/.git/post-checkout.args) && - new=$(awk "{print \$2}" clone1/.git/post-checkout.args) && - flag=$(awk "{print \$3}" clone1/.git/post-checkout.args) && - test $old = $new -a $flag = 1 + GIT_DIR=clone1/.git git checkout -b new1 && + old=$(awk "{print \$1}" clone1/.git/post-checkout.args) && + new=$(awk "{print \$2}" clone1/.git/post-checkout.args) && + flag=$(awk "{print \$3}" clone1/.git/post-checkout.args) && + test $old = $new -a $flag = 1 ' test_expect_success 'post-checkout receives the right args with HEAD changed ' ' - GIT_DIR=clone2/.git git checkout new2 && - old=$(awk "{print \$1}" clone2/.git/post-checkout.args) && - new=$(awk "{print \$2}" clone2/.git/post-checkout.args) && - flag=$(awk "{print \$3}" clone2/.git/post-checkout.args) && - test $old != $new -a $flag = 1 + GIT_DIR=clone2/.git git checkout new2 && + old=$(awk "{print \$1}" clone2/.git/post-checkout.args) && + new=$(awk "{print \$2}" clone2/.git/post-checkout.args) && + flag=$(awk "{print \$3}" clone2/.git/post-checkout.args) && + test $old != $new -a $flag = 1 ' test_expect_success 'post-checkout receives the right args when not switching branches ' ' - GIT_DIR=clone2/.git git checkout master b && - old=$(awk "{print \$1}" clone2/.git/post-checkout.args) && - new=$(awk "{print \$2}" clone2/.git/post-checkout.args) && - flag=$(awk "{print \$3}" clone2/.git/post-checkout.args) && - test $old = $new -a $flag = 0 + GIT_DIR=clone2/.git git checkout master b && + old=$(awk "{print \$1}" clone2/.git/post-checkout.args) && + new=$(awk "{print \$2}" clone2/.git/post-checkout.args) && + flag=$(awk "{print \$3}" clone2/.git/post-checkout.args) && + test $old = $new -a $flag = 0 ' if test "$(git config --bool core.filemode)" = true; then
Signature · 1 line
1.7.6.362.gf0e6
PATCH 18/40 whitespace: remediate t5510-fetch.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t5510-fetch.sh | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-)
t/t5510-fetch.sh +8 -8
@@ -384,14 +384,14 @@ test_expect_success 'fetch --dry-run' ' ' test_expect_success "should be able to fetch with duplicate refspecs" ' - mkdir dups && - cd dups && - git init && - git config branch.master.remote three && - git config remote.three.url ../three/.git && - git config remote.three.fetch +refs/heads/*:refs/remotes/origin/* && - git config --add remote.three.fetch +refs/heads/*:refs/remotes/origin/* && - git fetch three + mkdir dups && + cd dups && + git init && + git config branch.master.remote three && + git config remote.three.url ../three/.git && + git config remote.three.fetch +refs/heads/*:refs/remotes/origin/* && + git config --add remote.three.fetch +refs/heads/*:refs/remotes/origin/* && + git fetch three ' test_done
Signature · 1 line
1.7.6.362.gf0e6
PATCH 19/40 whitespace: remediate t6002-rev-list-bisect.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t6002-rev-list-bisect.sh | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
t/t6002-rev-list-bisect.sh +1 -1
@@ -18,7 +18,7 @@ test_bisection_diff() shift 2 _bisection=$(git rev-list $_bisect_option "$@") _list_size=$(git rev-list "$@" | wc -l) - _head=$1 + _head=$1 shift 1 _bisection_size=$(git rev-list $_bisection "$@" | wc -l) [ -n "$_list_size" -a -n "$_bisection_size" ] ||
Signature · 1 line
1.7.6.362.gf0e6
PATCH 20/40 whitespace: remediate t6005-rev-list-count.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t6005-rev-list-count.sh | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
t/t6005-rev-list-count.sh +3 -3
@@ -6,9 +6,9 @@ test_description='git rev-list --max-count and --skip test' test_expect_success 'setup' ' for n in 1 2 3 4 5 ; do \ - echo $n > a ; \ - git add a ; \ - git commit -m "$n" ; \ + echo $n > a ; \ + git add a ; \ + git commit -m "$n" ; \ done '
Signature · 1 line
1.7.6.362.gf0e6
PATCH 21/40 whitespace: remediate t6030-bisect-porcelain.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t6030-bisect-porcelain.sh | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-)
t/t6030-bisect-porcelain.sh +7 -7
@@ -14,12 +14,12 @@ add_line_into_file() _file=$2 if [ -f "$_file" ]; then - echo "$_line" >> $_file || return $? - MSG="Add <$_line> into <$_file>." + echo "$_line" >> $_file || return $? + MSG="Add <$_line> into <$_file>." else - echo "$_line" > $_file || return $? - git add $_file || return $? - MSG="Create file <$_file> with <$_line> inside." + echo "$_line" > $_file || return $? + git add $_file || return $? + MSG="Create file <$_file> with <$_line> inside." fi test_tick
@@ -559,10 +559,10 @@ test_expect_success 'skipping away from skipped commit' ' git bisect start $PARA_HASH7 $HASH1 && para4=$(git rev-parse --verify HEAD) && test "$para4" = "$PARA_HASH4" && - git bisect skip && + git bisect skip && hash7=$(git rev-parse --verify HEAD) && test "$hash7" = "$HASH7" && - git bisect skip && + git bisect skip && para3=$(git rev-parse --verify HEAD) && test "$para3" = "$PARA_HASH3" '
Signature · 1 line
1.7.6.362.gf0e6
PATCH 22/40 whitespace: remediate t7003-filter-branch.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t7003-filter-branch.sh | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
t/t7003-filter-branch.sh +1 -1
@@ -147,7 +147,7 @@ test_expect_success 'use index-filter to move into a subdirectory' ' git branch directorymoved && git filter-branch -f --index-filter \ "git ls-files -s | sed \"s- -&newsubdir/-\" | - GIT_INDEX_FILE=\$GIT_INDEX_FILE.new \ + GIT_INDEX_FILE=\$GIT_INDEX_FILE.new \ git update-index --index-info && mv \"\$GIT_INDEX_FILE.new\" \"\$GIT_INDEX_FILE\"" directorymoved && git diff --exit-code HEAD directorymoved:newsubdir
Signature · 1 line
1.7.6.362.gf0e6
PATCH 23/40 whitespace: remediate t7004-tag.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t7004-tag.sh | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
t/t7004-tag.sh +2 -2
@@ -1239,7 +1239,7 @@ test_expect_success 'checking that third commit has no tags' " test_expect_success 'creating simple branch' ' git branch stable v2.0 && - git checkout stable && + git checkout stable && echo foo-3.0 > foo && git commit foo -m fourth && git tag v3.0
@@ -1258,7 +1258,7 @@ test_expect_success 'checking that branch head only has one tag' " test_expect_success 'merging original branch into this branch' ' git merge --strategy=ours master && - git tag v4.0 + git tag v4.0 ' cat > expected <<EOF
Signature · 1 line
1.7.6.362.gf0e6
PATCH 24/40 whitespace: remediate t7403-submodule-sync.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t7403-submodule-sync.sh | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
t/t7403-submodule-sync.sh +1 -1
@@ -57,7 +57,7 @@ test_expect_success '"git submodule sync" should update submodule URLs' ' git submodule sync ) && test -d "$(git config -f super-clone/submodule/.git/config \ - remote.origin.url)" && + remote.origin.url)" && (cd super-clone/submodule && git checkout master && git pull
Signature · 1 line
1.7.6.362.gf0e6
PATCH 25/40 whitespace: remediate t7500-commit.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t7500-commit.sh | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
t/t7500-commit.sh +1 -1
@@ -142,7 +142,7 @@ test_expect_success 'using alternate GIT_INDEX_FILE (1)' ' cp .git/index saved-index && ( echo some new content >file && - GIT_INDEX_FILE=.git/another_index && + GIT_INDEX_FILE=.git/another_index && export GIT_INDEX_FILE && git add file && git commit -m "commit using another index" &&
Signature · 1 line
1.7.6.362.gf0e6
PATCH 26/40 whitespace: remediate t7810-grep.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t7810-grep.sh | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
t/t7810-grep.sh +1 -1
@@ -168,7 +168,7 @@ do test_expect_success "grep -c $L (no /dev/null)" ' ! git grep -c test $H | grep /dev/null - ' + ' test_expect_success "grep --max-depth -1 $L" ' {
Signature · 1 line
1.7.6.362.gf0e6
PATCH 27/40 whitespace: remediate t9100-git-svn-basic.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t9100-git-svn-basic.sh | 26 +++++++++++++------------- 1 files changed, 13 insertions(+), 13 deletions(-)
t/t9100-git-svn-basic.sh +13 -13
@@ -210,27 +210,27 @@ EOF test_expect_success "$name" "test_cmp a expected" test_expect_success 'exit if remote refs are ambigious' " - git config --add svn-remote.svn.fetch \ - bar:refs/${remotes_git_svn} && + git config --add svn-remote.svn.fetch \ + bar:refs/${remotes_git_svn} && test_must_fail git svn migrate " test_expect_success 'exit if init-ing a would clobber a URL' ' - svnadmin create "${PWD}/svnrepo2" && - svn mkdir -m "mkdir bar" "${svnrepo}2/bar" && - git config --unset svn-remote.svn.fetch \ - "^bar:refs/${remotes_git_svn}$" && + svnadmin create "${PWD}/svnrepo2" && + svn mkdir -m "mkdir bar" "${svnrepo}2/bar" && + git config --unset svn-remote.svn.fetch \ + "^bar:refs/${remotes_git_svn}$" && test_must_fail git svn init "${svnrepo}2/bar" - ' + ' test_expect_success \ 'init allows us to connect to another directory in the same repo' ' - git svn init --minimize-url -i bar "$svnrepo/bar" && - git config --get svn-remote.svn.fetch \ - "^bar:refs/remotes/bar$" && - git config --get svn-remote.svn.fetch \ - "^:refs/${remotes_git_svn}$" - ' + git svn init --minimize-url -i bar "$svnrepo/bar" && + git config --get svn-remote.svn.fetch \ + "^bar:refs/remotes/bar$" && + git config --get svn-remote.svn.fetch \ + "^:refs/${remotes_git_svn}$" + ' test_expect_success 'dcommit $rev does not clobber current branch' ' git svn fetch -i bar &&
Signature · 1 line
1.7.6.362.gf0e6
PATCH 28/40 whitespace: remediate t9104-git-svn-follow-parent.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t9104-git-svn-follow-parent.sh | 88 +++++++++++++++++++------------------- 1 files changed, 44 insertions(+), 44 deletions(-)
t/t9104-git-svn-follow-parent.sh +44 -44
@@ -32,57 +32,57 @@ test_expect_success 'init and fetch a moved directory' ' git svn init --minimize-url -i thunk "$svnrepo"/thunk && git svn fetch -i thunk && test "`git rev-parse --verify refs/remotes/thunk@2`" \ - = "`git rev-parse --verify refs/remotes/thunk~1`" && - test "`git cat-file blob refs/remotes/thunk:readme |\ - sed -n -e "3p"`" = goodbye && + = "`git rev-parse --verify refs/remotes/thunk~1`" && + test "`git cat-file blob refs/remotes/thunk:readme |\ + sed -n -e "3p"`" = goodbye && test -z "`git config --get svn-remote.svn.fetch \ - "^trunk:refs/remotes/thunk@2$"`" + "^trunk:refs/remotes/thunk@2$"`" ' test_expect_success 'init and fetch from one svn-remote' ' - git config svn-remote.svn.url "$svnrepo" && - git config --add svn-remote.svn.fetch \ - trunk:refs/remotes/svn/trunk && - git config --add svn-remote.svn.fetch \ - thunk:refs/remotes/svn/thunk && - git svn fetch -i svn/thunk && + git config svn-remote.svn.url "$svnrepo" && + git config --add svn-remote.svn.fetch \ + trunk:refs/remotes/svn/trunk && + git config --add svn-remote.svn.fetch \ + thunk:refs/remotes/svn/thunk && + git svn fetch -i svn/thunk && test "`git rev-parse --verify refs/remotes/svn/trunk`" \ - = "`git rev-parse --verify refs/remotes/svn/thunk~1`" && - test "`git cat-file blob refs/remotes/svn/thunk:readme |\ - sed -n -e "3p"`" = goodbye - ' + = "`git rev-parse --verify refs/remotes/svn/thunk~1`" && + test "`git cat-file blob refs/remotes/svn/thunk:readme |\ + sed -n -e "3p"`" = goodbye + ' test_expect_success 'follow deleted parent' ' - (svn_cmd cp -m "resurrecting trunk as junk" \ - "$svnrepo"/trunk@2 "$svnrepo"/junk || - svn cp -m "resurrecting trunk as junk" \ - -r2 "$svnrepo"/trunk "$svnrepo"/junk) && - git config --add svn-remote.svn.fetch \ - junk:refs/remotes/svn/junk && - git svn fetch -i svn/thunk && - git svn fetch -i svn/junk && - test -z "`git diff svn/junk svn/trunk`" && - test "`git merge-base svn/junk svn/trunk`" \ - = "`git rev-parse svn/trunk`" - ' + (svn_cmd cp -m "resurrecting trunk as junk" \ + "$svnrepo"/trunk@2 "$svnrepo"/junk || + svn cp -m "resurrecting trunk as junk" \ + -r2 "$svnrepo"/trunk "$svnrepo"/junk) && + git config --add svn-remote.svn.fetch \ + junk:refs/remotes/svn/junk && + git svn fetch -i svn/thunk && + git svn fetch -i svn/junk && + test -z "`git diff svn/junk svn/trunk`" && + test "`git merge-base svn/junk svn/trunk`" \ + = "`git rev-parse svn/trunk`" + ' test_expect_success 'follow larger parent' ' - mkdir -p import/trunk/thunk/bump/thud && - echo hi > import/trunk/thunk/bump/thud/file && - svn import -m "import a larger parent" import "$svnrepo"/larger-parent && - svn cp -m "hi" "$svnrepo"/larger-parent "$svnrepo"/another-larger && - git svn init --minimize-url -i larger \ - "$svnrepo"/another-larger/trunk/thunk/bump/thud && - git svn fetch -i larger && - git rev-parse --verify refs/remotes/larger && - git rev-parse --verify \ - refs/remotes/larger-parent/trunk/thunk/bump/thud && - test "`git merge-base \ - refs/remotes/larger-parent/trunk/thunk/bump/thud \ - refs/remotes/larger`" = \ - "`git rev-parse refs/remotes/larger`" - true - ' + mkdir -p import/trunk/thunk/bump/thud && + echo hi > import/trunk/thunk/bump/thud/file && + svn import -m "import a larger parent" import "$svnrepo"/larger-parent && + svn cp -m "hi" "$svnrepo"/larger-parent "$svnrepo"/another-larger && + git svn init --minimize-url -i larger \ + "$svnrepo"/another-larger/trunk/thunk/bump/thud && + git svn fetch -i larger && + git rev-parse --verify refs/remotes/larger && + git rev-parse --verify \ + refs/remotes/larger-parent/trunk/thunk/bump/thud && + test "`git merge-base \ + refs/remotes/larger-parent/trunk/thunk/bump/thud \ + refs/remotes/larger`" = \ + "`git rev-parse refs/remotes/larger`" + true + ' test_expect_success 'follow higher-level parent' ' svn mkdir -m "follow higher-level parent" "$svnrepo"/blob &&
@@ -96,8 +96,8 @@ test_expect_success 'follow higher-level parent' ' svn mkdir -m "new glob at top level" "$svnrepo"/glob && svn mv -m "move blob down a level" "$svnrepo"/blob "$svnrepo"/glob/blob && git svn init --minimize-url -i blob "$svnrepo"/glob/blob && - git svn fetch -i blob - ' + git svn fetch -i blob + ' test_expect_success 'follow deleted directory' ' svn_cmd mv -m "bye!" "$svnrepo"/glob/blob/hi "$svnrepo"/glob/blob/bye &&
Signature · 1 line
1.7.6.362.gf0e6
PATCH 29/40 whitespace: remediate t9107-git-svn-migrate.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t9107-git-svn-migrate.sh | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-)
t/t9107-git-svn-migrate.sh +7 -7
@@ -37,7 +37,7 @@ test_expect_success 'initialize old-style (v0) git svn layout' ' git rev-parse --verify refs/remotes/svn^0 && test "$(git config --get svn-remote.svn.url)" = "$svnrepo" && test `git config --get svn-remote.svn.fetch` = \ - ":refs/${remotes_git_svn}" + ":refs/${remotes_git_svn}" ' test_expect_success 'initialize a multi-repository repo' '
@@ -45,18 +45,18 @@ test_expect_success 'initialize a multi-repository repo' ' git config --get-all svn-remote.svn.fetch > fetch.out && grep "^trunk:refs/remotes/trunk$" fetch.out && test -n "`git config --get svn-remote.svn.branches \ - "^branches/\*:refs/remotes/\*$"`" && + "^branches/\*:refs/remotes/\*$"`" && test -n "`git config --get svn-remote.svn.tags \ - "^tags/\*:refs/remotes/tags/\*$"`" && + "^tags/\*:refs/remotes/tags/\*$"`" && git config --unset svn-remote.svn.branches \ - "^branches/\*:refs/remotes/\*$" && + "^branches/\*:refs/remotes/\*$" && git config --unset svn-remote.svn.tags \ - "^tags/\*:refs/remotes/tags/\*$" && + "^tags/\*:refs/remotes/tags/\*$" && git config --add svn-remote.svn.fetch "branches/a:refs/remotes/a" && git config --add svn-remote.svn.fetch "branches/b:refs/remotes/b" && for i in tags/0.1 tags/0.2 tags/0.3; do git config --add svn-remote.svn.fetch \ - $i:refs/remotes/$i || exit 1; done && + $i:refs/remotes/$i || exit 1; done && git config --get-all svn-remote.svn.fetch > fetch.out && grep "^trunk:refs/remotes/trunk$" fetch.out && grep "^branches/a:refs/remotes/a$" fetch.out &&
@@ -78,7 +78,7 @@ test_expect_success 'multi-fetch works on partial urls + paths' " for j in trunk a b tags/0.1 tags/0.2 tags/0.3; do if test \$j != \$i; then continue; fi test -z \"\`git diff refs/remotes/\$i \ - refs/remotes/\$j\`\" ||exit 1; done; done + refs/remotes/\$j\`\" ||exit 1; done; done " test_expect_success 'migrate --minimize on old inited layout' '
Signature · 1 line
1.7.6.362.gf0e6
PATCH 30/40 whitespace: remediate t9108-git-svn-glob.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t9108-git-svn-glob.sh | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-)
t/t9108-git-svn-glob.sh +8 -8
@@ -41,11 +41,11 @@ test_expect_success 'test refspec globbing' ' ) && git config --add svn-remote.svn.url "$svnrepo" && git config --add svn-remote.svn.fetch \ - "trunk/src/a:refs/remotes/trunk" && + "trunk/src/a:refs/remotes/trunk" && git config --add svn-remote.svn.branches \ - "branches/*/src/a:refs/remotes/branches/*" && + "branches/*/src/a:refs/remotes/branches/*" && git config --add svn-remote.svn.tags\ - "tags/*/src/a:refs/remotes/tags/*" && + "tags/*/src/a:refs/remotes/tags/*" && git svn multi-fetch && git log --pretty=oneline refs/remotes/tags/end | \ sed -e "s/^.\{41\}//" > output.end &&
@@ -65,9 +65,9 @@ test_expect_success 'test left-hand-side only globbing' ' git config --add svn-remote.two.url "$svnrepo" && git config --add svn-remote.two.fetch trunk:refs/remotes/two/trunk && git config --add svn-remote.two.branches \ - "branches/*:refs/remotes/two/branches/*" && + "branches/*:refs/remotes/two/branches/*" && git config --add svn-remote.two.tags \ - "tags/*:refs/remotes/two/tags/*" && + "tags/*:refs/remotes/two/tags/*" && ( cd tmp && echo "try try" >> tags/end/src/b/readme &&
@@ -93,11 +93,11 @@ echo "" >> expect.three test_expect_success 'test disallow multi-globs' ' git config --add svn-remote.three.url "$svnrepo" && git config --add svn-remote.three.fetch \ - trunk:refs/remotes/three/trunk && + trunk:refs/remotes/three/trunk && git config --add svn-remote.three.branches \ - "branches/*/t/*:refs/remotes/three/branches/*" && + "branches/*/t/*:refs/remotes/three/branches/*" && git config --add svn-remote.three.tags \ - "tags/*/*:refs/remotes/three/tags/*" && + "tags/*/*:refs/remotes/three/tags/*" && ( cd tmp && echo "try try" >> tags/end/src/b/readme &&
Signature · 1 line
1.7.6.362.gf0e6
PATCH 31/40 whitespace: remediate t9109-git-svn-multi-glob.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t9109-git-svn-multi-glob.sh | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-)
t/t9109-git-svn-multi-glob.sh +10 -10
@@ -41,11 +41,11 @@ test_expect_success 'test refspec globbing' ' ) && git config --add svn-remote.svn.url "$svnrepo" && git config --add svn-remote.svn.fetch \ - "trunk/src/a:refs/remotes/trunk" && + "trunk/src/a:refs/remotes/trunk" && git config --add svn-remote.svn.branches \ - "branches/*/*/src/a:refs/remotes/branches/*/*" && + "branches/*/*/src/a:refs/remotes/branches/*/*" && git config --add svn-remote.svn.tags\ - "tags/*/src/a:refs/remotes/tags/*" && + "tags/*/src/a:refs/remotes/tags/*" && git svn multi-fetch && git log --pretty=oneline refs/remotes/tags/end | \ sed -e "s/^.\{41\}//" > output.end &&
@@ -65,9 +65,9 @@ test_expect_success 'test left-hand-side only globbing' ' git config --add svn-remote.two.url "$svnrepo" && git config --add svn-remote.two.fetch trunk:refs/remotes/two/trunk && git config --add svn-remote.two.branches \ - "branches/*/*:refs/remotes/two/branches/*/*" && + "branches/*/*:refs/remotes/two/branches/*/*" && git config --add svn-remote.two.tags \ - "tags/*:refs/remotes/two/tags/*" && + "tags/*:refs/remotes/two/tags/*" && ( cd tmp && echo "try try" >> tags/end/src/b/readme &&
@@ -120,9 +120,9 @@ test_expect_success 'test another branch' ' git config --add svn-remote.four.url "$svnrepo" && git config --add svn-remote.four.fetch trunk:refs/remotes/four/trunk && git config --add svn-remote.four.branches \ - "branches/*/*:refs/remotes/four/branches/*/*" && + "branches/*/*:refs/remotes/four/branches/*/*" && git config --add svn-remote.four.tags \ - "tags/*:refs/remotes/four/tags/*" && + "tags/*:refs/remotes/four/tags/*" && git svn fetch four && test `git rev-list refs/remotes/four/tags/next | wc -l` -eq 5 && test `git rev-list refs/remotes/four/branches/v2/start | wc -l` -eq 3 &&
@@ -142,11 +142,11 @@ echo "" >> expect.three test_expect_success 'test disallow multiple globs' ' git config --add svn-remote.three.url "$svnrepo" && git config --add svn-remote.three.fetch \ - trunk:refs/remotes/three/trunk && + trunk:refs/remotes/three/trunk && git config --add svn-remote.three.branches \ - "branches/*/t/*:refs/remotes/three/branches/*/*" && + "branches/*/t/*:refs/remotes/three/branches/*/*" && git config --add svn-remote.three.tags \ - "tags/*:refs/remotes/three/tags/*" && + "tags/*:refs/remotes/three/tags/*" && ( cd tmp && echo "try try" >> tags/end/src/b/readme &&
Signature · 1 line
1.7.6.362.gf0e6
PATCH 32/40 whitespace: remediate t9110-git-svn-use-svm-props.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t9110-git-svn-use-svm-props.sh | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
t/t9110-git-svn-use-svm-props.sh +2 -2
@@ -50,9 +50,9 @@ test_expect_success 'verify metadata for /dir' " " test_expect_success 'find commit based on SVN revision number' " - git svn find-rev r12 | + git svn find-rev r12 | grep `git rev-parse HEAD` - " + " test_expect_success 'empty rebase' " git svn rebase
Signature · 1 line
1.7.6.362.gf0e6
PATCH 33/40 whitespace: remediate t9118-git-svn-funky-branch-names.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t9118-git-svn-funky-branch-names.sh | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
t/t9118-git-svn-funky-branch-names.sh +3 -3
@@ -16,11 +16,11 @@ test_expect_success 'setup svnrepo' ' svn_cmd import -m "$test_description" project "$svnrepo/pr ject" && rm -rf project && svn_cmd cp -m "fun" "$svnrepo/pr ject/trunk" \ - "$svnrepo/pr ject/branches/fun plugin" && + "$svnrepo/pr ject/branches/fun plugin" && svn_cmd cp -m "more fun!" "$svnrepo/pr ject/branches/fun plugin" \ - "$svnrepo/pr ject/branches/more fun plugin!" && + "$svnrepo/pr ject/branches/more fun plugin!" && svn_cmd cp -m "scary" "$svnrepo/pr ject/branches/fun plugin" \ - "$svnrepo/pr ject/branches/$scary_uri" && + "$svnrepo/pr ject/branches/$scary_uri" && svn_cmd cp -m "leading dot" "$svnrepo/pr ject/trunk" \ "$svnrepo/pr ject/branches/.leading_dot" && svn_cmd cp -m "trailing dot" "$svnrepo/pr ject/trunk" \
Signature · 1 line
1.7.6.362.gf0e6
PATCH 34/40 whitespace: remediate t9125-git-svn-multi-glob-branch-names.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t9125-git-svn-multi-glob-branch-names.sh | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
t/t9125-git-svn-multi-glob-branch-names.sh +3 -3
@@ -11,14 +11,14 @@ test_expect_success 'setup svnrepo' ' svn_cmd import -m "$test_description" project "$svnrepo/project" && rm -rf project && svn_cmd cp -m "fun" "$svnrepo/project/trunk" \ - "$svnrepo/project/branches/v14.1/beta" && + "$svnrepo/project/branches/v14.1/beta" && svn_cmd cp -m "more fun!" "$svnrepo/project/branches/v14.1/beta" \ - "$svnrepo/project/branches/v14.1/gold" + "$svnrepo/project/branches/v14.1/gold" ' test_expect_success 'test clone with multi-glob in branch names' ' git svn clone -T trunk -b branches/*/* -t tags \ - "$svnrepo/project" project && + "$svnrepo/project" project && (cd project && git rev-parse "refs/remotes/v14.1/beta" && git rev-parse "refs/remotes/v14.1/gold"
Signature · 1 line
1.7.6.362.gf0e6
PATCH 35/40 whitespace: remediate t9400-git-cvsserver-server.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t9400-git-cvsserver-server.sh | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
t/t9400-git-cvsserver-server.sh +3 -3
@@ -337,9 +337,9 @@ test_expect_success 'cvs update (subdirectories)' \ filename="file_in_$(echo $dir|sed -e "s#/# #g")" && if test "$(echo $(grep -v ^D $dir/CVS/Entries|cut -d/ -f2,3,5))" = "$filename/1.1/" && test_cmp "$dir/$filename" "../$dir/$filename"; then - : + : else - echo >failure + echo >failure fi done) && test ! -f failure'
@@ -448,7 +448,7 @@ test_expect_success 'cvs update (-p)' ' GIT_CONFIG="$git_config" cvs update && rm -f failures && for i in merge no-lf empty really-empty; do - GIT_CONFIG="$git_config" cvs update -p "$i" >$i.out + GIT_CONFIG="$git_config" cvs update -p "$i" >$i.out test_cmp $i.out ../$i >>failures 2>&1 done && test -z "$(cat failures)"
Signature · 1 line
1.7.6.362.gf0e6
PATCH 36/40 whitespace: remediate t9401-git-cvsserver-crlf.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t9401-git-cvsserver-crlf.sh | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)
t/t9401-git-cvsserver-crlf.sh +6 -6
@@ -26,15 +26,15 @@ marked_as () { not_present() { foundEntry="$(grep "^/$2/" "$1/CVS/Entries")" if [ -r "$1/$2" ] ; then - echo "Error: File still exists: $1 $2" >> "${WORKDIR}/marked.log" - return 1; + echo "Error: File still exists: $1 $2" >> "${WORKDIR}/marked.log" + return 1; fi if [ x"$foundEntry" != x"" ] ; then - echo "Error: should not have found: $1 $2" >> "${WORKDIR}/marked.log" - return 1; + echo "Error: should not have found: $1 $2" >> "${WORKDIR}/marked.log" + return 1; else - echo "Correctly not found: $1 $2" >> "${WORKDIR}/marked.log" - return 0; + echo "Correctly not found: $1 $2" >> "${WORKDIR}/marked.log" + return 0; fi }
Signature · 1 line
1.7.6.362.gf0e6
PATCH 37/40 whitespace: remediate t9500-gitweb-standalone-no-errors.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t9500-gitweb-standalone-no-errors.sh | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
t/t9500-gitweb-standalone-no-errors.sh +2 -2
@@ -502,8 +502,8 @@ test_expect_success \ test_expect_success \ 'URL: project URLs via gitweb.url' \ 'git config --add gitweb.url git://example.com/git/trash.git && - git config --add gitweb.url http://example.com/git/trash.git && - gitweb_run "p=.git;a=summary"' + git config --add gitweb.url http://example.com/git/trash.git && + gitweb_run "p=.git;a=summary"' cat >.git/cloneurl <<\EOF git://example.com/git/trash.git
Signature · 1 line
1.7.6.362.gf0e6
PATCH 38/40 whitespace: remediate t9603-cvsimport-patchsets.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t9603-cvsimport-patchsets.sh | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
t/t9603-cvsimport-patchsets.sh +3 -3
@@ -20,9 +20,9 @@ test_expect_failure '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 A~2..A --pretty="format:%s %ad" -- > ../actual-A && - echo "" >> ../actual-master && + git log --pretty=format:%s > ../actual-master && + git log A~2..A --pretty="format:%s %ad" -- > ../actual-A && + echo "" >> ../actual-master && echo "" >> ../actual-A ) && echo "Rev 4
Signature · 1 line
1.7.6.362.gf0e6
PATCH 39/40 whitespace: remediate t1000-read-tree-m-3way.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t1000-read-tree-m-3way.sh | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)
t/t1000-read-tree-m-3way.sh +6 -6
@@ -169,7 +169,7 @@ checked. 3 missing exists missing take A* must match A, if exists. ------------------------------------------------------------------ 4 missing exists A!=B no merge must match A and be - up-to-date, if exists. + up-to-date, if exists. ------------------------------------------------------------------ 5 missing exists A==B take A must match A, if exists. ------------------------------------------------------------------
@@ -180,21 +180,21 @@ checked. 8 exists missing O==B remove must not exist. ------------------------------------------------------------------ 9 exists O!=A missing no merge must match A and be - up-to-date, if exists. + up-to-date, if exists. ------------------------------------------------------------------ 10 exists O==A missing no merge must match A ------------------------------------------------------------------ 11 exists O!=A O!=B no merge must match A and be - A!=B up-to-date, if exists. + A!=B up-to-date, if exists. ------------------------------------------------------------------ 12 exists O!=A O!=B take A must match A, if exists. - A==B + A==B ------------------------------------------------------------------ 13 exists O!=A O==B take A must match A, if exists. ------------------------------------------------------------------ 14 exists O==A O!=B take B if exists, must either (1) - match A and be up-to-date, - or (2) match B. + match A and be up-to-date, + or (2) match B. ------------------------------------------------------------------ 15 exists O==A O==B take B must match A if exists. ------------------------------------------------------------------
Signature · 1 line
1.7.6.362.gf0e6
PATCH 40/40 whitespace: remediate t6120-describe.sh
In reply to Jon SeymourThis file was edited by applying:
expand -i | unexpand --first-only | sed "s/ *$//"
to the file.
No change to test outputs or status code was observed.
--- t/t6120-describe.sh | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
t/t6120-describe.sh +4 -4
@@ -2,13 +2,13 @@ test_description='test describe - B - .--------------o----o----o----x + B + .--------------o----o----o----x / / / o----o----o----o----o----. / \ A c / - .------------o---o---o - D,R e + .------------o---o---o + D,R e ' . ./test-lib.sh
Signature · 1 line
1.7.6.362.gf0e6
PATCH 1/1 whitespace: additional whitespace clean ups.
In reply to Jon SeymourAfter replacing the whitespace test with a test and fix based on git apply's --whitespace=fix option, a few additional cleanups were identified.
--- t/t0100-previous.sh | 1 - t/t1008-read-tree-overlay.sh | 1 - t/t1009-read-tree-new-index.sh | 1 - t/t1505-rev-parse-last.sh | 2 -- t/t2009-checkout-statinfo.sh | 1 - t/t2203-add-intent.sh | 1 - t/t6011-rev-list-with-bad-commit.sh | 1 - t/t7700-repack.sh | 1 - t/t9121-git-svn-fetch-renamed-dir.sh | 1 - t/t9122-git-svn-author.sh | 2 +- t/t9123-git-svn-rebuild-with-rewriteroot.sh | 1 - 11 files changed, 1 insertions(+), 12 deletions(-)
t/t0100-previous.sh +0 -1
@@ -46,4 +46,3 @@ test_expect_success 'merge @{-1} when there is not enough switches yet' ' ' test_done -
t/t1008-read-tree-overlay.sh +0 -1
@@ -29,4 +29,3 @@ test_expect_success 'multi-read' ' ' test_done -
t/t1009-read-tree-new-index.sh +0 -1
@@ -22,4 +22,3 @@ test_expect_success 'empty index file' ' ' test_done -
t/t1505-rev-parse-last.sh +0 -2
@@ -65,5 +65,3 @@ test_expect_success '@{-3} fails' ' ' test_done - -
t/t2009-checkout-statinfo.sh +0 -1
@@ -49,4 +49,3 @@ test_expect_success 'path checkout' ' ' test_done -
t/t2203-add-intent.sh +0 -1
@@ -61,4 +61,3 @@ test_expect_success 'can "commit -a" with an i-t-a entry' ' ' test_done -
t/t6011-rev-list-with-bad-commit.sh +0 -1
@@ -57,4 +57,3 @@ test_expect_success 'first commit is still available' \ ' test_done -
t/t7700-repack.sh +0 -1
@@ -165,4 +165,3 @@ test_expect_success 'objects made unreachable by grafts only are kept' ' ' test_done -
t/t9121-git-svn-fetch-renamed-dir.sh +0 -1
@@ -17,4 +17,3 @@ test_expect_success 'init and fetch repository' ' ' test_done -
t/t9122-git-svn-author.sh +1 -1
@@ -75,7 +75,7 @@ test_expect_success 'interact with it via git svn' ' ( cd work.svn && svn_cmd up && - + test $(svn_cmd log -r2:2 | wc -l) = 5 && test $(svn_cmd log -r4:4 | wc -l) = 7 )
t/t9123-git-svn-rebuild-with-rewriteroot.sh +0 -1
@@ -29,4 +29,3 @@ test_expect_success 'rebuild rev_map' ' ' test_done -
Signature · 1 line
1.7.6.411.gf4ef
Re: [PATCH 01/40] test-cleaner: automate whitespace cleaning of test scripts
In reply to Jon SeymourQuoted 5 lines · Jon Seymour
This script allows the automated cleaning of test scripts.
Any whitespace fixups of a test script that do not effect the exit status or output of the test are assumed to be safe and are automatically committed.
Actually, this is not true - commits are generated, if the file matches the filtering criteria for the fix subcommand specified.
Quoted 1 line
If no arguments are supplied, file arguments are read from stdin.
Should I use - for instead?
t/test-cleaner.sh line 51
Quoted 10 lines
t/test-cleaner.sh new file +10
-0+ +fix_whitespace_auto() +{ + check_whitespace "$@" 2>/dev/null | grep "^AUTO" | fix_whitespace +} + +fix_whitespace_auto() +{ + check_whitespace "$@" 2>/dev/null | grep "^MANUAL" | fix_whitespace +}
Both these need cut -f1 before the fix_whitespace stage.
jon.
PATCH 1/40 test-cleaner: automate whitespace cleaning of test scripts
In reply to Jon SeymourThis script allows the automated cleaning of test scripts.
Any whitespace fixups of a test script that do not effect the exit status or output of the test are assumed to be safe and are automatically committed.
To check the tests for whitespace issues, change into git's test directory and run:
test-cleaner.sh check-whitespace t*.sh
This will:
* write one line of the form:
AUTO<tab><filename>
for each file that can be fixed automatically.
* write one line of the form:
MANUAL<tab><filename>
for each file that will require manual intervention to fix.
To fix all the automatically correctable errors, run:
./test-cleaner.sh fix-whitespace-auto t[0-9]*.sh
To generate commits for all the errors that require manual correction, run:
./test-cleaner.sh fix-whitespace-manual t[0-9]*.sh
To clean a file without running tests or generating commits, run:
./test-cleaner.sh clean-whitespace foobar.sh
clean-whitespace can be used with files that are not tests.
If no arguments are supplied, file arguments are read from stdin.
The filter itself can be run with:
./test-cleaner.sh whitespace-filter < file > some-other-file
The resulting series of commits should rebased on both the git master and pu branches. Commits that cause merge conflicts should be purged from the series.
--- t/test-cleaner.sh | 185 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 185 insertions(+), 0 deletions(-) create mode 100755 t/test-cleaner.sh
t/test-cleaner.sh new file +185 -0
@@ -0,0 +1,185 @@ +#!/bin/sh + +USAGE="test-cleaner.sh + check-whitespace [<test-file> ...] - report on test files that need cleaning + fix_whitespace [<test-file> ...] - generate commits for files that need white space cleaning + fix-whitespace-auto [<test-file> ...] - generate commits for files that can be automatically cleaned + fix-whitespace-manual [<test-file> ...] - generate commits for files that need manual cleaning + clean-whitespace [<file> ...] - applying the cleaner to the specified file without running tests or generating commits +" +SUBDIRECTORY_OK=t +. "$(git --exec-path)/git-sh-setup" +require_clean_work_tree + +cleaner() +{ + expand -i | unexpand --first-only | sed "s/ *\$//" +} + +clean_whitespace() +{ + rc=0 + list_files "$@" | while read file + do + cleaner <"$file" >$$.tmp && + cat $$.tmp >"$file" || rc=1 + rm -f $$.tmp + test $rc = 0 + done || exit $? +} + +list_files() +{ + if test $# -gt 0 + then + for arg in "$@"; do + echo $arg + done + else + cat + fi +} + +fix_whitespace_auto() +{ + check_whitespace "$@" 2>/dev/null | grep "^AUTO" | cut -f2 | fix_whitespace +} + +fix_whitespace_manual() +{ + check_whitespace "$@" 2>/dev/null | grep "^MANUAL" | cut -f2 | fix_whitespace +} + +fix_whitespace() +{ + rc=0 + check_whitespace "$@" 2>/dev/null | while read status file + do + case "$status" in + AUTO) + if clean_whitespace "$file" && + git diff --exit-code -w -- "$file" >/dev/null + git add "$file" && + git diff --exit-code -w HEAD -- "$file" >/dev/null + then + git commit -F - 1>&2 <<EOF +whitespace: remediate $file + +This file was edited by applying: + + expand -i | unexpand --first-only | sed "s/ *\$//" + +to the file. + +No change to test outputs or status code was observed. + +Signed-off-by: $(git config user.name) <$(git config user.email)> +EOF + echo "$status $file" + else + rc=1 + fi + rm -f $$.tmp + ;; + MANUAL) + CLEANER_PREFIX=fixer. + check_whitespace "$file" >/dev/null 2>$$.err + if clean_whitespace "$file" && + git diff --exit-code -w -- "$file" >/dev/null + git add "$file" && + git diff --exit-code -w HEAD -- "$file" >/dev/null + then + git commit -F - 1>&2 <<EOF +FAILED: whitespace: remediate $file + +This file was edited by applying: + + expand -i | unexpand --first-only | sed "s/ *\$//" + +to the file. + +The following errors were observed: + +$(cat $$.err | sed "s/^/ /") + +These errors should be fixed before submitting this patch upstream. + +Signed-off-by: $(git config user.name) <$(git config user.email)> +EOF + echo "$status $file" + else + rc=1 + fi + rm -f $$.tmp $$.err + ;; + *) + die "fix-whitespace failed on $file with unexpected output" + ;; + esac + test "$rc" = 0 + done || rc=$? + test "$rc" = 0 +} + +check_whitespace() +{ + list_files "$@" | while read file + do + cleaner <"$file" >$$.${CLEANER_PREFIX}edited && + cmp "$file" $$.${CLEANER_PREFIX}edited 1>/dev/null + rc=$? + if test $rc != 0 + then + sh $file >$$.${CLEANER_PREFIX}before.output 2>$$.${CLEANER_PREFIX}before.error </dev/null + echo $? > $$.${CLEANER_PREFIX}before.exit + sh ./$$.${CLEANER_PREFIX}edited >$$.${CLEANER_PREFIX}after.output 2>$$.${CLEANER_PREFIX}after.error </dev/null + echo $? > $$.${CLEANER_PREFIX}after.exit + + if cmp $$.${CLEANER_PREFIX}before.output $$.${CLEANER_PREFIX}after.output 1>/dev/null && + cmp $$.${CLEANER_PREFIX}before.error $$.${CLEANER_PREFIX}after.error 1>/dev/null && + cmp $$.${CLEANER_PREFIX}before.exit $$.${CLEANER_PREFIX}after.exit 1>/dev/null + then + echo "AUTO $file" + else + echo "MANUAL $file" + diff -u $$.${CLEANER_PREFIX}before.output $$.${CLEANER_PREFIX}after.output 1>&2 + diff -u $$.${CLEANER_PREFIX}before.error $$.${CLEANER_PREFIX}after.error 1>&2 + diff -u $$.${CLEANER_PREFIX}before.exit $$.${CLEANER_PREFIX}after.exit 1>&2 + fi + looprc=1 + fi + rm -f $$.${CLEANER_PREFIX}edited $$.${CLEANER_PREFIX}after.* $$.${CLEANER_PREFIX}before.* + test "$looprc" = 0 + done +} + +case $# in +0) + usage ;; +*) + cmd=$1 + shift + case "$cmd" in + check-whitespace) + check_whitespace "$@" + ;; + fix-whitespace) + fix_whitespace "$@" + ;; + fix-whitespace-auto) + fix_whitespace_auto "$@" + ;; + fix-whitespace-manual) + fix_whitespace_manual "$@" + ;; + clean-whitespace) + clean_whitespace "$@" + ;; + whitespace-filter) + cleaner + ;; + *) + usage + ;; + esac +esac
Signature · 1 line
1.7.6.362.gf0e6
Quoted 4 lines · Jon Seymour
The series applies cleanly to both master and pu.
The first patch contains a script,
t/test-cleaner.sh, that can automate whitespace cleanup of tests.
Hmm. Can't we do something similar using git itself, and clean up all sorts of whitespace errors?
I tried:
rm t/t1006-cat-file.sh git diff -R | git apply --whitespace=fix
and ended up with the same blob as your script.
In theory you could do the whole tree:
git ls-files -z | xargs -0 rm git diff -R --binary | git apply --whitespace=fix
though it reports 604 whitespace errors, but only 489 lines fixed. And t1006 is not among the modified files. So I wonder if this is a bug in git-apply, or am I missing something.
-Peff
Quoted 10 lines · Jeff King
Quoted 4 lines · Jon Seymour
The series applies cleanly to both master and pu.
The first patch contains a script,
t/test-cleaner.sh, that can automate whitespace cleanup of tests.Hmm. Can't we do something similar using git itself, and clean up all sorts of whitespace errors?
Right. That's probably a better way to implement the test and cleanup, since it ensures the desired heuristic is used.
I will revise accordingly.
I guess the additional advantage of test-cleaner.sh is that it automates the testing and creation of patches, at least for tests.
As mentioned in another note, it would probably be useful to generalize this to files other than tests but one would have to use a more complicated discovery procedure in that case (in order to make it efficient - one doesn't want to have to run the full test suite to test every single edit).
Quoted 7 lines
I tried:
rm
t/t1006-cat-file.sh
git diff -R | git apply --whitespace=fixand ended up with the same blob as your script.
Quoted 9 lines
In theory you could do the whole tree:
git ls-files -z | xargs -0 rm
git diff -R --binary | git apply --whitespace=fixthough it reports 604 whitespace errors, but only 489 lines fixed. And t1006 is not among the modified files. So I wonder if this is a bug in git-apply, or am I missing something.
Not sure - I'll dig into it.
jon.
Quoted 2 lines · Jon Seymour
...
One can imagine generalising test-cleaner.sh to things that aren't tests.
So, something like:
git whitespace-cleaner --test "make test" *.c *.h
would do whitespace cleaning on all .c and .h files and then use a bisection process to find the edits that cause a break in the test suite. Then rewrite the history and iterate the process to find the maximal series of whitespace fixups that does not break the test suite.
jon.