threads / patch / 57382

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

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

## tl;dr

8 messages between Feb 8, 2022 and Feb 10, 2022. Diffs are folded; open one to read it.

replies: 7people: 3as markdown or json

Jaydeep P Das· Feb 8, 2022, 09:23 UTC · re: Jaydeep P Das · lore
From: Jaydeep Das <jaydeepjd.8914@gmail.com>

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

Signed-off-by: Jaydeep P Das <jaydeepjd.8914@gmail.com>
---
 t/t0015-hash.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Show changes to t/t0015-hash.sh +3 −3
diff --git a/t/t0015-hash.sh b/t/t0015-hash.sh
index 291e9061f3..086822fc45 100755
--- a/t/t0015-hash.sh
+++ b/t/t0015-hash.sh
@@ -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 &&
-- 
2.35.1
Bagas Sanjaya· Feb 10, 2022, 01:18 UTC · re: Jaydeep P Das · lore

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

On 08/02/22 16.23, Jaydeep P Das wrote:
Show 36 quoted lines
> From: Jaydeep Das <jaydeepjd.8914@gmail.com>
> 
> The `|` at line end already imples that the statement is not over.
> So a `\` after that is redundant.
> 
> Signed-off-by: Jaydeep P Das <jaydeepjd.8914@gmail.com>
> ---
>   t/t0015-hash.sh | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/t/t0015-hash.sh b/t/t0015-hash.sh
> index 291e9061f3..086822fc45 100755
> --- a/t/t0015-hash.sh
> +++ b/t/t0015-hash.sh
> @@ -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 &&
Looks OK.
Reviewed-by: Bagas Sanjaya <bagasdotme@gmail.com>
-- 
An old man doll... just what I always wanted! - Clara
Junio C Hamano· Feb 10, 2022, 01:42 UTC · re: Bagas Sanjaya · lore

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

Bagas Sanjaya <bagasdotme@gmail.com> writes:
Show 11 quoted lines
>> -	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.
jaydeepjd.8914@gmail.com· Feb 10, 2022, 05:52 UTC · re: Junio C Hamano · lore

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

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 :)

Junio C Hamano· Feb 10, 2022, 06:47 UTC · re: jaydeepjd.8914@gmail.com · lore

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

jaydeepjd.8914@gmail.com writes:
Show 5 quoted lines
> 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.

> 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 ;-)

jaydeepjd.8914@gmail.com· Feb 10, 2022, 07:11 UTC · re: Junio C Hamano · lore

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

Thanks for the quick response.
Show 8 quoted 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.
Junio C Hamano· Feb 10, 2022, 17:20 UTC · re: jaydeepjd.8914@gmail.com · lore

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

jaydeepjd.8914@gmail.com writes:
Show 20 quoted lines
> 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.

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.

← back to recent threads