Skip to contentSkip to conversation

t/t0015-hash.sh: removed unnecessary '\' at line end

PATCH New Jaydeep P Das 3 participants 8 messages Feb 8, 2022 – Feb 10, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 t/t0015-hash.sh: removed unnecessary '\' at line end

Fixed code as per coding style guide.

Since | already implies that the statement is not over, therefore adding a \ in the end is not necessary.

#1 lore raw

PATCH 1/1 t/t0015-hash.sh: removed unnecessary '\' at line end

From: Jaydeep Das <[email protected]>

The | at line end already imples that the statement is not over. So a \ after that is redundant.

---
 t/t0015-hash.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
t/t0015-hash.sh +3 -3
index 291e9061f3..086822fc45 100755
@@ -15,7 +15,7 @@ test_expect_success 'test basic SHA-1 hash values' '
 	grep c12252ceda8be8994d5fa0290a47231c1d16aae3 actual &&
 	printf "abcdefghijklmnopqrstuvwxyz" | test-tool sha1 >actual &&
 	grep 32d10c7b8cf96570ca04ce37f2a19d84240d3a89 actual &&
-	perl -e "$| = 1; print q{aaaaaaaaaa} for 1..100000;" | \
+	perl -e "$| = 1; print q{aaaaaaaaaa} for 1..100000;" |
 		test-tool sha1 >actual &&
 	grep 34aa973cd4c4daa4f61eeb2bdbad27316534016f actual &&
 	printf "blob 0\0" | test-tool sha1 >actual &&
@@ -38,10 +38,10 @@ test_expect_success 'test basic SHA-256 hash values' '
 	printf "abcdefghijklmnopqrstuvwxyz" | test-tool sha256 >actual &&
 	grep 71c480df93d6ae2f1efad1447c66c9525e316218cf51fc8d9ed832f2daf18b73 actual &&
 	# Try to exercise the chunking code by turning autoflush on.
-	perl -e "$| = 1; print q{aaaaaaaaaa} for 1..100000;" | \
+	perl -e "$| = 1; print q{aaaaaaaaaa} for 1..100000;" |
 		test-tool sha256 >actual &&
 	grep cdc76e5c9914fb9281a1c7e284d73e67f1809a48a497200e046d39ccc7112cd0 actual &&
-	perl -e "$| = 1; print q{abcdefghijklmnopqrstuvwxyz} for 1..100000;" | \
+	perl -e "$| = 1; print q{abcdefghijklmnopqrstuvwxyz} for 1..100000;" |
 		test-tool sha256 >actual &&
 	grep e406ba321ca712ad35a698bf0af8d61fc4dc40eca6bdcea4697962724ccbde35 actual &&
 	printf "blob 0\0" | test-tool sha256 >actual &&
Signature · 1 line
2.35.1
Reviewed-by on v1 1/1
#2 lore raw
Quoted 26 lines · Jaydeep P Das

From: Jaydeep Das <[email protected]>

The | at line end already imples that the statement is not over. So a \ after that is redundant.

---
  t/t0015-hash.sh | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
t/t0015-hash.sh +1 -1
index 291e9061f3..086822fc45 100755
@@ -15,7 +15,7 @@ test_expect_success 'test basic SHA-1 hash values' '
  	grep c12252ceda8be8994d5fa0290a47231c1d16aae3 actual &&
  	printf "abcdefghijklmnopqrstuvwxyz" | test-tool sha1 >actual &&
  	grep 32d10c7b8cf96570ca04ce37f2a19d84240d3a89 actual &&
-	perl -e "$| = 1; print q{aaaaaaaaaa} for 1..100000;" | \
+	perl -e "$| = 1; print q{aaaaaaaaaa} for 1..100000;" |
  		test-tool sha1 >actual &&
  	grep 34aa973cd4c4daa4f61eeb2bdbad27316534016f actual &&
  	printf "blob 0\0" | test-tool sha1 >actual &&
@@ -38,10 +38,10 @@ test_expect_success 'test basic SHA-256 hash values' '
  	printf "abcdefghijklmnopqrstuvwxyz" | test-tool sha256 >actual &&
  	grep 71c480df93d6ae2f1efad1447c66c9525e316218cf51fc8d9ed832f2daf18b73 actual &&

t/t0015-hash.sh test_expect_success 'test basic SHA-256 hash values' ' · line 47

Quoted 10 lines
t/t0015-hash.sh +2 -2
  	# Try to exercise the chunking code by turning autoflush on.
-	perl -e "$| = 1; print q{aaaaaaaaaa} for 1..100000;" | \
+	perl -e "$| = 1; print q{aaaaaaaaaa} for 1..100000;" |
  		test-tool sha256 >actual &&
  	grep cdc76e5c9914fb9281a1c7e284d73e67f1809a48a497200e046d39ccc7112cd0 actual &&
-	perl -e "$| = 1; print q{abcdefghijklmnopqrstuvwxyz} for 1..100000;" | \
+	perl -e "$| = 1; print q{abcdefghijklmnopqrstuvwxyz} for 1..100000;" |
  		test-tool sha256 >actual &&
  	grep e406ba321ca712ad35a698bf0af8d61fc4dc40eca6bdcea4697962724ccbde35 actual &&
  	printf "blob 0\0" | test-tool sha256 >actual &&

Looks OK.

Signature · 1 line
An old man doll... just what I always wanted! - Clara
#3 lore raw
Quoted 11 lines · Bagas Sanjaya

t/t0015-hash.sh test_expect_success 'test basic SHA-256 hash values' ' · line 47

Quoted 9 lines
t/t0015-hash.sh +3 -3
-	perl -e "$| = 1; print q{aaaaaaaaaa} for 1..100000;" | \
+	perl -e "$| = 1; print q{aaaaaaaaaa} for 1..100000;" |
-	perl -e "$| = 1; print q{aaaaaaaaaa} for 1..100000;" | \
+	perl -e "$| = 1; print q{aaaaaaaaaa} for 1..100000;" |
-	perl -e "$| = 1; print q{abcdefghijklmnopqrstuvwxyz} for 1..100000;" | \
+	perl -e "$| = 1; print q{abcdefghijklmnopqrstuvwxyz} for 1..100000;" |
  		test-tool sha256 >actual &&
  	grep e406ba321ca712ad35a698bf0af8d61fc4dc40eca6bdcea4697962724ccbde35 actual &&
  	printf "blob 0\0" | test-tool sha256 >actual &&

Looks OK.

Yeah, with "removed" -> "remove" on the title, this would look perfect.

Thanks, both.

#4 lore raw

Thanks for the feedback.

I have a few more questions regarding contributions.

I have seen that some command documentations lack consistent synopsis compared to other commands. Is it on purpose or are improvements to those documentations welcome ?

Also, I have read some mails about "noise" in the mailing list. What does that mean? Does it mean very small patches (like mine)? I just want to make sure so that I donot repeat any mistakes :)

#5 lore raw
Quoted 5 lines · [email protected] writes:

Thanks for the feedback.

I have a few more questions regarding contributions.
I have seen that some command documentations lack consistent synopsis compared to other commands. Is it on purpose or are improvements to those documentations welcome ?

That's hard to answer, as what you perceive as "lack consistent" may or may not be consistent from other people's perspective, without a concrete "here is the comparison I am talking about, and this makes the two comparable" patch.

Quoted 3 lines

Also, I have read some mails about "noise" in the mailing list. What does that mean? Does it mean very small patches (like mine)? I just want to make sure so that I donot repeat any mistakes :)

"noise", "churn", etc. are used to refer to low value changes that would interfere, by touching the same area of code or documentation, other topics that have greater impact. t0015 seems to be quiescent right now (no topic in flight fixes or modifies it), so a small-ish change that does not substantially improve it would not count as one, at least right now ;-)

#6 lore raw

Thanks for the quick response.

Quoted 8 lines
Quoted 3 lines

I have a few more questions regarding contributions.
I have seen that some command documentations lack consistent synopsis compared to other commands. Is it on purpose or are improvements to those documentations welcome ?

That's hard to answer, as what you perceive as "lack consistent" may or may not be consistent from other people's perspective, without a concrete "here is the comparison I am talking about, and this makes the two comparable" patch.

Here is an example. The synopsis of command send-email vs synopsis of commit:

```
git send-email [<options>] <file|directory>…​
git send-email [<options>] <format-patch options>
git send-email --dump-aliases
```
```
git commit [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend]
	   [--dry-run] [(-c | -C | --squash) <commit> | --fixup [(amend|reword):]<commit>)]
	   [-F <file> | -m <msg>] [--reset-author] [--allow-empty]
	   [--allow-empty-message] [--no-verify] [-e] [--author=<author>]
	   [--date=<date>] [--cleanup=<mode>] [--[no-]status]
	   [-i | -o] [--pathspec-from-file=<file> [--pathspec-file-nul]]
	   [(--trailer <token>[(=|:)<value>])…​] [-S[<keyid>]]
	   [--] [<pathspec>…​]
```

The commit synopsis has a more verbose overview of all the options available compared to send-email synopsis.

#7 lore raw
Quoted 19 lines · [email protected] writes:

Here is an example. The synopsis of command send-email vs synopsis of commit:

```
git send-email [<options>] <file|directory>…​
git send-email [<options>] <format-patch options>
git send-email --dump-aliases
```
```
git commit [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend]
	   [--dry-run] [(-c | -C | --squash) <commit> | --fixup [(amend|reword):]<commit>)]
	   [-F <file> | -m <msg>] [--reset-author] [--allow-empty]
	   [--allow-empty-message] [--no-verify] [-e] [--author=<author>]
	   [--date=<date>] [--cleanup=<mode>] [--[no-]status]
	   [-i | -o] [--pathspec-from-file=<file> [--pathspec-file-nul]]
	   [(--trailer <token>[(=|:)<value>])…​] [-S[<keyid>]]
	   [--] [<pathspec>…​]
```
Quoted 1 line

The commit synopsis has a more verbose overview of all the options available compared to send-email synopsis.

I think the former is more modern style that leaves the description of options to the main text. It also allows the synopsis section to make it stand out very different operating modes instead of having the alternative listed with [ A | B | C ] and having the readers guess if all combinations of alternatives are valid (they are often not).

The former style takes more thought to write well, when a command is multi-purpose and has different operating modes (cf. "git checkout").

For "git commit", even though conceptually creating a totally new commit and amending the current one are two quite distinct opeating modes, they pretty much take the same set of options, so I suspect we can do with just one

	git commit [<options>] [--] [<pathspec>...]

in the modern style, but I dunno (that is why I said "it takes more thought" and I cannot afford much time to think it through just for illustration purposes).

Thanks.