]> git.ipfire.org Git - thirdparty/git.git/commitdiff
chainlint.pl: check line numbers in expected output
authorJeff King <peff@peff.net>
Wed, 10 Jul 2024 08:37:55 +0000 (04:37 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 10 Jul 2024 17:14:22 +0000 (10:14 -0700)
While working on chainlint.pl recently, we introduced some bugs that
showed incorrect line numbers in the output. But it was hard to notice,
since we sanitize the output by removing all of the line numbers! It
would be nice to retain these so we can catch any regressions.

The main reason we sanitize is for maintainability: we concatenate all
of the test snippets into a single file, so it's hard for each ".expect"
file to know at which offset its test input will be found. We can handle
that by storing the per-test line numbers in the ".expect" files, and
then dynamically offsetting them as we build the concatenated test and
expect files together.

The changes to the ".expect" files look like tedious boilerplate, but it
actually makes adding new tests easier. You can now just run:

  perl chainlint.pl chainlint/foo.test |
  tail -n +2 >chainlint/foo.expect

to save the output of the script minus the comment headers (after
checking that it is correct, of course). Whereas before you had to strip
the line numbers. The conversions here were done mechanically using
something like the script above, and then spot-checked manually.

It would be possible to do all of this in shell via the Makefile, but it
gets a bit complicated (and requires a lot of extra processes). Instead,
I've written a short perl script that generates the concatenated files
(we already depend on perl, since chainlint.pl uses it). Incidentally,
this improves a few other things:

  - we incorrectly used $(CHAINLINTTMP_SQ) inside a double-quoted
    string. So if your test directory required quoting, like:

       make "TEST_OUTPUT_DIRECTORY=/tmp/h'orrible"

    we'd fail the chainlint tests.

  - the shell in the Makefile didn't handle &&-chaining correctly in its
    loops (though in practice the "sed" and "cat" invocations are not
    likely to fail).

  - likewise, the sed invocation to strip numbers was hiding the exit
    code of chainlint.pl itself. In practice this isn't a big deal;
    since there are linter violations in the test files, we expect it to
    exit non-zero. But we could later use exit codes to distinguish
    serious errors from expected ones.

  - we now use a constant number of processes, instead of scaling with
    the number of test scripts. So it should be a little faster (on my
    machine, "make check-chainlint" goes from 133ms to 73ms).

There are some alternatives to this approach, but I think this is still
a good intermediate step:

  1. We could invoke chainlint.pl individually on each test file, and
     compare it to the expected output (and possibly using "make" to
     avoid repeating already-done checks). This is a much bigger change
     (and we'd have to figure out what to do with the "# LINT" lines in
     the inputs). But in this case we'd still want the "expect" files to
     be annotated with line numbers. So most of what's in this patch
     would be needed anyway.

  2. Likewise, we could run a single chainlint.pl and feed it all of the
     scripts (with "--jobs=1" to get deterministic output). But we'd
     still need to annotate the scripts as we did here, and we'd still
     need to either assemble the "expect" file, or break apart the
     script output to compare to each individual ".expect" file.

So we may pursue those in the long run, but this patch gives us more
robust tests without too much extra work or moving in a useless
direction.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
74 files changed:
t/Makefile
t/chainlint-cat.pl [new file with mode: 0644]
t/chainlint/arithmetic-expansion.expect
t/chainlint/bash-array.expect
t/chainlint/blank-line-before-esac.expect
t/chainlint/blank-line.expect
t/chainlint/block-comment.expect
t/chainlint/block.expect
t/chainlint/broken-chain.expect
t/chainlint/case-comment.expect
t/chainlint/case.expect
t/chainlint/chain-break-background.expect
t/chainlint/chain-break-continue.expect
t/chainlint/chain-break-false.expect
t/chainlint/chain-break-return-exit.expect
t/chainlint/chain-break-status.expect
t/chainlint/chained-block.expect
t/chainlint/chained-subshell.expect
t/chainlint/close-nested-and-parent-together.expect
t/chainlint/close-subshell.expect
t/chainlint/command-substitution-subsubshell.expect
t/chainlint/command-substitution.expect
t/chainlint/comment.expect
t/chainlint/complex-if-in-cuddled-loop.expect
t/chainlint/cuddled-if-then-else.expect
t/chainlint/cuddled-loop.expect
t/chainlint/cuddled.expect
t/chainlint/double-here-doc.expect
t/chainlint/dqstring-line-splice.expect
t/chainlint/dqstring-no-interpolate.expect
t/chainlint/empty-here-doc.expect
t/chainlint/exclamation.expect
t/chainlint/exit-loop.expect
t/chainlint/exit-subshell.expect
t/chainlint/for-loop-abbreviated.expect
t/chainlint/for-loop.expect
t/chainlint/function.expect
t/chainlint/here-doc-close-subshell.expect
t/chainlint/here-doc-indent-operator.expect
t/chainlint/here-doc-multi-line-command-subst.expect
t/chainlint/here-doc-multi-line-string.expect
t/chainlint/here-doc.expect
t/chainlint/if-condition-split.expect
t/chainlint/if-in-loop.expect
t/chainlint/if-then-else.expect
t/chainlint/incomplete-line.expect
t/chainlint/inline-comment.expect
t/chainlint/loop-detect-failure.expect
t/chainlint/loop-detect-status.expect
t/chainlint/loop-in-if.expect
t/chainlint/loop-upstream-pipe.expect
t/chainlint/multi-line-nested-command-substitution.expect
t/chainlint/multi-line-string.expect
t/chainlint/negated-one-liner.expect
t/chainlint/nested-cuddled-subshell.expect
t/chainlint/nested-here-doc.expect
t/chainlint/nested-loop-detect-failure.expect
t/chainlint/nested-subshell-comment.expect
t/chainlint/nested-subshell.expect
t/chainlint/not-heredoc.expect
t/chainlint/one-liner-for-loop.expect
t/chainlint/one-liner.expect
t/chainlint/p4-filespec.expect
t/chainlint/pipe.expect
t/chainlint/return-loop.expect
t/chainlint/semicolon.expect
t/chainlint/sqstring-in-sqstring.expect
t/chainlint/subshell-here-doc.expect
t/chainlint/subshell-one-liner.expect
t/chainlint/t7900-subtree.expect
t/chainlint/token-pasting.expect
t/chainlint/unclosed-here-doc-indent.expect
t/chainlint/unclosed-here-doc.expect
t/chainlint/while-loop.expect

index e7a476966ef7cac231215e7a441862344f1e3ff8..4c30e7c06fb94a27a1b1f652a1b09d270baa487c 100644 (file)
@@ -108,18 +108,8 @@ clean-chainlint:
 
 check-chainlint:
        @mkdir -p '$(CHAINLINTTMP_SQ)' && \
-       for i in $(CHAINLINTTESTS); do \
-               sed -e '/^# LINT: /d' chainlint/$$i.test; \
-       done >'$(CHAINLINTTMP_SQ)'/tests && \
-       { \
-               echo "# chainlint: $(CHAINLINTTMP_SQ)/tests" && \
-               for i in $(CHAINLINTTESTS); do \
-                       echo "# chainlint: $$i" && \
-                       cat chainlint/$$i.expect; \
-               done \
-       } >'$(CHAINLINTTMP_SQ)'/expect && \
-       $(CHAINLINT) --emit-all '$(CHAINLINTTMP_SQ)'/tests | \
-               sed -e 's/^[1-9][0-9]* //' >'$(CHAINLINTTMP_SQ)'/actual && \
+       '$(PERL_PATH_SQ)' chainlint-cat.pl '$(CHAINLINTTMP_SQ)' $(CHAINLINTTESTS) && \
+       { $(CHAINLINT) --emit-all '$(CHAINLINTTMP_SQ)'/tests >'$(CHAINLINTTMP_SQ)'/actual || true; } && \
        diff -u '$(CHAINLINTTMP_SQ)'/expect '$(CHAINLINTTMP_SQ)'/actual
 
 test-lint: test-lint-duplicates test-lint-executable test-lint-shell-syntax \
diff --git a/t/chainlint-cat.pl b/t/chainlint-cat.pl
new file mode 100644 (file)
index 0000000..388f6e1
--- /dev/null
@@ -0,0 +1,29 @@
+#!/usr/bin/env perl
+
+my $outdir = shift;
+open(my $tests, '>', "$outdir/tests")
+       or die "unable to open $outdir/tests: $!";
+open(my $expect, '>', "$outdir/expect")
+       or die "unable to open $outdir/expect: $!";
+
+print $expect "# chainlint: $outdir/tests\n";
+
+my $offset = 0;
+for my $script (@ARGV) {
+       print $expect "# chainlint: $script\n";
+
+       open(my $expect_in, '<', "chainlint/$script.expect")
+               or die "unable to open chainlint/$script.expect: $!";
+       while (<$expect_in>) {
+               s/^\d+/$& + $offset/e;
+               print $expect $_;
+       }
+
+       open(my $test_in, '<', "chainlint/$script.test")
+               or die "unable to open chainlint/$script.test: $!";
+       while (<$test_in>) {
+               /^# LINT: / and next;
+               print $tests $_;
+               $offset++;
+       }
+}
index 46ee1046af73582ea5adf5e91b0be62025684bb6..338ecd5861271afe26fe58f628e77b816ab90931 100644 (file)
@@ -1,9 +1,9 @@
-(
-       foo &&
-       bar=$((42 + 1)) &&
-       baz
-) &&
-(
-       bar=$((42 + 1)) ?!AMP?!
-       baz
-)
+(
+3      foo &&
+4      bar=$((42 + 1)) &&
+5      baz
+) &&
+(
+8      bar=$((42 + 1)) ?!AMP?!
+9      baz
+10 )
index 4c34eaee45e2f706e80560edfa271f4a5e245a9e..435dc8bdc8505aff6275685c8352412d0fa792f2 100644 (file)
@@ -1,10 +1,10 @@
-(
-       foo &&
-       bar=(gumbo stumbo wumbo) &&
-       baz
-) &&
-(
-       foo &&
-       bar=${#bar[@]} &&
-       baz
-)
+(
+3      foo &&
+4      bar=(gumbo stumbo wumbo) &&
+5      baz
+) &&
+(
+8      foo &&
+9      bar=${#bar[@]} &&
+10     baz
+11 )
index 056e03003d3e7847ead4f14e47b69de630cb507e..b88ba919eb54db77f5362f07a7aab0b251cf7816 100644 (file)
@@ -1,18 +1,18 @@
-test_done () {
-       case "$test_failure" in
-       0)
-               test_at_end_hook_
-
-               exit 0 ;;
-
-       *)
-               if test $test_external_has_tap -eq 0
-               then
-                       say_color error "# failed $test_failure among $msg"
-                       say "1..$test_count"
-               fi
-
-               exit 1 ;;
-
-       esac
-}
+test_done () {
+3      case "$test_failure" in
+4      0)
+5              test_at_end_hook_
+6 
+7              exit 0 ;;
+8 
+9      *)
+10             if test $test_external_has_tap -eq 0
+11             then
+12                     say_color error "# failed $test_failure among $msg"
+13                     say "1..$test_count"
+14             fi
+15 
+16             exit 1 ;;
+17 
+18     esac
+19 }
index b47827d7499f607289cc6ec78a7b0030ee2449c0..6ae39dd1743604ee44d3fe57c6b32169c8cc7db4 100644 (file)
@@ -1,8 +1,8 @@
-(
-
-       nothing &&
-
-       something
-
-
-)
+(
+3 
+4      nothing &&
+5 
+6      something
+7 
+8 
+)
index df2beea8887f3504e5fbab25aef96eb3763ded84..7926936c18b466cf1b6b3f5cde136fb39d393e1d 100644 (file)
@@ -1,8 +1,8 @@
-(
-       {
-               # show a
-               echo a &&
-               # show b
-               echo b
-       }
-)
+(
+3      {
+4              # show a
+5              echo a &&
+6              # show b
+7              echo b
+8      }
+)
index 1c873263647907de91d461b4bf19b48ea5e85c3a..b62e3d58c36b9bb35cd52e33712c07764835c3b7 100644 (file)
@@ -1,23 +1,23 @@
-(
-       foo &&
-       {
-               echo a ?!AMP?!
-               echo b
-       } &&
-       bar &&
-       {
-               echo c
-       } ?!AMP?!
-       baz
-) &&
-
-{
-       echo a; ?!AMP?! echo b
-} &&
-{ echo a; ?!AMP?! echo b; } &&
-
-{
-       echo "${var}9" &&
-       echo "done"
-} &&
-finis
+(
+3      foo &&
+4      {
+5              echo a ?!AMP?!
+6              echo b
+7      } &&
+8      bar &&
+9      {
+10             echo c
+11     } ?!AMP?!
+12     baz
+13 ) &&
+14 
+15 {
+16     echo a; ?!AMP?! echo b
+17 } &&
+18 { echo a; ?!AMP?! echo b; } &&
+19 
+20 {
+21     echo "${var}9" &&
+22     echo "done"
+23 } &&
+24 finis
index cfb58fb6b937be645f79167eae7fa27ec27d9618..9a1838736f9f7666829e0952fa82d752733fd4a2 100644 (file)
@@ -1,6 +1,6 @@
-(
-       foo &&
-       bar ?!AMP?!
-       baz &&
-       wop
-)
+(
+3      foo &&
+4      bar ?!AMP?!
+5      baz &&
+6      wop
+)
index 641c157b98c0af678b15fb2cc25645eac8650602..2442dd5f25b704aa4bea691f7c454d001d5700e2 100644 (file)
@@ -1,11 +1,11 @@
-(
-       case "$x" in
-       # found foo
-       x) foo ;;
-       # found other
-       *)
-               # treat it as bar
-               bar
-               ;;
-       esac
-)
+(
+3      case "$x" in
+4      # found foo
+5      x) foo ;;
+6      # found other
+7      *)
+8              # treat it as bar
+9              bar
+10             ;;
+11     esac
+12 )
index 31f280d8ceb3152a057c26cabe926f9defb8bdac..c04c61ff36668cdadf127369d0122e63788f7aae 100644 (file)
@@ -1,19 +1,19 @@
-(
-       case "$x" in
-       x) foo ;;
-       *) bar ;;
-       esac &&
-       foobar
-) &&
-(
-       case "$x" in
-       x) foo ;;
-       *) bar ;;
-       esac ?!AMP?!
-       foobar
-) &&
-(
-       case "$x" in 1) true;; esac &&
-       case "$y" in 2) false;; esac ?!AMP?!
-       foobar
-)
+(
+3      case "$x" in
+4      x) foo ;;
+5      *) bar ;;
+6      esac &&
+7      foobar
+) &&
+(
+10     case "$x" in
+11     x) foo ;;
+12     *) bar ;;
+13     esac ?!AMP?!
+14     foobar
+15 ) &&
+16 (
+17     case "$x" in 1) true;; esac &&
+18     case "$y" in 2) false;; esac ?!AMP?!
+19     foobar
+20 )
index 20d0bb5333083208285e87408e5f16fb7263594c..d06deadae7dec380abe442139be979648bb4d3f2 100644 (file)
@@ -1,9 +1,9 @@
-JGIT_DAEMON_PID= &&
-git init --bare empty.git &&
->empty.git/git-daemon-export-ok &&
-mkfifo jgit_daemon_output &&
-{
-       jgit daemon --port="$JGIT_DAEMON_PORT" . >jgit_daemon_output &
-       JGIT_DAEMON_PID=$!
-} &&
-test_expect_code 2 git ls-remote --exit-code git://localhost:$JGIT_DAEMON_PORT/empty.git
+JGIT_DAEMON_PID= &&
+git init --bare empty.git &&
+>empty.git/git-daemon-export-ok &&
+mkfifo jgit_daemon_output &&
+{
+7      jgit daemon --port="$JGIT_DAEMON_PORT" . >jgit_daemon_output &
+8      JGIT_DAEMON_PID=$!
+} &&
+10 test_expect_code 2 git ls-remote --exit-code git://localhost:$JGIT_DAEMON_PORT/empty.git
index 47a34577100024bf68a6a193ebe55efa525034e2..4bb60aae25ab9d36dd97d6023bdd4164852edd28 100644 (file)
@@ -1,12 +1,12 @@
-git ls-tree --name-only -r refs/notes/many_notes |
-while read path
-do
-       test "$path" = "foobar/non-note.txt" && continue
-       test "$path" = "deadbeef" && continue
-       test "$path" = "de/adbeef" && continue
-
-       if test $(expr length "$path") -ne $hexsz
-       then
-               return 1
-       fi
-done
+git ls-tree --name-only -r refs/notes/many_notes |
+while read path
+do
+5      test "$path" = "foobar/non-note.txt" && continue
+6      test "$path" = "deadbeef" && continue
+7      test "$path" = "de/adbeef" && continue
+8 
+9      if test $(expr length "$path") -ne $hexsz
+10     then
+11             return 1
+12     fi
+13 done
index 989766fb85644657a30a8b8b07b3523ab0fc8486..4f815f8e14c1a2e396171d003598f183c583edcb 100644 (file)
@@ -1,9 +1,9 @@
-if condition not satisified
-then
-       echo it did not work...
-       echo failed!
-       false
-else
-       echo it went okay ?!AMP?!
-       congratulate user
-fi
+if condition not satisified
+then
+4      echo it did not work...
+5      echo failed!
+6      false
+else
+8      echo it went okay ?!AMP?!
+9      congratulate user
+10 fi
index 4cd18e2edfc80a4bcb30ea409da0e6afac0d341b..ba0ec51aa01fccc0bf07f56b371627ababb055cb 100644 (file)
@@ -1,19 +1,19 @@
-case "$(git ls-files)" in
-one) echo pass one ;;
-*) echo bad one; return 1 ;;
-esac &&
-(
-       case "$(git ls-files)" in
-       two) echo pass two ;;
-       *) echo bad two; exit 1 ;;
-       esac
-) &&
-case "$(git ls-files)" in
-dir/two"$LF"one) echo pass both ;;
-*) echo bad; return 1 ;;
-esac &&
-
-for i in 1 2 3 4 ; do
-       git checkout main -b $i || return $?
-       test_commit $i $i $i tag$i || return $?
-done
+case "$(git ls-files)" in
+one) echo pass one ;;
+*) echo bad one; return 1 ;;
+esac &&
+(
+7      case "$(git ls-files)" in
+8      two) echo pass two ;;
+9      *) echo bad two; exit 1 ;;
+10     esac
+11 ) &&
+12 case "$(git ls-files)" in
+13 dir/two"$LF"one) echo pass both ;;
+14 *) echo bad; return 1 ;;
+15 esac &&
+16 
+17 for i in 1 2 3 4 ; do
+18     git checkout main -b $i || return $?
+19     test_commit $i $i $i tag$i || return $?
+20 done
index e6b3b2193e869136e222ec582853ba3f17254e53..23c0caa7d8b328955c4965d89a7689b5261838c9 100644 (file)
@@ -1,9 +1,9 @@
-OUT=$( ((large_git; echo $? 1>&3) | :) 3>&1 ) &&
-test_match_signal 13 "$OUT" &&
-
-{ test-tool sigchain >actual; ret=$?; } &&
-{
-       test_match_signal 15 "$ret" ||
-       test "$ret" = 3
-} &&
-test_cmp expect actual
+OUT=$( ((large_git; echo $? 1>&3) | :) 3>&1 ) &&
+test_match_signal 13 "$OUT" &&
+4 
+{ test-tool sigchain >actual; ret=$?; } &&
+{
+7      test_match_signal 15 "$ret" ||
+8      test "$ret" = 3
+} &&
+10 test_cmp expect actual
index 574cdceb071804481449a40820d51fa2a8a812b9..a546b714a69c4960ac75a228a9aa6fe5f5634030 100644 (file)
@@ -1,9 +1,9 @@
-echo nobody home && {
-       test the doohicky ?!AMP?!
-       right now
-} &&
-
-GIT_EXTERNAL_DIFF=echo git diff | {
-       read path oldfile oldhex oldmode newfile newhex newmode &&
-       test "z$oh" = "z$oldhex"
-}
+echo nobody home && {
+3      test the doohicky ?!AMP?!
+4      right now
+} &&
+6 
+GIT_EXTERNAL_DIFF=echo git diff | {
+8      read path oldfile oldhex oldmode newfile newhex newmode &&
+9      test "z$oh" = "z$oldhex"
+10 }
index 83810ea7ec7d34d439c69b12bbfe2d70be16e3df..f78b268291c7ac1dbad6241a1bb315b6fc288d1c 100644 (file)
@@ -1,10 +1,10 @@
-mkdir sub && (
-       cd sub &&
-       foo the bar ?!AMP?!
-       nuff said
-) &&
-
-cut "-d " -f actual | (read s1 s2 s3 &&
-test -f $s1 ?!AMP?!
-test $(cat $s2) = tree2path1 &&
-test $(cat $s3) = tree3path1)
+mkdir sub && (
+3      cd sub &&
+4      foo the bar ?!AMP?!
+5      nuff said
+) &&
+7 
+cut "-d " -f actual | (read s1 s2 s3 &&
+test -f $s1 ?!AMP?!
+10 test $(cat $s2) = tree2path1 &&
+11 test $(cat $s3) = tree3path1)
index 72d482f76dd20f0d2ca7bbffd177417a257992e2..4167e54a597ab80034ce02e1537b016ebf914593 100644 (file)
@@ -1,3 +1,3 @@
-(cd foo &&
-       (bar &&
-               baz))
+(cd foo &&
+3      (bar &&
+4              baz))
index 2192a2870a1ae3d098c78126eb06608f74a32437..a272cfe72e0f5c184f676b3818222e0b4c9fa857 100644 (file)
@@ -1,26 +1,26 @@
-(
-       foo
-) &&
-(
-       bar
-) >out &&
-(
-       baz
-) 2>err &&
-(
-       boo
-) <input &&
-(
-       bip
-) | wuzzle &&
-(
-       bop
-) | fazz \
-       fozz &&
-(
-       bup
-) |
-fuzzle &&
-(
-       yop
-)
+(
+3      foo
+) &&
+(
+6      bar
+) >out &&
+(
+9      baz
+10 ) 2>err &&
+11 (
+12     boo
+13 ) <input &&
+14 (
+15     bip
+16 ) | wuzzle &&
+17 (
+18     bop
+19 ) | fazz \
+20     fozz &&
+21 (
+22     bup
+23 ) |
+24 fuzzle &&
+25 (
+26     yop
+27 )
index ec42f2c30c98630ef0538936bbaa5f96c0fa7626..f2a9312dc8f2f0963c428ed23e2a7ddd2f946ff2 100644 (file)
@@ -1,2 +1,2 @@
-OUT=$( ((large_git 1>&3) | :) 3>&1 ) &&
-test_match_signal 13 "$OUT"
+OUT=$( ((large_git 1>&3) | :) 3>&1 ) &&
+test_match_signal 13 "$OUT"
index c72e4df9e709d1e26f393d6e2d906626d94aa3a3..5e31b36db65bb9ffda850039f50b03dbd86a9ea5 100644 (file)
@@ -1,9 +1,9 @@
-(
-       foo &&
-       bar=$(gobble) &&
-       baz
-) &&
-(
-       bar=$(gobble blocks) ?!AMP?!
-       baz
-)
+(
+3      foo &&
+4      bar=$(gobble) &&
+5      baz
+) &&
+(
+8      bar=$(gobble blocks) ?!AMP?!
+9      baz
+10 )
index a68f1f9d7c26745169ab4c45b3e6f5f7c5b3c6b3..584098d6bad8a0d3bc99db0e713df7d4ee812d94 100644 (file)
@@ -1,8 +1,8 @@
-(
-       # comment 1
-       nothing &&
-       # comment 2
-       something
-       # comment 3
-       # comment 4
-)
+(
+3      # comment 1
+4      nothing &&
+5      # comment 2
+6      something
+7      # comment 3
+8      # comment 4
+)
index dac2d0fd1d9037e9ebed8be9439bbafe334a1960..3a740103db19f675c09d382da83b64f8d8647e36 100644 (file)
@@ -1,9 +1,9 @@
-(for i in a b c; do
-   if test "$(echo $(waffle bat))" = "eleventeen" &&
-     test "$x" = "$y"; then
-     :
-   else
-     echo >file
-   fi ?!LOOP?!
- done) &&
-test ! -f file
+(for i in a b c; do
+   if test "$(echo $(waffle bat))" = "eleventeen" &&
+     test "$x" = "$y"; then
+     :
+   else
+     echo >file
+   fi ?!LOOP?!
+ done) &&
+10 test ! -f file
index 1d8ed58c4948ea2b975de2742ccad603f48042dc..72da8794cbbc36b53685ff4173771d256388d51e 100644 (file)
@@ -1,6 +1,6 @@
-(if test -z ""; then
-    echo empty
- else
-    echo bizzy
- fi) &&
-echo foobar
+(if test -z ""; then
+    echo empty
+ else
+    echo bizzy
+ fi) &&
+echo foobar
index 9cf260708e6a5c07282f37a03560781db8504ec0..c38585c756764b6d75a0afa9ad3458bc94cd7547 100644 (file)
@@ -1,4 +1,4 @@
-( while read x
-  do foobar bop || exit 1
-  done <file ) &&
-outside subshell
+( while read x
+  do foobar bop || exit 1
+  done <file ) &&
+outside subshell
index c3e0be404742cb62808ffa43026573dbe5cb9cd1..b06d6383116c351aa56669e76861d7d33fb820e4 100644 (file)
@@ -1,17 +1,17 @@
-(cd foo &&
-       bar
-) &&
-
-(cd foo ?!AMP?!
-       bar
-) &&
-
-(
-       cd foo &&
-       bar) &&
-
-(cd foo &&
-       bar) &&
-
-(cd foo ?!AMP?!
-       bar)
+(cd foo &&
+3      bar
+) &&
+5 
+(cd foo ?!AMP?!
+7      bar
+) &&
+9 
+10 (
+11     cd foo &&
+12     bar) &&
+13 
+14 (cd foo &&
+15     bar) &&
+16 
+17 (cd foo ?!AMP?!
+18     bar)
index cd584a435730045608f1ce9162274fb6fa53a2c8..48c04ecd58c405fd159a91bf74f13300c2d3232e 100644 (file)
@@ -1,12 +1,12 @@
-run_sub_test_lib_test_err run-inv-range-start \
-       "--run invalid range start" \
-       --run="a-5" <<-\EOF &&
-test_expect_success "passing test #1" "true"
-test_done
-EOF
-check_sub_test_lib_test_err run-inv-range-start \
-       <<-\EOF_OUT 3<<-EOF_ERR
-> FATAL: Unexpected exit with code 1
-EOF_OUT
-> error: --run: invalid non-numeric in range start: ${SQ}a-5${SQ}
-EOF_ERR
+run_sub_test_lib_test_err run-inv-range-start \
+3      "--run invalid range start" \
+4      --run="a-5" <<-\EOF &&
+test_expect_success "passing test #1" "true"
+test_done
+EOF
+check_sub_test_lib_test_err run-inv-range-start \
+9      <<-\EOF_OUT 3<<-EOF_ERR
+10 > FATAL: Unexpected exit with code 1
+11 EOF_OUT
+12 > error: --run: invalid non-numeric in range start: ${SQ}a-5${SQ}
+13 EOF_ERR
index 37eab80738e4018e48b966cb9933ca332ae71f5e..2ca1c92cd6d38a9530e0de742bf65b9861fad4cd 100644 (file)
@@ -1,5 +1,5 @@
-
-echo 'fatal: reword option of --fixup is mutually exclusive with'      '--patch/--interactive/--all/--include/--only' >expect &&
-test_must_fail git commit --fixup=reword:HEAD~ $1 2>actual &&
-test_cmp expect actual
-
+2 
+3 echo 'fatal: reword option of --fixup is mutually exclusive with'    '--patch/--interactive/--all/--include/--only' >expect &&
+test_must_fail git commit --fixup=reword:HEAD~ $1 2>actual &&
+test_cmp expect actual
+6 
index 087eda15e49144a9cbe24f9fc526f489b63aa068..c9f75849c57bdfefde66eb08f5710e571fdd2522 100644 (file)
@@ -1,12 +1,12 @@
-grep "^ ! [rejected][ ]*$BRANCH -> $BRANCH (non-fast-forward)$" out &&
-
-grep "^\.git$" output.txt &&
-
-
-(
-       cd client$version &&
-       GIT_TEST_PROTOCOL_VERSION=$version git fetch-pack --no-progress .. $(cat ../input)
-) >output &&
-       cut -d ' ' -f 2 <output | sort >actual &&
-       test_cmp expect actual
-
+grep "^ ! [rejected][ ]*$BRANCH -> $BRANCH (non-fast-forward)$" out &&
+3 
+grep "^\.git$" output.txt &&
+5 
+6 
+(
+8      cd client$version &&
+9      GIT_TEST_PROTOCOL_VERSION=$version git fetch-pack --no-progress .. $(cat ../input)
+10 ) >output &&
+11     cut -d ' ' -f 2 <output | sort >actual &&
+12     test_cmp expect actual
+13 
index 8507721192aeb4b5486ca7e7ddd2ecd7a484ebe0..54b33f823a73292943671f2fb89bbd1b49e33a80 100644 (file)
@@ -1,4 +1,4 @@
-git ls-tree $tree path >current &&
-cat >expected <<\EOF &&
-EOF
-test_output
+git ls-tree $tree path >current &&
+cat >expected <<\EOF &&
+EOF
+test_output
index 765a35bb4c47e31d369e481a3531ab7eaec2b097..078744b61b5dcf95920157539307f14a5fda14b6 100644 (file)
@@ -1,4 +1,4 @@
-if ! condition; then echo nope; else yep; fi &&
-test_prerequisite !MINGW &&
-mail uucp!address &&
-echo !whatever!
+if ! condition; then echo nope; else yep; fi &&
+test_prerequisite !MINGW &&
+mail uucp!address &&
+echo !whatever!
index f76aa60466adaf394b2e368e5feb3b54e23b30f8..407278094cdb1e0e08003071a357ea5e9798c5d0 100644 (file)
@@ -1,24 +1,24 @@
-(
-       for i in a b c
-       do
-               foo || exit 1
-               bar &&
-               baz
-       done
-) &&
-(
-       while true
-       do
-               foo || exit 1
-               bar &&
-               baz
-       done
-) &&
-(
-       i=0 &&
-       while test $i -lt 10
-       do
-               echo $i || exit
-               i=$(($i + 1))
-       done
-)
+(
+3      for i in a b c
+4      do
+5              foo || exit 1
+6              bar &&
+7              baz
+8      done
+) &&
+10 (
+11     while true
+12     do
+13             foo || exit 1
+14             bar &&
+15             baz
+16     done
+17 ) &&
+18 (
+19     i=0 &&
+20     while test $i -lt 10
+21     do
+22             echo $i || exit
+23             i=$(($i + 1))
+24     done
+25 )
index da80339f781230c19bc7203603d6310454dba4a9..793db12453bb6b49e8e61a5d5aba75bb0255564b 100644 (file)
@@ -1,5 +1,5 @@
-(
-       foo || exit 1
-       bar &&
-       baz
-)
+(
+3      foo || exit 1
+4      bar &&
+5      baz
+)
index 02c0d15cca5cd42d7909f9fccbb95a932e217953..55748319761c4683349c722aafd6b0d7b163cd2b 100644 (file)
@@ -1,5 +1,5 @@
-for it
-do
-       path=$(expr "$it" : ([^:]*)) &&
-       git update-index --add "$path" || exit
-done
+for it
+do
+4      path=$(expr "$it" : ([^:]*)) &&
+5      git update-index --add "$path" || exit
+done
index d2237f1e38fad73938ff6335dac9de538e337caa..908aeedf96ef74b58ab9eabf2efc437b424d992f 100644 (file)
@@ -1,14 +1,14 @@
-(
-       for i in a b c
-       do
-               echo $i ?!AMP?!
-               cat <<-\EOF ?!LOOP?!
-               bar
-               EOF
-       done ?!AMP?!
-
-       for i in a b c; do
-               echo $i &&
-               cat $i ?!LOOP?!
-       done
-)
+(
+3      for i in a b c
+4      do
+5              echo $i ?!AMP?!
+6              cat <<-\EOF ?!LOOP?!
+7              bar
+8              EOF
+9      done ?!AMP?!
+10 
+11     for i in a b c; do
+12             echo $i &&
+13             cat $i ?!LOOP?!
+14     done
+15 )
index dd7c997a3c340d633d9cbf7a78f4b29727a22ce4..c226246b2595fa87c81e62ae508c75cef25676a4 100644 (file)
@@ -1,11 +1,11 @@
-sha1_file() {
-       echo "$*" | sed "s#..#.git/objects/&/#"
-} &&
-
-remove_object() {
-       file=$(sha1_file "$*") &&
-       test -e "$file" ?!AMP?!
-       rm -f "$file"
-} ?!AMP?!
-
-sha1_file arg && remove_object arg
+sha1_file() {
+3      echo "$*" | sed "s#..#.git/objects/&/#"
+} &&
+5 
+remove_object() {
+7      file=$(sha1_file "$*") &&
+8      test -e "$file" ?!AMP?!
+9      rm -f "$file"
+10 } ?!AMP?!
+11 
+12 sha1_file arg && remove_object arg
index 7d9c2b560701f66eb854b1b31c8b3820347f7eb1..965813f46390ba9e71ddd248089d29789c06a963 100644 (file)
@@ -1,4 +1,4 @@
-(
-       cat <<-\INPUT)
-       fizz
-       INPUT
+(
+3      cat <<-\INPUT)
+4      fizz
+5      INPUT
index f92a7ce9992420e2e5483ddcd83d3118d5dfd516..277a11202d7b131456f71cddebdb52ad9e627e10 100644 (file)
@@ -1,11 +1,11 @@
-cat >expect <<- EOF &&
-header: 43475048 1 $(test_oid oid_version) $NUM_CHUNKS 0
-num_commits: $1
-chunks: oid_fanout oid_lookup commit_metadata generation_data bloom_indexes bloom_data
-EOF
-
-cat >expect << -EOF ?!AMP?!
-this is not indented
--EOF
-
-cleanup
+cat >expect <<- EOF &&
+header: 43475048 1 $(test_oid oid_version) $NUM_CHUNKS 0
+num_commits: $1
+chunks: oid_fanout oid_lookup commit_metadata generation_data bloom_indexes bloom_data
+EOF
+7 
+cat >expect << -EOF ?!AMP?!
+this is not indented
+10 -EOF
+11 
+12 cleanup
index b7364c82c89feba3baf9a149937f1e43bf91ff23..41b55f6437303b70cd21dc8b66d4306ddb1d3ff4 100644 (file)
@@ -1,8 +1,8 @@
-(
-       x=$(bobble <<-\END &&
-               fossil
-               vegetable
-               END
-               wiffle) ?!AMP?!
-       echo $x
-)
+(
+3      x=$(bobble <<-\END &&
+4              fossil
+5              vegetable
+6              END
+7              wiffle) ?!AMP?!
+8      echo $x
+)
index 6c13bdcbfb5d12500ffc01915b853d0169abf13e..c71828589e57c691dfb47105f2464928e503eea8 100644 (file)
@@ -1,7 +1,7 @@
-(
-       cat <<-\TXT && echo "multi-line
-       string" ?!AMP?!
-       fizzle
-       TXT
-       bap
-)
+(
+3      cat <<-\TXT && echo "multi-line
+4      string" ?!AMP?!
+5      fizzle
+6      TXT
+7      bap
+)
index 91b961242a1cabb7cc3f5edecaa6d99eb3eeef9e..2c382dd8eb359ff32412cfa85a800b3422c999cc 100644 (file)
@@ -1,25 +1,25 @@
-boodle wobba \
-       gorgo snoot \
-       wafta snurb <<EOF &&
-quoth the raven,
-nevermore...
-EOF
-
-cat <<-Arbitrary_Tag_42 >foo &&
-snoz
-boz
-woz
-Arbitrary_Tag_42
-
-cat <<"zump" >boo &&
-snoz
-boz
-woz
-zump
-
-horticulture <<\EOF
-gomez
-morticia
-wednesday
-pugsly
-EOF
+boodle wobba \
+       gorgo snoot \
+       wafta snurb <<EOF &&
+quoth the raven,
+nevermore...
+EOF
+8 
+cat <<-Arbitrary_Tag_42 >foo &&
+10 snoz
+11 boz
+12 woz
+13 Arbitrary_Tag_42
+14 
+15 cat <<"zump" >boo &&
+16 snoz
+17 boz
+18 woz
+19 zump
+20 
+21 horticulture <<\EOF
+22 gomez
+23 morticia
+24 wednesday
+25 pugsly
+26 EOF
index ee745ef8d7fcc585e77a85854254c7b6fe7bf160..9daf3d294af3288a829b5d8362e85600a3a41371 100644 (file)
@@ -1,7 +1,7 @@
-if bob &&
-   marcia ||
-   kevin
-then
-       echo "nomads" ?!AMP?!
-       echo "for sure"
-fi
+if bob &&
+   marcia ||
+   kevin
+then
+6      echo "nomads" ?!AMP?!
+7      echo "for sure"
+fi
index d6514ae74927ff4336279112d5570499a71d6b53..ff8c60dbdb026cd57216020e1506cf2378c6e4a7 100644 (file)
@@ -1,12 +1,12 @@
-(
-       for i in a b c
-       do
-               if false
-               then
-                       echo "err"
-                       exit 1
-               fi ?!AMP?!
-               foo
-       done ?!AMP?!
-       bar
-)
+(
+3      for i in a b c
+4      do
+5              if false
+6              then
+7                      echo "err"
+8                      exit 1
+9              fi ?!AMP?!
+10             foo
+11     done ?!AMP?!
+12     bar
+13 )
index cbaaf857d47a0bf23813933e768b6a9128670737..965d7e41a2ce75e520940dfa9b4e489f261a9449 100644 (file)
@@ -1,22 +1,22 @@
-(
-       if test -n ""
-       then
-               echo very ?!AMP?!
-               echo empty
-       elif test -z ""
-       then
-               echo foo
-       else
-               echo foo &&
-               cat <<-\EOF
-               bar
-               EOF
-       fi ?!AMP?!
-       echo poodle
-) &&
-(
-       if test -n ""; then
-               echo very &&
-               echo empty
-       fi
-)
+(
+3      if test -n ""
+4      then
+5              echo very ?!AMP?!
+6              echo empty
+7      elif test -z ""
+8      then
+9              echo foo
+10     else
+11             echo foo &&
+12             cat <<-\EOF
+13             bar
+14             EOF
+15     fi ?!AMP?!
+16     echo poodle
+17 ) &&
+18 (
+19     if test -n ""; then
+20             echo very &&
+21             echo empty
+22     fi
+23 )
index 134d3a14f5c0c1efc51e21fe1fa29b52b5f9a0ab..b15e00b901facdf38672759979e501a4bad4aa3f 100644 (file)
@@ -1,10 +1,10 @@
-line 1 \
-line 2 \
-line 3 \
-line 4 &&
-(
-       line 5 \
-       line 6 \
-       line 7 \
-       line 8
-)
+line 1 \
+line 2 \
+line 3 \
+line 4 &&
+(
+7      line 5 \
+8      line 6 \
+9      line 7 \
+10     line 8
+11 )
index 6bad21853006d38834bf1b4ebc2da46e3c6faebc..0285c0b22c9802aa7418c5518c529dce53c6cf33 100644 (file)
@@ -1,8 +1,8 @@
-(
-       foobar && # comment 1
-       barfoo ?!AMP?! # wrong position for &&
-       flibble "not a # comment"
-) &&
-
-(cd foo &&
-       flibble "not a # comment")
+(
+3      foobar && # comment 1
+4      barfoo ?!AMP?! # wrong position for &&
+5      flibble "not a # comment"
+) &&
+7 
+(cd foo &&
+9      flibble "not a # comment")
index a66025c39d4fca4c5c6441925dc65eaf7f873c17..40c06f0d5397abc5c977e5f91d479d0f400cea2f 100644 (file)
@@ -1,15 +1,15 @@
-git init r1 &&
-for n in 1 2 3 4 5
-do
-       echo "This is file: $n" > r1/file.$n &&
-       git -C r1 add file.$n &&
-       git -C r1 commit -m "$n" || return 1
-done &&
-
-git init r2 &&
-for n in 1000 10000
-do
-       printf "%"$n"s" X > r2/large.$n &&
-       git -C r2 add large.$n &&
-       git -C r2 commit -m "$n" ?!LOOP?!
-done
+git init r1 &&
+for n in 1 2 3 4 5
+do
+5      echo "This is file: $n" > r1/file.$n &&
+6      git -C r1 add file.$n &&
+7      git -C r1 commit -m "$n" || return 1
+done &&
+9 
+10 git init r2 &&
+11 for n in 1000 10000
+12 do
+13     printf "%"$n"s" X > r2/large.$n &&
+14     git -C r2 add large.$n &&
+15     git -C r2 commit -m "$n" ?!LOOP?!
+16 done
index 7ce3a348060dcfaf91299282eb4eee2b471f58bc..0f180b08deeb799c61162784d58dbd4e35a917ee 100644 (file)
@@ -1,18 +1,18 @@
-(while test $i -le $blobcount
- do
-       printf "Generating blob $i/$blobcount\r" >&2 &&
-       printf "blob\nmark :$i\ndata $blobsize\n" &&
-       #test-tool genrandom $i $blobsize &&
-       printf "%-${blobsize}s" $i &&
-       echo "M 100644 :$i $i" >> commit &&
-       i=$(($i+1)) ||
-       echo $? > exit-status
- done &&
- echo "commit refs/heads/main" &&
- echo "author A U Thor <author@email.com> 123456789 +0000" &&
- echo "committer C O Mitter <committer@email.com> 123456789 +0000" &&
- echo "data 5" &&
- echo ">2gb" &&
- cat commit) |
-git fast-import --big-file-threshold=2 &&
-test ! -f exit-status
+(while test $i -le $blobcount
+ do
+4      printf "Generating blob $i/$blobcount\r" >&2 &&
+5      printf "blob\nmark :$i\ndata $blobsize\n" &&
+6      #test-tool genrandom $i $blobsize &&
+7      printf "%-${blobsize}s" $i &&
+8      echo "M 100644 :$i $i" >> commit &&
+9      i=$(($i+1)) ||
+10     echo $? > exit-status
+11  done &&
+12  echo "commit refs/heads/main" &&
+13  echo "author A U Thor <author@email.com> 123456789 +0000" &&
+14  echo "committer C O Mitter <committer@email.com> 123456789 +0000" &&
+15  echo "data 5" &&
+16  echo ">2gb" &&
+17  cat commit) |
+18 git fast-import --big-file-threshold=2 &&
+19 test ! -f exit-status
index 6c5d6e5b2438ef826b15b45de67544f72f633543..4e8c67c91493a6ed80f26ffc868c20438329fadc 100644 (file)
@@ -1,12 +1,12 @@
-(
-       if true
-       then
-               while true
-               do
-                       echo "pop" ?!AMP?!
-                       echo "glup" ?!LOOP?!
-               done ?!AMP?!
-               foo
-       fi ?!AMP?!
-       bar
-)
+(
+3      if true
+4      then
+5              while true
+6              do
+7                      echo "pop" ?!AMP?!
+8                      echo "glup" ?!LOOP?!
+9              done ?!AMP?!
+10             foo
+11     fi ?!AMP?!
+12     bar
+13 )
index 0b82ecc4b96feeaa5aa81c294c2be045cf96a065..bef82479cadf39a44273d192baa43306c17747e8 100644 (file)
@@ -1,10 +1,10 @@
-(
-       git rev-list --objects --no-object-names base..loose |
-       while read oid
-       do
-               path="$objdir/$(test_oid_to_path "$oid")" &&
-               printf "%s %d\n" "$oid" "$(test-tool chmtime --get "$path")" ||
-               echo "object list generation failed for $oid"
-       done |
-       sort -k1
-) >expect &&
+(
+3      git rev-list --objects --no-object-names base..loose |
+4      while read oid
+5      do
+6              path="$objdir/$(test_oid_to_path "$oid")" &&
+7              printf "%s %d\n" "$oid" "$(test-tool chmtime --get "$path")" ||
+8              echo "object list generation failed for $oid"
+9      done |
+10     sort -k1
+11 ) >expect &&
index 300058341b6f303dce9d8e8105b6f16fa25f2ebf..ad27e43e057ba37e1dc0f832f0a7b66e7a3bb548 100644 (file)
@@ -1,18 +1,18 @@
-(
-       foo &&
-       x=$(
-               echo bar |
-               cat
-       ) &&
-       echo ok
-) |
-sort &&
-(
-       bar &&
-       x=$(echo bar |
-               cat
-       ) &&
-       y=$(echo baz |
-               fip) &&
-       echo fail
-)
+(
+3      foo &&
+4      x=$(
+5              echo bar |
+6              cat
+7      ) &&
+8      echo ok
+) |
+10 sort &&
+11 (
+12     bar &&
+13     x=$(echo bar |
+14             cat
+15     ) &&
+16     y=$(echo baz |
+17             fip) &&
+18     echo fail
+19 )
index 27ff95218e7f64ec7f4e816ba73174b77cb98ef2..62c54e3a5e879f870bc0e554d481fc51dc304808 100644 (file)
@@ -1,14 +1,14 @@
-(
-       x="line 1
-               line 2
-               line 3" &&
-       y="line 1
-               line2" ?!AMP?!
-       foobar
-) &&
-(
-       echo "xyz" "abc
-               def
-               ghi" &&
-       barfoo
-)
+(
+3      x="line 1
+4              line 2
+5              line 3" &&
+6      y="line 1
+7              line2" ?!AMP?!
+8      foobar
+) &&
+10 (
+11     echo "xyz" "abc
+12             def
+13             ghi" &&
+14     barfoo
+15 )
index ad4c2d949ebf5de221876bd83795c6caee1a4aa2..a6ce52a1da809c8b37e92942df96d3bb1095070f 100644 (file)
@@ -1,5 +1,5 @@
-! (foo && bar) &&
-! (foo && bar) >baz &&
-
-! (foo; ?!AMP?! bar) &&
-! (foo; ?!AMP?! bar) >baz
+! (foo && bar) &&
+! (foo && bar) >baz &&
+4 
+! (foo; ?!AMP?! bar) &&
+! (foo; ?!AMP?! bar) >baz
index 3836049cc4190e4a37c35511279cd3fd36040b65..0191c9c2948b43245d17a8f6ea2638af1308a6c8 100644 (file)
@@ -1,25 +1,25 @@
-(
-       (cd foo &&
-               bar
-       ) &&
-
-       (cd foo &&
-               bar
-       ) ?!AMP?!
-
-       (
-               cd foo &&
-               bar) &&
-
-       (
-               cd foo &&
-               bar) ?!AMP?!
-
-       (cd foo &&
-               bar) &&
-
-       (cd foo &&
-               bar) ?!AMP?!
-
-       foobar
-)
+(
+3      (cd foo &&
+4              bar
+5      ) &&
+6 
+7      (cd foo &&
+8              bar
+9      ) ?!AMP?!
+10 
+11     (
+12             cd foo &&
+13             bar) &&
+14 
+15     (
+16             cd foo &&
+17             bar) ?!AMP?!
+18 
+19     (cd foo &&
+20             bar) &&
+21 
+22     (cd foo &&
+23             bar) ?!AMP?!
+24 
+25     foobar
+26 )
index 29b3832a986af30d7026eef513cf01dc769316a2..70d9b68dc95681d4218f854191f654c84bd1d2ed 100644 (file)
@@ -1,30 +1,30 @@
-cat <<ARBITRARY >foop &&
-naddle
-fub <<EOF
-       nozzle
-       noodle
-EOF
-formp
-ARBITRARY
-
-(
-       cat <<-\INPUT_END &&
-       fish are mice
-       but geese go slow
-       data <<EOF
-               perl is lerp
-               and nothing else
-       EOF
-       toink
-       INPUT_END
-
-       cat <<-\EOT ?!AMP?!
-       text goes here
-       data <<EOF
-               data goes here
-       EOF
-       more test here
-       EOT
-
-       foobar
-)
+cat <<ARBITRARY >foop &&
+naddle
+fub <<EOF
+5      nozzle
+6      noodle
+EOF
+formp
+ARBITRARY
+10 
+11 (
+12     cat <<-\INPUT_END &&
+13     fish are mice
+14     but geese go slow
+15     data <<EOF
+16             perl is lerp
+17             and nothing else
+18     EOF
+19     toink
+20     INPUT_END
+21 
+22     cat <<-\EOT ?!AMP?!
+23     text goes here
+24     data <<EOF
+25             data goes here
+26     EOF
+27     more test here
+28     EOT
+29 
+30     foobar
+31 )
index 3461df40e5129423ab58d92f84518d145f2f8b5d..c13c4d2f90afc5ff2ded16244c61366d0fef274e 100644 (file)
@@ -1,31 +1,31 @@
-for i in 0 1 2 3 4 5 6 7 8 9;
-do
-       for j in 0 1 2 3 4 5 6 7 8 9;
-       do
-               echo "$i$j" >"path$i$j" ?!LOOP?!
-       done ?!LOOP?!
-done &&
-
-for i in 0 1 2 3 4 5 6 7 8 9;
-do
-       for j in 0 1 2 3 4 5 6 7 8 9;
-       do
-               echo "$i$j" >"path$i$j" || return 1
-       done
-done &&
-
-for i in 0 1 2 3 4 5 6 7 8 9;
-do
-       for j in 0 1 2 3 4 5 6 7 8 9;
-       do
-               echo "$i$j" >"path$i$j" ?!LOOP?!
-       done || return 1
-done &&
-
-for i in 0 1 2 3 4 5 6 7 8 9;
-do
-       for j in 0 1 2 3 4 5 6 7 8 9;
-       do
-               echo "$i$j" >"path$i$j" || return 1
-       done || return 1
-done
+for i in 0 1 2 3 4 5 6 7 8 9;
+do
+4      for j in 0 1 2 3 4 5 6 7 8 9;
+5      do
+6              echo "$i$j" >"path$i$j" ?!LOOP?!
+7      done ?!LOOP?!
+done &&
+9 
+10 for i in 0 1 2 3 4 5 6 7 8 9;
+11 do
+12     for j in 0 1 2 3 4 5 6 7 8 9;
+13     do
+14             echo "$i$j" >"path$i$j" || return 1
+15     done
+16 done &&
+17 
+18 for i in 0 1 2 3 4 5 6 7 8 9;
+19 do
+20     for j in 0 1 2 3 4 5 6 7 8 9;
+21     do
+22             echo "$i$j" >"path$i$j" ?!LOOP?!
+23     done || return 1
+24 done &&
+25 
+26 for i in 0 1 2 3 4 5 6 7 8 9;
+27 do
+28     for j in 0 1 2 3 4 5 6 7 8 9;
+29     do
+30             echo "$i$j" >"path$i$j" || return 1
+31     done || return 1
+32 done
index 9138cf386d359267143945d13c1882b0feb5c6f4..f89a8d03a85304fc04e1985616f7c35978177ec5 100644 (file)
@@ -1,11 +1,11 @@
-(
-       foo &&
-       (
-               bar &&
-               # bottles wobble while fiddles gobble
-               # minor numbers of cows (or do they?)
-               baz &&
-               snaff
-       ) ?!AMP?!
-       fuzzy
-)
+(
+3      foo &&
+4      (
+5              bar &&
+6              # bottles wobble while fiddles gobble
+7              # minor numbers of cows (or do they?)
+8              baz &&
+9              snaff
+10     ) ?!AMP?!
+11     fuzzy
+12 )
index 73ff28546ae720bd7ce8e15cd9597e27e6afae41..811e8a79129ec50aa8a881135bb3e66594f1c2e1 100644 (file)
@@ -1,13 +1,13 @@
-(
-       cd foo &&
-       (
-               echo a &&
-               echo b
-       ) >file &&
-
-       cd foo &&
-       (
-               echo a ?!AMP?!
-               echo b
-       ) >file
-)
+(
+3      cd foo &&
+4      (
+5              echo a &&
+6              echo b
+7      ) >file &&
+8 
+9      cd foo &&
+10     (
+11             echo a ?!AMP?!
+12             echo b
+13     ) >file
+14 )
index 2e9bb135fe72a61184f4275aeeb0fcdcde745c89..611b7b75cb1e6678fa27e364f6afbf437b65d71d 100644 (file)
@@ -1,14 +1,14 @@
-echo "<<<<<<< ours" &&
-echo ourside &&
-echo "=======" &&
-echo theirside &&
-echo ">>>>>>> theirs" &&
-
-(
-       echo "<<<<<<< ours" &&
-       echo ourside &&
-       echo "=======" &&
-       echo theirside &&
-       echo ">>>>>>> theirs" ?!AMP?!
-       poodle
-) >merged
+echo "<<<<<<< ours" &&
+echo ourside &&
+echo "=======" &&
+echo theirside &&
+echo ">>>>>>> theirs" &&
+7 
+(
+9      echo "<<<<<<< ours" &&
+10     echo ourside &&
+11     echo "=======" &&
+12     echo theirside &&
+13     echo ">>>>>>> theirs" ?!AMP?!
+14     poodle
+15 ) >merged
index 51a3dc7c5448e2d52e13623eb4e080a04ab13b1f..49dcf065efb00a7d2310148f302718c780ffd0ae 100644 (file)
@@ -1,9 +1,9 @@
-git init dir-rename-and-content &&
-(
-       cd dir-rename-and-content &&
-       test_write_lines 1 2 3 4 5 >foo &&
-       mkdir olddir &&
-       for i in a b c; do echo $i >olddir/$i; ?!LOOP?! done ?!AMP?!
-       git add foo olddir &&
-       git commit -m "original" &&
-)
+git init dir-rename-and-content &&
+(
+4      cd dir-rename-and-content &&
+5      test_write_lines 1 2 3 4 5 >foo &&
+6      mkdir olddir &&
+7      for i in a b c; do echo $i >olddir/$i; ?!LOOP?! done ?!AMP?!
+8      git add foo olddir &&
+9      git commit -m "original" &&
+10 )
index 57a7a444c15033cd817502ea4ce9c4b833567acb..986181128383d3fc90584c10c7050f36cde5f6e2 100644 (file)
@@ -1,9 +1,9 @@
-(foo && bar) &&
-(foo && bar) |
-(foo && bar) >baz &&
-
-(foo; ?!AMP?! bar) &&
-(foo; ?!AMP?! bar) |
-(foo; ?!AMP?! bar) >baz &&
-
-(foo "bar; baz")
+(foo && bar) &&
+(foo && bar) |
+(foo && bar) >baz &&
+5 
+(foo; ?!AMP?! bar) &&
+(foo; ?!AMP?! bar) |
+(foo; ?!AMP?! bar) >baz &&
+9 
+10 (foo "bar; baz")
index 1290fd1ff27153f8b2daabb1e5fdec711b530ab2..cff3e4e3d19e8db94e072afc430fefed08232f4f 100644 (file)
@@ -1,4 +1,4 @@
-(
-       p4 print -1 //depot/fiddle#42 >file &&
-       foobar
-)
+(
+3      p4 print -1 //depot/fiddle#42 >file &&
+4      foobar
+)
index 811971b1a3c495da2adf0064c24007c6a7bf913d..1bbe5a2ce172c05e9b6231e2180d0426b3eca4e3 100644 (file)
@@ -1,10 +1,10 @@
-(
-       foo |
-       bar |
-       baz &&
-
-       fish |
-       cow ?!AMP?!
-
-       sunder
-)
+(
+3      foo |
+4      bar |
+5      baz &&
+6 
+7      fish |
+8      cow ?!AMP?!
+9 
+10     sunder
+11 )
index cfc0549befe3ff36b5c725009f6aa0230eca29a4..da8f9abea38bf5555d77bc317e4df5266226a815 100644 (file)
@@ -1,5 +1,5 @@
-while test $i -lt $((num - 5))
-do
-       git notes add -m "notes for commit$i" HEAD~$i || return 1
-       i=$((i + 1))
-done
+while test $i -lt $((num - 5))
+do
+4      git notes add -m "notes for commit$i" HEAD~$i || return 1
+5      i=$((i + 1))
+done
index 3aa2259f36c172b1da6e67d6a533da8238db7830..866438310ca3387af7ca734fa0c82c3a53a78b40 100644 (file)
@@ -1,19 +1,19 @@
-(
-       cat foo ; ?!AMP?! echo bar ?!AMP?!
-       cat foo ; ?!AMP?! echo bar
-) &&
-(
-       cat foo ; ?!AMP?! echo bar &&
-       cat foo ; ?!AMP?! echo bar
-) &&
-(
-       echo "foo; bar" &&
-       cat foo; ?!AMP?! echo bar
-) &&
-(
-       foo;
-) &&
-(cd foo &&
-       for i in a b c; do
-               echo; ?!LOOP?!
-       done)
+(
+3      cat foo ; ?!AMP?! echo bar ?!AMP?!
+4      cat foo ; ?!AMP?! echo bar
+) &&
+(
+7      cat foo ; ?!AMP?! echo bar &&
+8      cat foo ; ?!AMP?! echo bar
+) &&
+10 (
+11     echo "foo; bar" &&
+12     cat foo; ?!AMP?! echo bar
+13 ) &&
+14 (
+15     foo;
+16 ) &&
+17 (cd foo &&
+18     for i in a b c; do
+19             echo; ?!LOOP?!
+20     done)
index cf0b591cf7d8e3fb173ab122a2ed5d928cf6c643..ba5d3c3a6db886b8f8991bf1e088ccce39396433 100644 (file)
@@ -1,4 +1,4 @@
-perl -e '
-       defined($_ = -s $_) or die for @ARGV;
-       exit 1 if $ARGV[0] <= $ARGV[1];
-' test-2-$packname_2.pack test-3-$packname_3.pack
+perl -e '
+3      defined($_ = -s $_) or die for @ARGV;
+4      exit 1 if $ARGV[0] <= $ARGV[1];
+' test-2-$packname_2.pack test-3-$packname_3.pack
index 75d6f607e295638e9e0c5029711357bc2e9d2fda..5647500c82ff7548ae950525e3cb4a57f4e1992d 100644 (file)
@@ -1,30 +1,30 @@
-(
-       echo wobba \
-              gorgo snoot \
-              wafta snurb <<-EOF &&
-       quoth the raven,
-       nevermore...
-       EOF
-
-       cat <<EOF >bip ?!AMP?!
-       fish fly high
-EOF
-
-       echo <<-\EOF >bop
-       gomez
-       morticia
-       wednesday
-       pugsly
-       EOF
-) &&
-(
-       cat <<-\ARBITRARY >bup &&
-       glink
-       FIZZ
-       ARBITRARY
-       cat <<-"ARBITRARY3" >bup3 &&
-       glink
-       FIZZ
-       ARBITRARY3
-       meep
-)
+(
+3      echo wobba \
+4             gorgo snoot \
+5             wafta snurb <<-EOF &&
+6      quoth the raven,
+7      nevermore...
+8      EOF
+9 
+10     cat <<EOF >bip ?!AMP?!
+11     fish fly high
+12 EOF
+13 
+14     echo <<-\EOF >bop
+15     gomez
+16     morticia
+17     wednesday
+18     pugsly
+19     EOF
+20 ) &&
+21 (
+22     cat <<-\ARBITRARY >bup &&
+23     glink
+24     FIZZ
+25     ARBITRARY
+26     cat <<-"ARBITRARY3" >bup3 &&
+27     glink
+28     FIZZ
+29     ARBITRARY3
+30     meep
+31 )
index 8f694990e8d9f1ce1205399f54b61436cfe4100c..214316c6a06d7c460c67675186bc34a4ef17ba5b 100644 (file)
@@ -1,19 +1,19 @@
-(
-       (foo && bar) &&
-       (foo && bar) |
-       (foo && bar) >baz &&
-
-       (foo; ?!AMP?! bar) &&
-       (foo; ?!AMP?! bar) |
-       (foo; ?!AMP?! bar) >baz &&
-
-       (foo || exit 1) &&
-       (foo || exit 1) |
-       (foo || exit 1) >baz &&
-
-       (foo && bar) ?!AMP?!
-
-       (foo && bar; ?!AMP?! baz) ?!AMP?!
-
-       foobar
-)
+(
+3      (foo && bar) &&
+4      (foo && bar) |
+5      (foo && bar) >baz &&
+6 
+7      (foo; ?!AMP?! bar) &&
+8      (foo; ?!AMP?! bar) |
+9      (foo; ?!AMP?! bar) >baz &&
+10 
+11     (foo || exit 1) &&
+12     (foo || exit 1) |
+13     (foo || exit 1) >baz &&
+14 
+15     (foo && bar) ?!AMP?!
+16 
+17     (foo && bar; ?!AMP?! baz) ?!AMP?!
+18 
+19     foobar
+20 )
index 02f3129232a0d114bf90211b9a6508385d0115bd..9e60338bcfaec4b4c137fbf6b6ebe7cbac4f187e 100644 (file)
@@ -1,22 +1,22 @@
-(
-       chks="sub1
-sub2
-sub3
-sub4" &&
-       chks_sub=$(cat <<TXT | sed "s,^,sub dir/,"
-$chks
-TXT
-) &&
-       chkms="main-sub1
-main-sub2
-main-sub3
-main-sub4" &&
-       chkms_sub=$(cat <<TXT | sed "s,^,sub dir/,"
-$chkms
-TXT
-) &&
-
-       subfiles=$(git ls-files) &&
-       check_equal "$subfiles" "$chkms
-$chks"
-)
+(
+3      chks="sub1
+sub2
+sub3
+sub4" &&
+7      chks_sub=$(cat <<TXT | sed "s,^,sub dir/,"
+$chks
+TXT
+10 ) &&
+11     chkms="main-sub1
+12 main-sub2
+13 main-sub3
+14 main-sub4" &&
+15     chkms_sub=$(cat <<TXT | sed "s,^,sub dir/,"
+16 $chkms
+17 TXT
+18 ) &&
+19 
+20     subfiles=$(git ls-files) &&
+21     check_equal "$subfiles" "$chkms
+22 $chks"
+23 )
index 6a387917a7af18bc39b70c91b091b91eb6a7ee82..64f3235d262b777a1e2567e469e02d8663544974 100644 (file)
@@ -1,27 +1,27 @@
-git config filter.rot13.smudge ./rot13.sh &&
-git config filter.rot13.clean ./rot13.sh &&
-
-{
-    echo "*.t filter=rot13" ?!AMP?!
-    echo "*.i ident"
-} >.gitattributes &&
-
-{
-    echo a b c d e f g h i j k l m ?!AMP?!
-    echo n o p q r s t u v w x y z ?!AMP?!
-    echo '$Id$'
-} >test &&
-cat test >test.t &&
-cat test >test.o &&
-cat test >test.i &&
-git add test test.t test.i &&
-rm -f test test.t test.i &&
-git checkout -- test test.t test.i &&
-
-echo "content-test2" >test2.o &&
-echo "content-test3 - filename with special characters" >"test3 'sq',$x=.o" ?!AMP?!
-
-downstream_url_for_sed=$(
-       printf "%sn" "$downstream_url" |
-       sed -e 's/\/\\/g' -e 's/[[/.*^$]/\&/g'
-)
+git config filter.rot13.smudge ./rot13.sh &&
+git config filter.rot13.clean ./rot13.sh &&
+4 
+{
+    echo "*.t filter=rot13" ?!AMP?!
+    echo "*.i ident"
+} >.gitattributes &&
+9 
+10 {
+11     echo a b c d e f g h i j k l m ?!AMP?!
+12     echo n o p q r s t u v w x y z ?!AMP?!
+13     echo '$Id$'
+14 } >test &&
+15 cat test >test.t &&
+16 cat test >test.o &&
+17 cat test >test.i &&
+18 git add test test.t test.i &&
+19 rm -f test test.t test.i &&
+20 git checkout -- test test.t test.i &&
+21 
+22 echo "content-test2" >test2.o &&
+23 echo "content-test3 - filename with special characters" >"test3 'sq',$x=.o" ?!AMP?!
+24 
+25 downstream_url_for_sed=$(
+26     printf "%sn" "$downstream_url" |
+27     sed -e 's/\/\\/g' -e 's/[[/.*^$]/\&/g'
+28 )
index 7c30a1a024ed3c29f04c85c175813eb3b7ead8f3..f78e23cb632fc74b43f961365cbffb04a7f74c72 100644 (file)
@@ -1,4 +1,4 @@
-command_which_is_run &&
-cat >expect <<-\EOF ?!UNCLOSED-HEREDOC?! &&
-we forget to end the here-doc
-command_which_is_gobbled
+command_which_is_run &&
+cat >expect <<-\EOF ?!UNCLOSED-HEREDOC?! &&
+we forget to end the here-doc
+command_which_is_gobbled
index d65e50f78d4e1d4b7797e841b4525f97553f4ebc..51304672cfffef738e768a780cc7d0303c3ded04 100644 (file)
@@ -1,7 +1,7 @@
-command_which_is_run &&
-cat >expect <<\EOF ?!UNCLOSED-HEREDOC?! &&
-       we try to end the here-doc below,
-       but the indentation throws us off
-       since the operator is not "<<-".
-       EOF
-command_which_is_gobbled
+command_which_is_run &&
+cat >expect <<\EOF ?!UNCLOSED-HEREDOC?! &&
+4      we try to end the here-doc below,
+5      but the indentation throws us off
+6      since the operator is not "<<-".
+7      EOF
+command_which_is_gobbled
index 06c1567f481e8cbc21cf50fdf58bfb9a502d439e..5ffabd5a93fca9a598e5310d4bb5e0aad2291c9d 100644 (file)
@@ -1,14 +1,14 @@
-(
-       while true
-       do
-               echo foo ?!AMP?!
-               cat <<-\EOF ?!LOOP?!
-               bar
-               EOF
-       done ?!AMP?!
-
-       while true; do
-               echo foo &&
-               cat bar ?!LOOP?!
-       done
-)
+(
+3      while true
+4      do
+5              echo foo ?!AMP?!
+6              cat <<-\EOF ?!LOOP?!
+7              bar
+8              EOF
+9      done ?!AMP?!
+10 
+11     while true; do
+12             echo foo &&
+13             cat bar ?!LOOP?!
+14     done
+15 )