git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 2/9] t3905: remove spaces after redirect operators

From
Denton Liu <liu.denton@gmail.com>
Date
Feb 9, 2021, 07:28 UTC
Message-ID
<45ed17bfe2dad4702904a07a4a77a8d219df8379.1612855690.git.liu.denton@gmail.com>
In-Reply-To
<cover.1612855690.git.liu.denton@gmail.com>

For shell scripts, the usual convention is for there to be no space after redirection operators, (e.g. `>file`, not `> file`). Remove these spaces wherever they appear.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
---
 t/t3905-stash-include-untracked.sh | 40 +++++++++++++++---------------
 1 file changed, 20 insertions(+), 20 deletions(-)
diff --git a/t/t3905-stash-include-untracked.sh b/t/t3905-stash-include-untracked.sh
index f075c7f1f3..1d416944b7 100755
--- a/t/t3905-stash-include-untracked.sh
+++ b/t/t3905-stash-include-untracked.sh
@@ -8,16 +8,16 @@ test_description='Test git stash --include-untracked'
 . ./test-lib.sh
 
 test_expect_success 'stash save --include-untracked some dirty working directory' '
-	echo 1 > file &&
+	echo 1 >file &&
 	git add file &&
 	test_tick &&
 	git commit -m initial &&
-	echo 2 > file &&
+	echo 2 >file &&
 	git add file &&
-	echo 3 > file &&
+	echo 3 >file &&
 	test_tick &&
-	echo 1 > file2 &&
-	echo 1 > HEAD &&
+	echo 1 >file2 &&
+	echo 1 >HEAD &&
 	mkdir untracked &&
 	echo untracked >untracked/untracked &&
 	git stash --include-untracked &&
@@ -25,7 +25,7 @@ test_expect_success 'stash save --include-untracked some dirty working directory
 	git diff-index --cached --quiet HEAD
 '
 
-cat > expect <<EOF
+cat >expect <<EOF
 ?? actual
 ?? expect
 EOF
@@ -37,7 +37,7 @@ test_expect_success 'stash save --include-untracked cleaned the untracked files'
 
 tracked=$(git rev-parse --short $(echo 1 | git hash-object --stdin))
 untracked=$(git rev-parse --short $(echo untracked | git hash-object --stdin))
-cat > expect.diff <<EOF
+cat >expect.diff <<EOF
 diff --git a/HEAD b/HEAD
 new file mode 100644
 index 0000000..$tracked
@@ -60,7 +60,7 @@ index 0000000..$untracked
 @@ -0,0 +1 @@
 +untracked
 EOF
-cat > expect.lstree <<EOF
+cat >expect.lstree <<EOF
 HEAD
 file2
 untracked
@@ -85,7 +85,7 @@ test_expect_success 'stash save --patch --all fails' '
 
 git clean --force --quiet
 
-cat > expect <<EOF
+cat >expect <<EOF
  M file
 ?? HEAD
 ?? actual
@@ -105,14 +105,14 @@ test_expect_success 'stash pop after save --include-untracked leaves files untra
 git clean --force --quiet -d
 
 test_expect_success 'stash save -u dirty index' '
-	echo 4 > file3 &&
+	echo 4 >file3 &&
 	git add file3 &&
 	test_tick &&
 	git stash -u
 '
 
 blob=$(git rev-parse --short $(echo 4 | git hash-object --stdin))
-cat > expect <<EOF
+cat >expect <<EOF
 diff --git a/file3 b/file3
 new file mode 100644
 index 0000000..$blob
@@ -128,12 +128,12 @@ test_expect_success 'stash save --include-untracked dirty index got stashed' '
 	test_cmp expect actual
 '
 
-git reset > /dev/null
+git reset >/dev/null
 
 # Must direct output somewhere where it won't be considered an untracked file
 test_expect_success 'stash save --include-untracked -q is quiet' '
-	echo 1 > file5 &&
-	git stash save --include-untracked --quiet > .git/stash-output.out 2>&1 &&
+	echo 1 >file5 &&
+	git stash save --include-untracked --quiet >.git/stash-output.out 2>&1 &&
 	test_line_count = 0 .git/stash-output.out &&
 	rm -f .git/stash-output.out
 '
@@ -141,7 +141,7 @@ test_expect_success 'stash save --include-untracked -q is quiet' '
 test_expect_success 'stash save --include-untracked removed files' '
 	rm -f file &&
 	git stash save --include-untracked &&
-	echo 1 > expect &&
+	echo 1 >expect &&
 	test_cmp expect file
 '
 
@@ -152,14 +152,14 @@ test_expect_success 'stash save --include-untracked removed files got stashed' '
 	test_path_is_missing file
 '
 
-cat > .gitignore <<EOF
+cat >.gitignore <<EOF
 .gitignore
 ignored
 ignored.d/
 EOF
 
 test_expect_success 'stash save --include-untracked respects .gitignore' '
-	echo ignored > ignored &&
+	echo ignored >ignored &&
 	mkdir ignored.d &&
 	echo ignored >ignored.d/untracked &&
 	git stash -u &&
@@ -169,7 +169,7 @@ test_expect_success 'stash save --include-untracked respects .gitignore' '
 '
 
 test_expect_success 'stash save -u can stash with only untracked files different' '
-	echo 4 > file4 &&
+	echo 4 >file4 &&
 	git stash -u &&
 	test_path_is_missing file4
 '
@@ -214,7 +214,7 @@ test_expect_success 'stash push with $IFS character' '
 	test_path_is_file bar
 '
 
-cat > .gitignore <<EOF
+cat >.gitignore <<EOF
 ignored
 ignored.d/*
 EOF
@@ -224,7 +224,7 @@ test_expect_success 'stash previously ignored file' '
 	git add .gitignore &&
 	git commit -m "Add .gitignore" &&
 	>ignored.d/foo &&
-	echo "!ignored.d/foo" >> .gitignore &&
+	echo "!ignored.d/foo" >>.gitignore &&
 	git stash save --include-untracked &&
 	test_path_is_missing ignored.d/foo &&
 	git stash pop &&
-- 
2.30.0.478.g8a0d178c01
Previous: Denton LiuNext: Junio C Hamano
Message 19 of 45 in “stash show: learn --include-untracked and --only-untracked”
  1. 0/9 stash show: learn --include-untracked and --only-untrackedDenton Liu, Feb 2, 2021
  2. 1/9 git-stash.txt: be explicit about subcommand optionsDenton Liu, Feb 2, 2021
  3. Eric SunshineFeb 2, 2021
  4. 4/9 t3905: remove nested git in command substitutionDenton Liu, Feb 2, 2021
  5. 2/9 t3905: remove spaces after redirect operatorsDenton Liu, Feb 2, 2021
  6. 3/9 t3905: move all commands into test casesDenton Liu, Feb 2, 2021
  7. Junio C HamanoFeb 2, 2021
  8. 5/9 t3905: replace test -s with test_file_not_emptyDenton Liu, Feb 2, 2021
  9. 8/9 stash show: teach --include-tracked and --only-untrackedDenton Liu, Feb 2, 2021
  10. Junio C HamanoFeb 2, 2021
  11. 9/9 stash show: learn stash.showIncludeUntrackedDenton Liu, Feb 2, 2021
  12. 7/9 stash: declare ref_stash as an arrayDenton Liu, Feb 2, 2021
  13. Junio C HamanoFeb 2, 2021
  14. 6/9 t3905: use test_cmp() to check file contentsDenton Liu, Feb 2, 2021
  15. 0/9 stash show: learn --include-untracked and --only-untrackedDenton Liu, Feb 9, 2021
  16. 1/9 git-stash.txt: be explicit about subcommand optionsDenton Liu, Feb 9, 2021
  17. Junio C HamanoFeb 10, 2021
  18. fixup! git-stash.txt: be explicit about subcommand optionsDenton Liu, Feb 11, 2021
  19. 2/9 t3905: remove spaces after redirect operatorsDenton Liu, Feb 9, 2021
  20. Junio C HamanoFeb 10, 2021
  21. 3/9 t3905: move all commands into test casesDenton Liu, Feb 9, 2021
  22. 4/9 t3905: remove nested git in command substitutionDenton Liu, Feb 9, 2021
  23. Junio C HamanoFeb 10, 2021
  24. 5/9 t3905: replace test -s with test_file_not_emptyDenton Liu, Feb 9, 2021
  25. 6/9 t3905: use test_cmp() to check file contentsDenton Liu, Feb 9, 2021
  26. 8/9 stash show: teach --include-untracked and --only-untrackedDenton Liu, Feb 9, 2021
  27. Junio C HamanoFeb 10, 2021
  28. Denton LiuFeb 16, 2021
  29. Junio C HamanoFeb 16, 2021
  30. 7/9 stash: declare ref_stash as an arrayDenton Liu, Feb 9, 2021
  31. Junio C HamanoFeb 10, 2021
  32. 9/9 stash show: learn stash.showIncludeUntrackedDenton Liu, Feb 9, 2021
  33. 0/2 stash show: learn --include-untracked and --only-untrackedDenton Liu, Feb 16, 2021
  34. 1/2 stash show: teach --include-untracked and --only-untrackedDenton Liu, Feb 16, 2021
  35. Junio C HamanoFeb 16, 2021
  36. Denton LiuFeb 17, 2021
  37. Junio C HamanoFeb 17, 2021
  38. Junio C HamanoFeb 17, 2021
  39. 2/2 stash show: learn stash.showIncludeUntrackedDenton Liu, Feb 16, 2021
  40. 0/2 stash show: learn --include-untracked and --only-untrackedDenton Liu, Mar 3, 2021
  41. 2/2 stash show: learn stash.showIncludeUntrackedDenton Liu, Mar 3, 2021
  42. 1/2 stash show: teach --include-untracked and --only-untrackedDenton Liu, Mar 3, 2021
  43. Junio C HamanoMar 4, 2021
  44. Denton LiuMar 4, 2021
  45. Denton LiuMar 4, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.