Skip to contentSkip to conversation

*: fix typos which duplicate a word

PATCH Superseded Andrei Rybak 5 participants 13 messages Jan 6, 2023 – Jan 14, 2023 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 *: fix typos which duplicate a word

Fix typos in code comments which repeat various words. Most of the cases are simple in that they repeat a word that usually cannot be repeated in a grammatically correct sentence. Just remove the incorrectly duplicated word in these cases and rewrap text, if needed.

A tricky case is usage of "that that", which is sometimes grammatically correct. However, an instance of this in "t7527-builtin-fsmonitor.sh" doesn't need two words "that", because there is only one daemon being discussed, so the word "daemon" does not need a determiner.

Reword code comment "entries exist on on-disk index" in function update_one in file cache-tree.c, by replacing incorrect preposition "on" with "in".

---
 Documentation/gitprotocol-v2.txt | 2 +-
 builtin/checkout.c               | 2 +-
 builtin/submodule--helper.c      | 5 ++---
 cache-tree.c                     | 2 +-
 config.c                         | 2 +-
 run-command.c                    | 2 +-
 t/t4301-merge-tree-write-tree.sh | 4 ++--
 t/t6421-merge-partial-clone.sh   | 4 ++--
 t/t7527-builtin-fsmonitor.sh     | 4 ++--
 9 files changed, 13 insertions(+), 14 deletions(-)
Documentation/gitprotocol-v2.txt +1 -1
index 10bd2d40ce..acb97ad0c2 100644
@@ -665,7 +665,7 @@ headers and their prerequisite relationships, or something else.
 +
 Server operators should feel confident in turning on "bundle-uri" and
 not worry if e.g. their CDN goes down that clones or fetches will run
-into hard failures. Even if the server bundle bundle(s) are
+into hard failures. Even if the server bundle(s) are
 incomplete, or bad in some way the client should still end up with a
 functioning repository, just as if it had chosen not to use this
 protocol extension.
builtin/checkout.c +1 -1
index cd04f0bf57..5963e1b74b 100644
@@ -1270,7 +1270,7 @@ static int parse_branchname_arg(int argc, const char **argv,
 	 *       between A and B, A...B names that merge base.
 	 *
 	 *   (b) If <something> is _not_ a commit, either "--" is present
-	 *       or <something> is not a path, no -t or -b was given, and
+	 *       or <something> is not a path, no -t or -b was given,
 	 *       and there is a tracking branch whose name is <something>
 	 *       in one and only one remote (or if the branch exists on the
 	 *       remote named in checkout.defaultRemote), then this is a
builtin/submodule--helper.c +2 -3
index 450680fc70..4c173d8b37 100644
@@ -3219,9 +3219,8 @@ static void die_on_index_match(const char *path, int force)
 		ensure_full_index(&the_index);
 
 		/*
-		 * Since there is only one pathspec, we just need
-		 * need to check ps_matched[0] to know if a cache
-		 * entry matched.
+		 * Since there is only one pathspec, we just need to
+		 * check ps_matched[0] to know if a cache entry matched.
 		 */
 		for (i = 0; i < the_index.cache_nr; i++) {
 			ce_path_match(&the_index, the_index.cache[i], &ps,
cache-tree.c +1 -1
index c97111cccf..9af457f47c 100644
@@ -405,7 +405,7 @@ static int update_one(struct cache_tree *it,
 		}
 
 		/*
-		 * CE_INTENT_TO_ADD entries exist on on-disk index but
+		 * CE_INTENT_TO_ADD entries exist in on-disk index but
 		 * they are not part of generated trees. Invalidate up
 		 * to root to force cache-tree users to read elsewhere.
 		 */
config.c +1 -1
index 27f38283ad..00090a32fc 100644
@@ -3154,7 +3154,7 @@ int git_config_set_gently(const char *key, const char *value)
 int repo_config_set_worktree_gently(struct repository *r,
 				    const char *key, const char *value)
 {
-	/* Only use worktree-specific config if it is is already enabled. */
+	/* Only use worktree-specific config if it is already enabled. */
 	if (repository_format_worktree_config) {
 		char *file = repo_git_path(r, "config.worktree");
 		int ret = git_config_set_multivar_in_file_gently(
run-command.c +1 -1
index 756f1839aa..50cc011654 100644
@@ -1853,7 +1853,7 @@ enum start_bg_result start_bg_command(struct child_process *cmd,
 		 *
 		 * We also assume that `start_command()` does not add
 		 * us to the cleanup list.  And that it calls
-		 * calls `child_process_clear()`.
+		 * `child_process_clear()`.
 		 */
 		sbgr = SBGR_ERROR;
 		goto done;
t/t4301-merge-tree-write-tree.sh +2 -2
index a8983a0edc..250f721795 100755
@@ -141,7 +141,7 @@ test_expect_success 'test conflict notices and such' '
 #   Commit O: foo, olddir/{a,b,c}
 #   Commit A: modify foo, newdir/{a,b,c}
 #   Commit B: modify foo differently & rename foo -> olddir/bar
-#   Expected: CONFLICT(content) for for newdir/bar (not olddir/bar or foo)
+#   Expected: CONFLICT(content) for newdir/bar (not olddir/bar or foo)
 
 test_expect_success 'directory rename + content conflict' '
 	# Setup
@@ -653,7 +653,7 @@ test_expect_success 'mod6: chains of rename/rename(1to2) and add/add via collidi
 #   Commit O: foo, olddir/{a,b,c}
 #   Commit A: delete foo, rename olddir/ -> newdir/, add newdir/bar/file
 #   Commit B: modify foo & rename foo -> olddir/bar
-#   Expected: CONFLICT(content) for for newdir/bar (not olddir/bar or foo)
+#   Expected: CONFLICT(content) for newdir/bar (not olddir/bar or foo)
 
 test_expect_success 'directory rename + rename/delete + modify/delete + directory/file conflict' '
 	# Setup
t/t6421-merge-partial-clone.sh +2 -2
index 5413e5dd9d..711b709e75 100755
@@ -155,7 +155,7 @@ test_setup_repo () {
 #   Commit A:
 #     (Rename leap->jump, rename basename/ -> basename/subdir/, rename dir/
 #      -> folder/, move e into newsubdir, add newfile.rs, remove f, modify
-#      both both Makefiles and jumps)
+#      both Makefiles and jumps)
 #              general/{jump1_A, jump2_A}
 #              basename/subdir/{numbers_A, sequence_A, values_A}
 #              folder/subdir/{a,b,c,d,Makefile_TOP_A}
@@ -343,7 +343,7 @@ test_expect_merge_algorithm failure success 'Objects downloaded when a directory
 #   Commit A:
 #     (Rename leap->jump, rename basename/ -> basename/subdir/, rename dir/
 #      -> folder/, move e into newsubdir, add newfile.rs, remove f, modify
-#      both both Makefiles and jumps)
+#      both Makefiles and jumps)
 #              general/{jump1_A, jump2_A}
 #              basename/subdir/{numbers_A, sequence_A, values_A}
 #              folder/subdir/{a,b,c,d,Makefile_TOP_A}
t/t7527-builtin-fsmonitor.sh +2 -2
index 76d0220daa..f9aad19d1c 100755
@@ -904,7 +904,7 @@ test_expect_success "submodule absorbgitdirs implicitly starts daemon" '
 
 # On a case-insensitive file system, confirm that the daemon
 # notices when the .git directory is moved/renamed/deleted
-# regardless of how it is spelled in the the FS event.
+# regardless of how it is spelled in the FS event.
 # That is, does the FS event receive the spelling of the
 # operation or does it receive the spelling preserved with
 # the file/directory.
@@ -922,7 +922,7 @@ test_expect_success CASE_INSENSITIVE_FS 'case insensitive+preserving' '
 	test_path_is_dir test_insensitive/.git &&
 	test_path_is_dir test_insensitive/.GIT &&
 
-	# Rename .git using an alternate spelling to verify that that
+	# Rename .git using an alternate spelling to verify that
 	# daemon detects it and automatically shuts down.
 	mv test_insensitive/.GIT test_insensitive/.FOO &&
 
Signature · 1 line
2.38.1
#1 lore raw
Quoted 8 lines · Andrei Rybak

Fix typos in code comments which repeat various words. Most of the cases are simple in that they repeat a word that usually cannot be repeated in a grammatically correct sentence. Just remove the incorrectly duplicated word in these cases and rewrap text, if needed.

Reword code comment "entries exist on on-disk index" in function update_one in file cache-tree.c, by replacing incorrect preposition "on" with "in".

Thanks, these all look sensible.

Quoted 4 lines

A tricky case is usage of "that that", which is sometimes grammatically correct. However, an instance of this in "t7527-builtin-fsmonitor.sh" doesn't need two words "that", because there is only one daemon being discussed, so the word "daemon" does not need a determiner.

But...

t/t7527-builtin-fsmonitor.sh test_expect_success CASE_INSENSITIVE_FS 'case insensitive+preserving' ' · line 924

Quoted 8 lines

---

t/t7527-builtin-fsmonitor.sh +1 -1
@@ -922,7 +922,7 @@ test_expect_success CASE_INSENSITIVE_FS 'case insensitive+preserving' '
-       # Rename .git using an alternate spelling to verify that that
+       # Rename .git using an alternate spelling to verify that
        # daemon detects it and automatically shuts down.
        mv test_insensitive/.GIT test_insensitive/.FOO &&

... this doesn't read as well following the change. It would read well if you changed it to "that the".

Not related to your patch at all, but I notice in this test that the call to test_when_finished() is commented out:

    # test_when_finished "stop_daemon_delete_repo test_insensitive" &&

which makes me wonder if it was commented out while the test was being debugged but then forgotten, and that the script is now potentially leaking a running daemon if something in the test fails after the daemon was started, or if the daemon does not shut down on its own as it's supposed to do. [cc:+Jeff Hostetler]

#2 lore raw

PATCH v2 1/1 *: fix typos which duplicate a word

Fix typos in code comments which repeat various words. Most of the cases are simple in that they repeat a word that usually cannot be repeated in a grammatically correct sentence. Just remove the incorrectly duplicated word in these cases and rewrap text, if needed.

A tricky case is usage of "that that", which is sometimes grammatically correct. However, an instance of this in "t7527-builtin-fsmonitor.sh" doesn't need two words "that", because there is only one daemon being discussed, so replace the second "that" with "the".

Reword code comment "entries exist on on-disk index" in function update_one in file cache-tree.c, by replacing incorrect preposition "on" with "in".

---

Quoted 7 lines · Junio C Hamano
Quoted 4 lines

A tricky case is usage of "that that", which is sometimes grammatically correct. However, an instance of this in "t7527-builtin-fsmonitor.sh" doesn't need two words "that", because there is only one daemon being discussed, so the word "daemon" does not need a determiner.

Makes me wonder if it is more appropriage to replace the second "that" with "the" there, then.

Quoted 12 lines · Eric Sunshine

But...

t/t7527-builtin-fsmonitor.sh test_expect_success CASE_INSENSITIVE_FS 'case insensitive+preserving' ' · line 924

Quoted 7 lines

---

t/t7527-builtin-fsmonitor.sh +1 -1
@@ -922,7 +922,7 @@ test_expect_success CASE_INSENSITIVE_FS 'case insensitive+preserving' '
-       # Rename .git using an alternate spelling to verify that that
+       # Rename .git using an alternate spelling to verify that
         # daemon detects it and automatically shuts down.
         mv test_insensitive/.GIT test_insensitive/.FOO &&

... this doesn't read as well following the change. It would read well if you changed it to "that the".

Here's a v2 with "that the" and a corresponding update to the commit message.

Quoted 10 lines

Not related to your patch at all, but I notice in this test that the call to test_when_finished() is commented out:

     # test_when_finished "stop_daemon_delete_repo test_insensitive" &&

which makes me wonder if it was commented out while the test was being debugged but then forgotten, and that the script is now potentially leaking a running daemon if something in the test fails after the daemon was started, or if the daemon does not shut down on its own as it's supposed to do. [cc:+Jeff Hostetler]

After looking at this and other places from:

    $ git grep -P '^\s*#\s*test_' -- 't/t[0-9]*'

it seems that e.g. "#test_expect_success" in t/t9200-git-cvsexportcommit.sh, could be replaced with test_expect_failure. There are also more complicated cases like t/t6003-rev-list-topo-order.sh, where a helper function "#test_output_expect_success" from t/lib-t6000.sh is commented out, so a corresponding test_output_expect_failure will be needed to uncomment the test.

 Documentation/gitprotocol-v2.txt | 2 +-
 builtin/checkout.c               | 2 +-
 builtin/submodule--helper.c      | 5 ++---
 cache-tree.c                     | 2 +-
 config.c                         | 2 +-
 run-command.c                    | 2 +-
 t/t4301-merge-tree-write-tree.sh | 4 ++--
 t/t6421-merge-partial-clone.sh   | 4 ++--
 t/t7527-builtin-fsmonitor.sh     | 6 +++---
 9 files changed, 14 insertions(+), 15 deletions(-)
Documentation/gitprotocol-v2.txt +1 -1
index 10bd2d40ce..acb97ad0c2 100644
@@ -665,7 +665,7 @@ headers and their prerequisite relationships, or something else.
 +
 Server operators should feel confident in turning on "bundle-uri" and
 not worry if e.g. their CDN goes down that clones or fetches will run
-into hard failures. Even if the server bundle bundle(s) are
+into hard failures. Even if the server bundle(s) are
 incomplete, or bad in some way the client should still end up with a
 functioning repository, just as if it had chosen not to use this
 protocol extension.
builtin/checkout.c +1 -1
index cd04f0bf57..5963e1b74b 100644
@@ -1270,7 +1270,7 @@ static int parse_branchname_arg(int argc, const char **argv,
 	 *       between A and B, A...B names that merge base.
 	 *
 	 *   (b) If <something> is _not_ a commit, either "--" is present
-	 *       or <something> is not a path, no -t or -b was given, and
+	 *       or <something> is not a path, no -t or -b was given,
 	 *       and there is a tracking branch whose name is <something>
 	 *       in one and only one remote (or if the branch exists on the
 	 *       remote named in checkout.defaultRemote), then this is a
builtin/submodule--helper.c +2 -3
index 450680fc70..4c173d8b37 100644
@@ -3219,9 +3219,8 @@ static void die_on_index_match(const char *path, int force)
 		ensure_full_index(&the_index);
 
 		/*
-		 * Since there is only one pathspec, we just need
-		 * need to check ps_matched[0] to know if a cache
-		 * entry matched.
+		 * Since there is only one pathspec, we just need to
+		 * check ps_matched[0] to know if a cache entry matched.
 		 */
 		for (i = 0; i < the_index.cache_nr; i++) {
 			ce_path_match(&the_index, the_index.cache[i], &ps,
cache-tree.c +1 -1
index c97111cccf..9af457f47c 100644
@@ -405,7 +405,7 @@ static int update_one(struct cache_tree *it,
 		}
 
 		/*
-		 * CE_INTENT_TO_ADD entries exist on on-disk index but
+		 * CE_INTENT_TO_ADD entries exist in on-disk index but
 		 * they are not part of generated trees. Invalidate up
 		 * to root to force cache-tree users to read elsewhere.
 		 */
config.c +1 -1
index 27f38283ad..00090a32fc 100644
@@ -3154,7 +3154,7 @@ int git_config_set_gently(const char *key, const char *value)
 int repo_config_set_worktree_gently(struct repository *r,
 				    const char *key, const char *value)
 {
-	/* Only use worktree-specific config if it is is already enabled. */
+	/* Only use worktree-specific config if it is already enabled. */
 	if (repository_format_worktree_config) {
 		char *file = repo_git_path(r, "config.worktree");
 		int ret = git_config_set_multivar_in_file_gently(
run-command.c +1 -1
index 756f1839aa..50cc011654 100644
@@ -1853,7 +1853,7 @@ enum start_bg_result start_bg_command(struct child_process *cmd,
 		 *
 		 * We also assume that `start_command()` does not add
 		 * us to the cleanup list.  And that it calls
-		 * calls `child_process_clear()`.
+		 * `child_process_clear()`.
 		 */
 		sbgr = SBGR_ERROR;
 		goto done;
t/t4301-merge-tree-write-tree.sh +2 -2
index a8983a0edc..250f721795 100755
@@ -141,7 +141,7 @@ test_expect_success 'test conflict notices and such' '
 #   Commit O: foo, olddir/{a,b,c}
 #   Commit A: modify foo, newdir/{a,b,c}
 #   Commit B: modify foo differently & rename foo -> olddir/bar
-#   Expected: CONFLICT(content) for for newdir/bar (not olddir/bar or foo)
+#   Expected: CONFLICT(content) for newdir/bar (not olddir/bar or foo)
 
 test_expect_success 'directory rename + content conflict' '
 	# Setup
@@ -653,7 +653,7 @@ test_expect_success 'mod6: chains of rename/rename(1to2) and add/add via collidi
 #   Commit O: foo, olddir/{a,b,c}
 #   Commit A: delete foo, rename olddir/ -> newdir/, add newdir/bar/file
 #   Commit B: modify foo & rename foo -> olddir/bar
-#   Expected: CONFLICT(content) for for newdir/bar (not olddir/bar or foo)
+#   Expected: CONFLICT(content) for newdir/bar (not olddir/bar or foo)
 
 test_expect_success 'directory rename + rename/delete + modify/delete + directory/file conflict' '
 	# Setup
t/t6421-merge-partial-clone.sh +2 -2
index 5413e5dd9d..711b709e75 100755
@@ -155,7 +155,7 @@ test_setup_repo () {
 #   Commit A:
 #     (Rename leap->jump, rename basename/ -> basename/subdir/, rename dir/
 #      -> folder/, move e into newsubdir, add newfile.rs, remove f, modify
-#      both both Makefiles and jumps)
+#      both Makefiles and jumps)
 #              general/{jump1_A, jump2_A}
 #              basename/subdir/{numbers_A, sequence_A, values_A}
 #              folder/subdir/{a,b,c,d,Makefile_TOP_A}
@@ -343,7 +343,7 @@ test_expect_merge_algorithm failure success 'Objects downloaded when a directory
 #   Commit A:
 #     (Rename leap->jump, rename basename/ -> basename/subdir/, rename dir/
 #      -> folder/, move e into newsubdir, add newfile.rs, remove f, modify
-#      both both Makefiles and jumps)
+#      both Makefiles and jumps)
 #              general/{jump1_A, jump2_A}
 #              basename/subdir/{numbers_A, sequence_A, values_A}
 #              folder/subdir/{a,b,c,d,Makefile_TOP_A}
t/t7527-builtin-fsmonitor.sh +3 -3
index 76d0220daa..c2582d44a6 100755
@@ -904,7 +904,7 @@ test_expect_success "submodule absorbgitdirs implicitly starts daemon" '
 
 # On a case-insensitive file system, confirm that the daemon
 # notices when the .git directory is moved/renamed/deleted
-# regardless of how it is spelled in the the FS event.
+# regardless of how it is spelled in the FS event.
 # That is, does the FS event receive the spelling of the
 # operation or does it receive the spelling preserved with
 # the file/directory.
@@ -922,8 +922,8 @@ test_expect_success CASE_INSENSITIVE_FS 'case insensitive+preserving' '
 	test_path_is_dir test_insensitive/.git &&
 	test_path_is_dir test_insensitive/.GIT &&
 
-	# Rename .git using an alternate spelling to verify that that
-	# daemon detects it and automatically shuts down.
+	# Rename .git using an alternate spelling to verify that
+	# the daemon detects it and automatically shuts down.
 	mv test_insensitive/.GIT test_insensitive/.FOO &&
 
 	# See [1] above.
Signature · 1 line
2.38.1
#3 lore raw
Quoted 1 line · Andrei Rybak

Here's a v2 with "that the" and a corresponding update to the commit message.

Looks good. Will queue. Thanks.

#4 lore raw

cover fixes for commented out code in tests (was "Re: [PATCH] *: fix typos which duplicate a word")

In reply to Eric Sunshine

[ I apologize for some people getting this twice -- I messed up when
invoking git send-email ]

Quoted 10 lines · Eric Sunshine

Not related to your patch at all, but I notice in this test that the call to test_when_finished() is commented out:

    # test_when_finished "stop_daemon_delete_repo test_insensitive" &&

which makes me wonder if it was commented out while the test was being debugged but then forgotten, and that the script is now potentially leaking a running daemon if something in the test fails after the daemon was started, or if the daemon does not shut down on its own as it's supposed to do. [cc:+Jeff Hostetler]

Here's a patch series that fixes some of the commented out test code.

I skipped changing the following:

1. a minute-long test_expect_failure is commented out in t0014-alias.sh . Technically, this could be uncommented and marked with EXPENSIVE prerequisite, but it doesn't seem worth it for a test_expect_failure. [ cc Tim Schumacher, who added this test in fef5f7fc43 (t0014: introduce an alias testing suite, 2018-09-16) ]

2. In t6426-merge-skip-unneeded-updates.sh, second part of the test '2c: Modify b & add c VS rename b->c' is commented out with an explicit "# FIXME:
rename/add conflicts are horribly broken right now;" above the commented out part.
[ cc Elijah Newren, author of c04ba51739 (t6046: testcases checking whether updates can be skipped in a merge, 2018-04-19) ]

3. I've experimented a bit with commented out test in file t9200-git-cvsexportcommit.sh. Tests in this file rely on state from previous tests, which complicates more thorough investigation. Unfortunately, I didn't have bandwidth to investigate this further.
[ cc Robin Rosenberg, who added it in fe142b3a45 (Rework cvsexportcommit to handle binary files for all cases., 2006-11-12) and commented out in e86ad71fe5 (Make cvsexportcommit work with filenames with spaces and non-ascii characters., 2006-12-11) ]

I found these places in tests with:

    git grep -P '^\s*[#]\s*test_' -- 't/t[0-9]*'

The rest of the results of this grep are documentation comments.

Andrei Rybak (3):
t6003: uncomment test '--max-age=c3, --topo-order'
t6422: drop commented out code
t7527: uncomment test_when_finished step in a test

 t/t6003-rev-list-topo-order.sh       | 23 ++++++++++-------------
 t/t6422-merge-rename-corner-cases.sh |  2 --
 t/t7527-builtin-fsmonitor.sh         |  2 +-
 3 files changed, 11 insertions(+), 16 deletions(-)
Signature · 1 line
2.39.0
#5 lore raw

PATCH 1/3 t6003: uncomment test '--max-age=c3, --topo-order'

Test '--max-age=c3, --topo-order' in t6003-rev-list-topo-order.sh has been commented out as failing since its introduction in [1]. However, the test is successful at least since commit [2] -- bisecting further is harder because of incompatibility of such old Git code with modern header file <openssl/bn.h> [3].

Uncomment this test to gain test coverage.

[1] f573571a21 ([PATCH] Add t/t6003 with some --topo-order tests,

    2005-07-07)
[2] 765ac8ec46 (Rip out merge-order and make "git log <paths>..." work
    again., 2006-02-28)

[3] BIGNUM used in git's epoch.c which was removed in [2] changed significantly between OpenSSL 1.0.2 and OpenSSL 1.1.0 See also https://stackoverflow.com/a/42295243/1083697 and
https://lore.kernel.org/git/[email protected]/

---
 t/t6003-rev-list-topo-order.sh | 23 ++++++++++-------------
 1 file changed, 10 insertions(+), 13 deletions(-)
t/t6003-rev-list-topo-order.sh +10 -13
index 1f7d7dd20c..5cf2cee74d 100755
@@ -326,19 +326,16 @@ a2
 c3
 EOF
 
-#
-# this test fails on --topo-order - a fix is required
-#
-#test_output_expect_success '--max-age=c3, --topo-order' "git rev-list --topo-order --max-age=$(commit_date c3) l5" <<EOF
-#l5
-#l4
-#l3
-#a4
-#c3
-#b4
-#a3
-#a2
-#EOF
+test_output_expect_success '--max-age=c3, --topo-order' "git rev-list --topo-order --max-age=$(commit_date c3) l5" <<EOF
+l5
+l4
+l3
+a4
+c3
+b4
+a3
+a2
+EOF
 
 test_output_expect_success 'one specified head reachable from another a4, c3, --topo-order' "list_duplicates git rev-list --topo-order a4 c3" <<EOF
 EOF
Signature · 1 line
2.39.0
#6 lore raw

PATCH 2/3 t6422: drop commented out code

In reply to Andrei Rybak

In commit [1] tests in t6422-merge-rename-corner-cases.sh were refactored to not run setup steps separately. This included replacing all tests like

test_expect_success "setup ..." '
<code of setup>
'

with corresponding Shell functions

	test_setup_... () {
		<code of setup>
	}

During this replacement first and last lines of one of such tests got left commented out in code. Drop these lines to avoid confusion.

[1] da1e295e00 (t604[236]: do not run setup in separate tests, 2019-10-22)

---
 t/t6422-merge-rename-corner-cases.sh | 2 --
 1 file changed, 2 deletions(-)
t/t6422-merge-rename-corner-cases.sh +0 -2
index 346253c7c8..076b6a74d5 100755
@@ -1159,7 +1159,6 @@ test_conflicts_with_adds_and_renames() {
 	#   4) There should not be any three~* files in the working
 	#      tree
 	test_setup_collision_conflict () {
-	#test_expect_success "setup simple $sideL/$sideR conflict" '
 		git init simple_${sideL}_${sideR} &&
 		(
 			cd simple_${sideL}_${sideR} &&
@@ -1236,7 +1235,6 @@ test_conflicts_with_adds_and_renames() {
 			fi &&
 			test_tick && git commit -m R
 		)
-	#'
 	}
 
 	test_expect_success "check simple $sideL/$sideR conflict" '
Signature · 1 line
2.39.0
#7 lore raw

PATCH 3/3 t7527: use test_when_finished in 'case insensitive+preserving'

In reply to Andrei Rybak

Most tests in t7527-builtin-fsmonitor.sh that start a daemon, use the helper function test_when_finished with stop_daemon_delete_repo. Function stop_daemon_delete_repo explicitly stops the daemon. Calling it via test_when_finished is needed for tests that don't check daemon's automatic shutdown logic [1] and it is needed to avoid daemons being left running in case of breakage of the logic of automatic shutdown of the daemon.

Unlike these tests, test 'case insensitive+preserving' added in [2] has a call to function test_when_finished commented out. It was commented out in all versions of the patch [2] during development [3]. This seems to not be intentional, because neither commit message in [2], nor the comment above the test mention this line being commented out. Compare it, for example, to "# unicode_debug=true" which is explicitly described by a documentation comment above it.

Uncomment test_when_finished for stop_daemon_delete_repo in test 'case insensitive+preserving' to ensure that daemons are not left running in cases when automatic shutdown logic of daemon itself is broken.

[1] See documentation in "fsmonitor--daemon.h" for details.
[2] caa9c37ec0 (t7527: test FSMonitor on case insensitive+preserving

    file system, 2022-05-26)
[3] See mailing list thread
    https://lore.kernel.org/git/41f8cbc2ae45cb86e299eb230ad3cb0319256c37.1653601644.git.gitgitgadget@gmail.com/T/#t
---
 t/t7527-builtin-fsmonitor.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
t/t7527-builtin-fsmonitor.sh +1 -1
index 76d0220daa..2c271b4d7e 100755
@@ -910,7 +910,7 @@ test_expect_success "submodule absorbgitdirs implicitly starts daemon" '
 # the file/directory.
 #
 test_expect_success CASE_INSENSITIVE_FS 'case insensitive+preserving' '
-#	test_when_finished "stop_daemon_delete_repo test_insensitive" &&
+	test_when_finished "stop_daemon_delete_repo test_insensitive" &&
 
 	git init test_insensitive &&
 
Signature · 1 line
2.39.0
#8 lore raw

Re: [PATCH v1 3/3] t7527: use test_when_finished in 'case insensitive+preserving'

Quoted 24 lines · Andrei Rybak

Most tests in t7527-builtin-fsmonitor.sh that start a daemon, use the helper function test_when_finished with stop_daemon_delete_repo. Function stop_daemon_delete_repo explicitly stops the daemon. Calling it via test_when_finished is needed for tests that don't check daemon's automatic shutdown logic [1] and it is needed to avoid daemons being left running in case of breakage of the logic of automatic shutdown of the daemon.

Unlike these tests, test 'case insensitive+preserving' added in [2] has a call to function test_when_finished commented out. It was commented out in all versions of the patch [2] during development [3]. This seems to not be intentional, because neither commit message in [2], nor the comment above the test mention this line being commented out. Compare it, for example, to "# unicode_debug=true" which is explicitly described by a documentation comment above it.

Uncomment test_when_finished for stop_daemon_delete_repo in test 'case insensitive+preserving' to ensure that daemons are not left running in cases when automatic shutdown logic of daemon itself is broken.

---

t/t7527-builtin-fsmonitor.sh test_expect_success "submodule absorbgitdirs implicitly starts daemon" ' · line 911

Quoted 3 lines
t/t7527-builtin-fsmonitor.sh +1 -1
@@ -910,7 +910,7 @@ test_expect_success "submodule absorbgitdirs implicitly starts daemon" '
 test_expect_success CASE_INSENSITIVE_FS 'case insensitive+preserving' '
-#      test_when_finished "stop_daemon_delete_repo test_insensitive" &&
+       test_when_finished "stop_daemon_delete_repo test_insensitive" &&

Nice. Thanks for working on this (and the series as a whole) in response to a very tangential comment of mine[1] when replying to an unrelated patch of yours.

[1]: https://lore.kernel.org/git/CAPig+cTgUPWxMox_nSka52dML6_GHUUoY4HCtcq7+7J0oEyeNw@mail.gmail.com/

#9 lore raw

Re: [PATCH v1 0/3] fixes for commented out code in tests (was "Re: [PATCH] *: fix typos which duplicate a word")

In reply to Andrei Rybak
Quoted 11 lines · Andrei Rybak

[...]

Here's a patch series that fixes some of the commented out test code.

I skipped changing the following:

1. a minute-long test_expect_failure is commented out in t0014-alias.sh . Technically, this could be uncommented and marked with EXPENSIVE prerequisite, but it doesn't seem worth it for a test_expect_failure. [ cc Tim Schumacher, who added this test in fef5f7fc43 (t0014: introduce an alias testing suite, 2018-09-16) ]

The reason why this particular test is commented out (and why it mentions a run time of one minute) is because support for detecting external alias loops isn't yet implemented. This means that running that test would spin the test runner until the test times out due to an intentional infinite loop.

As soon as that is implemented properly, git would ideally detect the loop after a few iterations at latest, so the test wouldn't require to be marked as 'EXPENSIVE' in the first place.

For the context of your patches, skipping adjusting this test is most likely fine, as it references currently unimplemented behavior and it presumably would require more adjustments anyways before finally being enabled.

Quoted 3 lines

[...]

Tim

#10 lore raw

Re: [PATCH v1 0/3] fixes for commented out code in tests (was "Re: [PATCH] *: fix typos which duplicate a word")

In reply to Andrei Rybak
Quoted 10 lines · Andrei Rybak

[ I apologize for some people getting this twice -- I messed up when
invoking git send-email ]

Quoted 5 lines · Eric Sunshine

Not related to your patch at all, but I notice in this test that the call to test_when_finished() is commented out:

    # test_when_finished "stop_daemon_delete_repo test_insensitive" &&
Quoted 7 lines
Quoted 5 lines

which makes me wonder if it was commented out while the test was being debugged but then forgotten, and that the script is now potentially leaking a running daemon if something in the test fails after the daemon was started, or if the daemon does not shut down on its own as it's supposed to do. [cc:+Jeff Hostetler]

Here's a patch series that fixes some of the commented out test code.

Patch 2 is obviously correct. Patches 1 & 3 make sense to me, but it would be nice to have someone familiar with fsmonitor look at #3.

As to your notes about other related testcases...

Quoted 1 line

I skipped changing the following:

[...]

Quoted 6 lines

2. In t6426-merge-skip-unneeded-updates.sh, second part of the test '2c: Modify b & add c VS rename b->c' is commented out with an explicit "# FIXME:
rename/add conflicts are horribly broken right now;" above the commented out part.
[ cc Elijah Newren, author of c04ba51739 (t6046: testcases checking whether updates can be skipped in a merge, 2018-04-19) ]

[...]

You missed the cc...but I looked up this email since you did cc me for patch 2/3.

Yeah, the commented out code was never tested, because the only thing I could have tested at the time was incorrect results. So I just took a guess at what the improved testing would look like and apparently made 3 small errors in doing so. I have fixed it locally and can submit a patch.

#11 lore raw

Re: [PATCH v1 0/3] fixes for commented out code in tests (was "Re: [PATCH] *: fix typos which duplicate a word")

Quoted 35 lines · Elijah Newren
Quoted 10 lines · Andrei Rybak

[ I apologize for some people getting this twice -- I messed up when
invoking git send-email ]

Quoted 5 lines · Eric Sunshine

Not related to your patch at all, but I notice in this test that the call to test_when_finished() is commented out:

    # test_when_finished "stop_daemon_delete_repo test_insensitive" &&
Quoted 7 lines
Quoted 5 lines

which makes me wonder if it was commented out while the test was being debugged but then forgotten, and that the script is now potentially leaking a running daemon if something in the test fails after the daemon was started, or if the daemon does not shut down on its own as it's supposed to do. [cc:+Jeff Hostetler]

Here's a patch series that fixes some of the commented out test code.

Patch 2 is obviously correct. Patches 1 & 3 make sense to me, but it would be nice to have someone familiar with fsmonitor look at #3.

As to your notes about other related testcases...

Quoted 1 line

I skipped changing the following:

[...]

Quoted 6 lines

2. In t6426-merge-skip-unneeded-updates.sh, second part of the test '2c: Modify b & add c VS rename b->c' is commented out with an explicit "# FIXME:
rename/add conflicts are horribly broken right now;" above the commented out part.
[ cc Elijah Newren, author of c04ba51739 (t6046: testcases checking whether updates can be skipped in a merge, 2018-04-19) ]

[...]

Quoted 8 lines

You missed the cc...but I looked up this email since you did cc me for patch 2/3.

Yeah, the commented out code was never tested, because the only thing I could have tested at the time was incorrect results. So I just took a guess at what the improved testing would look like and apparently made 3 small errors in doing so. I have fixed it locally and can submit a patch.

Submitted here:
https://lore.kernel.org/git/[email protected]/

#12 lore raw
In reply to Andrei Rybak
Quoted 4 lines · Andrei Rybak

A tricky case is usage of "that that", which is sometimes grammatically correct. However, an instance of this in "t7527-builtin-fsmonitor.sh" doesn't need two words "that", because there is only one daemon being discussed, so the word "daemon" does not need a determiner.

Makes me wonder if it is more appropriage to replace the second "that" with "the" there, then.

Other than that, everything else in the patch looks good.