refs: fix duplicated word in comment
PATCH 1/1 refs: fix duplicated word in comment
From: Christian Fredrik Johnsen <[email protected]>
Fix a typo in a comment in refs.c: "checking checking" → "checking".
---
refs: fix duplicated word in comment
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1940%2FChristianFredrikJohnsen%2Fmaster-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1940/ChristianFredrikJohnsen/master-v1
Pull-Request: https://github.com/git/git/pull/1940
refs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
refs.c +1 -1
@@ -2549,7 +2549,7 @@ int refs_verify_refnames_available(struct ref_store *refs,/* * If we've already seen the directory we don't need to -* process it again. Skip it to avoid checking checking +* process it again. Skip it to avoid checking * common prefixes like "refs/heads/" repeatedly. */ if (!strset_add (&dirnames, dirname.buf))
base-commit: 5b97a56fa0e7d580dc8865b73107407c9b3f0eff
Signature · 1 line
gitgitgadget
Hi Christian Fredrik,
Thanks for posting a patch.
Quoted 5 lines · Christian Fredrik Johnsen via GitGitGadget
From: Christian Fredrik Johnsen <[email protected]>
Fix a typo in a comment in
refs.c: "checking checking" → "checking".Signed-off-by Christian Fredrik Johnsen <[email protected]>
There should be an empty line between the main part of the commit message and the Signed-off-by trailer.
refs.c int refs_verify_refnames_available(struct ref_store *refs, · line 2554
Quoted 6 lines
/*
* If we've already seen the directory we don't need torefs.c +1
-1-* process it again. Skip it to avoid checking checking +* process it again. Skip it to avoid checking * common prefixes like "refs/heads/" repeatedly. */
Well-spotted. No doubt that this is the correct fix.
Martin
PATCH v2 1/1 refs: fix duplicated word in comment
In reply to Christian Fredrik Johnsen via GitGitGadgetFrom: Christian Fredrik Johnsen <[email protected]>
Fix a typo in a comment in refs.c: "checking checking" → "checking".
---
refs: fix duplicated word in comment
Changes since v1:
* Add a blank line in the commit message to separate commit body from
Signed-off-by: footer
* Moved the word common from line 2553 to 2552, to make the comment be similar in style to other comments in refs.c. (Usually the last comment line is somewhat shorter than the first ones).
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1940%2FChristianFredrikJohnsen%2Fmaster-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1940/ChristianFredrikJohnsen/master-v2
Pull-Request: https://github.com/git/git/pull/1940
Range-diff vs v1:
1: 327563ce3fd ! 1: 029c23cf027 refs: fix duplicated word in comment
@@ Commit message
refs: fix duplicated word in comment
Fix a typo in a comment in refs.c: "checking checking" → "checking".
+
## refs.c ##
@@ refs.c: int refs_verify_refnames_available(struct ref_store *refs,
/*
* If we've already seen the directory we don't need to
- * process it again. Skip it to avoid checking checking
-+ * process it again. Skip it to avoid checking
- * common prefixes like "refs/heads/" repeatedly.
+- * common prefixes like "refs/heads/" repeatedly.
++ * process it again. Skip it to avoid checking common
++ * prefixes like "refs/heads/" repeatedly.
*/
if (!strset_add(&dirnames, dirname.buf))
+ continue;
refs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
refs.c +2 -2
@@ -2549,8 +2549,8 @@ int refs_verify_refnames_available(struct ref_store *refs,/* * If we've already seen the directory we don't need to -* process it again. Skip it to avoid checking checking -* common prefixes like "refs/heads/" repeatedly. +* process it again. Skip it to avoid checking common +* prefixes like "refs/heads/" repeatedly. */ if (!strset_add (&dirnames, dirname.buf))continue ;
base-commit: 5b97a56fa0e7d580dc8865b73107407c9b3f0eff
Signature · 1 line
gitgitgadget
Quoted 6 lines · Christian Fredrik Johnsen via GitGitGadget
From: Christian Fredrik Johnsen <[email protected]>
Fix a typo in a comment in
refs.c: "checking checking" → "checking".Signed-off-by Christian Fredrik Johnsen <[email protected]>
This addresses my comment on v1.
Quoted 10 lines
Changes since v1:
* Add a blank line in the commit message to separate commit body from
Signed-off-by: footer
* Moved the word common from line 2553 to 2552, to make the comment be similar in style to other comments inrefs.c. (Usually the last comment line is somewhat shorter than the first ones)./*
* If we've already seen the directory we don't need to
refs.c int refs_verify_refnames_available(struct ref_store *refs, · line 2556
Quoted 7 lines
refs.c +2
-2-* process it again. Skip it to avoid checking checking -* common prefixes like "refs/heads/" repeatedly. +* process it again. Skip it to avoid checking common +* prefixes like "refs/heads/" repeatedly. */ if (!strset_add (&dirnames, dirname.buf))continue ;
Ok. In general, there's some trade-off to be made between "make a small change at the top of a twenty-line comment and rewrap the whole thing causing more churn than necessary and create more room for conflicts with other topics" and "make the change and live with slightly less beautiful wrapping". In this particular case, the blast radius is small. git show --word-diff confirms that you simply removed the duplicate word and moved "common" (or "*").
FWIW, this patch looks good to me.
Martin
Quoted 4 lines · Martin Ågren
Ok. In general, there's some trade-off to be made between "make a small change at the top of a twenty-line comment and rewrap the whole thing causing more churn than necessary and create more room for conflicts with other topics" and "make the change and live with slightly less beautiful wrapping".
Nice to see this choice spelled out.
Quoted 7 lines
In this
particular case, the blast radius is small.git show --word-diffconfirms that you simply removed the duplicate word and moved "common" (or "*").FWIW, this patch looks good to me.
Martin
Thanks, both.
Will queue.