Microproject: avoid suppressing git's exit code
cover Microproject: avoid suppressing git's exit code
Piping git command output directly to subsequent command (eg. grep) hides the exit code of git behind the pipe. A crash in git would go unnoticed because the shell only sees grep's exit code.
This series extends the same fix to 16 more test files, following the approach introduced in t8003 [1] (redirect output to a temporary file, then use test_grep on that file).
Note: t2206 is a special case -- some tests cd into a subdirectory that is itself a git repo and run 'git add .' on the whole working tree. To prevent the temporary file from being accidentally staged, it is written as '../actual', outside the inner repo.
Related-to: https://lore.kernel.org/git/[email protected]/T/#t
See-also: https://lore.kernel.org/git/[email protected]/T/#t
Trieu Huynh (16):
t7004: avoid suppressing git's exit code
t6423: avoid suppressing git's exit code
t6411: avoid suppressing git's exit code
t6101: avoid suppressing git's exit code
t6006: avoid suppressing git's exit code
t5304: avoid suppressing git's exit code
t4153: avoid suppressing git's exit code
t4150: avoid suppressing git's exit code
t4140: avoid suppressing git's exit code
t4039: avoid suppressing git's exit code
t3903: avoid suppressing git's exit code
t3701: avoid suppressing git's exit code
t3412: avoid suppressing git's exit code
t1400: avoid suppressing git's exit code
t0100: avoid suppressing git's exit code
t2206: avoid suppressing git's exit code
t/t0100-previous.sh | 3 +- t/t1400-update-ref.sh | 3 +- t/t2206-add-submodule-ignored.sh | 45 +++++++++++++++++++---------- t/t3412-rebase-root.sh | 6 ++-- t/t3701-add-interactive.sh | 12 +++++--- t/t3903-stash.sh | 5 ++-- t/t4039-diff-assume-unchanged.sh | 3 +- t/t4140-apply-ita.sh | 3 +- t/t4150-am.sh | 5 ++-- t/t4153-am-resume-override-opts.sh | 3 +- t/t5304-prune.sh | 3 +- t/t6006-rev-list-format.sh | 3 +- t/t6101-rev-parse-parents.sh | 3 +- t/t6411-merge-filemode.sh | 6 ++-- t/t6423-merge-rename-directories.sh | 3 +- t/t7004-tag.sh | 6 ++-- 16 files changed, 74 insertions(+), 38 deletions(-)
Signature · 1 line
2.43.0
PATCH 1/16 t7004: avoid suppressing git's exit code
Update t7004-tag.sh to redirect git-cmds output to a temporary file instead of piping it directly to not hide the exit code of git commands behind pipes, as a crash in git might go unnoticed.
--- t/t7004-tag.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
t/t7004-tag.sh +4 -2
@@ -1560,7 +1560,8 @@ test_expect_success 'filename for the message is relative to cwd' ' cd subdir && git tag -a -F msgfile-5 tag-from-subdir ) && - git cat-file tag tag-from-subdir | grep "in sub directory" + git cat-file tag tag-from-subdir >actual && + test_grep "in sub directory" actual ' test_expect_success 'filename for the message is relative to cwd' '
@@ -1569,7 +1570,8 @@ test_expect_success 'filename for the message is relative to cwd' ' cd subdir && git tag -a -F msgfile-6 tag-from-subdir-2 ) && - git cat-file tag tag-from-subdir-2 | grep "in sub directory" + git cat-file tag tag-from-subdir-2 >actual && + test_grep "in sub directory" actual ' # create a few more commits to test --contains
Signature · 1 line
2.43.0
PATCH 2/16 t6423: avoid suppressing git's exit code
In reply to Trieu HuynhUpdate t6423-merge-rename-directories.sh to redirect git-cmds output to a temporary file instead of piping it directly to not hide the exit code of git commands behind pipes, as a crash in git might go unnoticed.
--- t/t6423-merge-rename-directories.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
t/t6423-merge-rename-directories.sh +2 -1
@@ -2273,7 +2273,8 @@ test_expect_success '8c: modify/delete or rename+modify/delete' ' test_cmp expect actual && test_must_fail git rev-parse :2:z/d && - git ls-files -s z/d | grep ^100755 && + git ls-files -s z/d >actual && + test_grep "^100755" actual && test_path_is_file z/d && test_path_is_missing y/d )
Signature · 1 line
2.43.0
PATCH 3/16 t6411: avoid suppressing git's exit code
In reply to Trieu HuynhUpdate t6411-merge-filemode.sh to redirect git-cmds output to a temporary file instead of piping it directly to not hide the exit code of git commands behind pipes, as a crash in git might go unnoticed.
--- t/t6411-merge-filemode.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
t/t6411-merge-filemode.sh +4 -2
@@ -27,7 +27,8 @@ do_one_mode () { test_expect_success "resolve single mode change ($strategy, $us)" ' git checkout -f $us && git merge -s $strategy $them && - git ls-files -s file1 | grep ^100755 + git ls-files -s file1 >actual && + test_grep "^100755" actual ' test_expect_success FILEMODE "verify executable bit on file ($strategy, $us)" '
@@ -65,7 +66,8 @@ do_both_modes () { test_must_fail git merge -s $strategy b2 && git ls-files -u >actual && test_cmp expect actual && - git ls-files -s file2 | grep ^100755 + git ls-files -s file2 >actual && + test_grep "^100755" actual ' test_expect_success FILEMODE "verify executable bit on file ($strategy)" '
Signature · 1 line
2.43.0
PATCH 4/16 t6101: avoid suppressing git's exit code
In reply to Trieu HuynhUpdate t6101-rev-parse-parents.sh to redirect git-cmds output to a temporary file instead of piping it directly to not hide the exit code of git commands behind pipes, as a crash in git might go unnoticed.
--- t/t6101-rev-parse-parents.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
t/t6101-rev-parse-parents.sh +2 -1
@@ -39,7 +39,8 @@ test_expect_success 'setup' ' ' test_expect_success 'start is valid' ' - git rev-parse start | grep "^$OID_REGEX$" + git rev-parse start >actual && + test_grep "^$OID_REGEX$" actual ' test_expect_success 'start^0' '
Signature · 1 line
2.43.0
PATCH 5/16 t6006: avoid suppressing git's exit code
In reply to Trieu HuynhUpdate t6006-rev-list-format.sh to redirect git-cmds output to a temporary file instead of piping it directly to not hide the exit code of git commands behind pipes, as a crash in git might go unnoticed.
--- t/t6006-rev-list-format.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
t/t6006-rev-list-format.sh +2 -1
@@ -289,7 +289,8 @@ test_expect_success 'basic colors' ' ' test_expect_success '%S is not a placeholder for rev-list yet' ' - git rev-list --format="%S" -1 main | grep "%S" + git rev-list --format="%S" -1 main >actual && + test_grep "%S" actual ' test_expect_success 'advanced colors' '
Signature · 1 line
2.43.0
PATCH 6/16 t5304: avoid suppressing git's exit code
In reply to Trieu HuynhUpdate t5304-prune.sh to redirect git-cmds output to a temporary file instead of piping it directly to not hide the exit code of git commands behind pipes, as a crash in git might go unnoticed.
--- t/t5304-prune.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
t/t5304-prune.sh +2 -1
@@ -264,7 +264,8 @@ test_expect_success 'prune .git/shallow when there are no loose objects' ' git update-ref refs/heads/shallow-tip $oid && git repack -ad && # verify assumption that all loose objects are gone - git count-objects | grep ^0 && + git count-objects >actual && + test_grep "^0" actual && git prune && echo $oid >expect && test_cmp expect .git/shallow
Signature · 1 line
2.43.0
PATCH 7/16 t4153: avoid suppressing git's exit code
In reply to Trieu HuynhUpdate t4153-am-resume-override-opts.sh to redirect git-cmds output to a temporary file instead of piping it directly to not hide the exit code of git commands behind pipes, as a crash in git might go unnoticed.
--- t/t4153-am-resume-override-opts.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
t/t4153-am-resume-override-opts.sh +2 -1
@@ -81,7 +81,8 @@ test_expect_success '--signoff overrides --no-signoff' ' # Applied side1 will be signed off echo "Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>" >expected && - git cat-file commit HEAD^ | grep "Signed-off-by:" >actual && + git cat-file commit HEAD^ >commit_raw && + test_grep "Signed-off-by:" commit_raw >actual && test_cmp expected actual && # Applied side2 will not be signed off
Signature · 1 line
2.43.0
Re: [GSoC PATCH 07/16] t4153: avoid suppressing git's exit code
Quoted 15 lines · Trieu Huynh
Update
t4153-am-resume-override-opts.shto redirect git-cmds output to a temporary file instead of piping it directly to not hide the exit code of git commands behind pipes, as a crash in git might go unnoticed.Signed-off-by Trieu Huynh <[email protected]>--- t/t4153-am-resume-override-opts.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)t/t4153-am-resume-override-opts.sh +0
-0
t/t4153-am-resume-override-opts.sh test_expect_success '--signoff overrides --no-signoff' ' · line 85
Quoted 6 lines
t/t4153-am-resume-override-opts.sh +2
-1@@ -81,7 +81,8 @@ test_expect_success '--signoff overrides --no-signoff' ' # Applied side1 will be signed off echo "Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>" >expected && - git cat-file commit HEAD^ | grep "Signed-off-by:" >actual && + git cat-file commit HEAD^ >commit_raw && + test_grep "Signed-off-by:" commit_raw >actual &&
The behavior of 'test_grep' is the opposite of what you might expect. It does nothing when the input matches, and only reports an error when it doesn't match. Therefore, 'actual' is empty here...
t/t4153-am-resume-override-opts.sh test_expect_success '--signoff overrides --no-signoff' ' · line 88
Quoted 3 lines
t/t4153-am-resume-override-opts.sh +0
-0test_cmp expected actual && # Applied side2 will not be signed off
...and this test is bound to fail.
Regards, Yuchen
PATCH 8/16 t4150: avoid suppressing git's exit code
In reply to Trieu HuynhUpdate t4150-am.sh to redirect git-cmds output to a temporary file instead of piping it directly to not hide the exit code of git commands behind pipes, as a crash in git might go unnoticed.
--- t/t4150-am.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
t/t4150-am.sh +3 -2
@@ -1094,8 +1094,9 @@ test_expect_success 'am works with multi-line in-body headers' ' git checkout HEAD^ && git am msg && # Ensure that the author and full message are present - git cat-file commit HEAD | grep "^author.*[email protected]" && - git cat-file commit HEAD | grep "^$LONG$" + git cat-file commit HEAD >actual && + test_grep "^author.*[email protected]" actual && + test_grep "^$LONG$" actual ' test_expect_success 'am --quit keeps HEAD where it is' '
Signature · 1 line
2.43.0
PATCH 9/16 t4140: avoid suppressing git's exit code
In reply to Trieu HuynhUpdate t4140-apply-ita.sh to redirect git-cmds output to a temporary file instead of piping it directly to not hide the exit code of git commands behind pipes, as a crash in git might go unnoticed.
--- t/t4140-apply-ita.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
t/t4140-apply-ita.sh +2 -1
@@ -79,7 +79,8 @@ test_expect_success 'apply complex patch with -N' ' git apply -N complex-patch && git ls-files --stage --error-unmatch test-file && - git diff | grep "a/committed-file" + git diff >actual && + test_grep "a/committed-file" actual ' test_done
Signature · 1 line
2.43.0
PATCH 10/16 t4039: avoid suppressing git's exit code
In reply to Trieu HuynhUpdate t4039-diff-assume-unchanged.sh to redirect git-cmds output to a temporary file instead of piping it directly to not hide the exit code of git commands behind pipes, as a crash in git might go unnoticed.
--- t/t4039-diff-assume-unchanged.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
t/t4039-diff-assume-unchanged.sh +2 -1
@@ -21,7 +21,8 @@ test_expect_success 'setup' ' ' test_expect_success 'diff-index does not examine assume-unchanged entries' ' - git diff-index HEAD^ -- one | grep -q $blob + git diff-index HEAD^ -- one >actual && + test_grep "$blob" actual ' test_expect_success 'diff-files does not examine assume-unchanged entries' '
Signature · 1 line
2.43.0
PATCH 11/16 t3903: avoid suppressing git's exit code
In reply to Trieu HuynhUpdate t3903-stash.sh to redirect git-cmds output to a temporary file instead of piping it directly to not hide the exit code of git commands behind pipes, as a crash in git might go unnoticed.
--- t/t3903-stash.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
t/t3903-stash.sh +3 -2
@@ -962,7 +962,8 @@ test_expect_success 'store updates stash ref and reflog' ' test_path_is_missing bazzy && git stash store -m quuxery $STASH_ID && test $(git rev-parse stash) = $STASH_ID && - git reflog --format=%H stash| grep $STASH_ID && + git reflog --format=%H stash >actual && + test_grep "$STASH_ID" actual && git stash pop && grep quux bazzy '
@@ -976,7 +977,7 @@ test_expect_success 'handle stash specification with spaces' ' echo cow >file && git stash && git stash apply "stash@{$stamp}" && - grep pig file + test_grep pig file ' test_expect_success 'setup stash with index and worktree changes' '
Signature · 1 line
2.43.0
Re: [GSoC PATCH 11/16] t3903: avoid suppressing git's exit code
Quoted 25 lines · Trieu Huynh
Update
t3903-stash.shto redirect git-cmds output to a temporary file instead of piping it directly to not hide the exit code of git commands behind pipes, as a crash in git might go unnoticed.Signed-off-by Trieu Huynh <[email protected]>--- t/t3903-stash.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)t/t3903-stash.sh +2
-1@@ -962,7 +962,8 @@ test_expect_success 'store updates stash ref and reflog' ' test_path_is_missing bazzy && git stash store -m quuxery $STASH_ID && test $(git rev-parse stash) = $STASH_ID && - git reflog --format=%H stash| grep $STASH_ID && + git reflog --format=%H stash >actual && + test_grep "$STASH_ID" actual && git stash pop && grep quux bazzy '
t/t3903-stash.sh test_expect_success 'handle stash specification with spaces' ' · line 980
Quoted 5 lines
t/t3903-stash.sh +1
-1@@ -976,7 +977,7 @@ test_expect_success 'handle stash specification with spaces' ' echo cow >file && git stash && git stash apply "stash@{$stamp}" && - grep pig file + test_grep pig file
What does this have to do with the title of this patch? There is no pipe operator here, not even a single Git command. I suspect you wrote a script to generate this series of patches. The commit messages are the same for every patch.
As mentioned in the link provided by Junio, what matters in microprojects is quality, not quantity. Are these patches meaningful in and of themselves? Of course they are, but are they *necessary*? That’s a matter of opinion. What really matters is that the Git community evaluates your overall performance to determine whether you have the ability to write code according to the code guidelines, test your own work, and communicate with other developers — not how useful the patch itself is.
t/t3903-stash.sh test_expect_success 'handle stash specification with spaces' ' · line 983
Quoted 3 lines
t/t3903-stash.sh +0
-0' test_expect_success 'setup stash with index and worktree changes' '
Keep learning, and welcome to the Git community!
Regards, Yuchen
PATCH 12/16 t3701: avoid suppressing git's exit code
In reply to Trieu HuynhUpdate t3701-add-interactive.sh to redirect git-cmds output to a temporary file instead of piping it directly to not hide the exit code of git commands behind pipes, as a crash in git might go unnoticed.
--- t/t3701-add-interactive.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
t/t3701-add-interactive.sh +8 -4
@@ -293,8 +293,10 @@ test_expect_success FILEMODE 'patch does not affect mode' ' echo content >>file && chmod +x file && printf "n\\ny\\n" | git add -p && - git show :file | grep content && - git diff file | grep "new mode" + git show :file >actual && + test_grep content actual && + git diff file >actual && + test_grep "new mode" actual ' test_expect_success FILEMODE 'stage mode but not hunk' '
@@ -302,8 +304,10 @@ test_expect_success FILEMODE 'stage mode but not hunk' ' echo content >>file && chmod +x file && printf "y\\nn\\n" | git add -p && - git diff --cached file | grep "new mode" && - git diff file | grep "+content" + git diff --cached file >actual && + test_grep "new mode" actual && + git diff file >actual && + test_grep "+content" actual '
Signature · 1 line
2.43.0
PATCH 13/16 t3412: avoid suppressing git's exit code
In reply to Trieu HuynhUpdate t3412-rebase-root.sh to redirect git-cmds output to a temporary file instead of piping it directly to not hide the exit code of git commands behind pipes, as a crash in git might go unnoticed.
--- t/t3412-rebase-root.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
t/t3412-rebase-root.sh +4 -2
@@ -171,7 +171,8 @@ test_expect_success 'set up a conflict' ' test_expect_success 'rebase --root with conflict (first part)' ' git checkout -b conflict1 other && test_must_fail git rebase --root --onto main && - git ls-files -u | grep "B$" + git ls-files -u >actual && + test_grep "B$" actual ' test_expect_success 'fix the conflict' '
@@ -198,7 +199,8 @@ test_expect_success 'rebase --root with conflict (second part)' ' test_expect_success 'rebase -i --root with conflict (first part)' ' git checkout -b conflict2 other && test_must_fail git rebase -i --root --onto main && - git ls-files -u | grep "B$" + git ls-files -u >actual && + test_grep "B$" actual ' test_expect_success 'fix the conflict' '
Signature · 1 line
2.43.0
PATCH 14/16 t1400: avoid suppressing git's exit code
In reply to Trieu HuynhUpdate t1400-update-ref.sh to redirect git-cmds output to a temporary file instead of piping it directly to not hide the exit code of git commands behind pipes, as a crash in git might go unnoticed.
--- t/t1400-update-ref.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
t/t1400-update-ref.sh +2 -1
@@ -1404,7 +1404,8 @@ test_expect_success 'handle per-worktree refs in refs/bisect' ' ! grep refs/bisect for-each-ref.out && git update-ref refs/bisect/something HEAD && git rev-parse refs/bisect/something >../worktree-head && - git for-each-ref | grep refs/bisect/something + git for-each-ref >actual && + test_grep refs/bisect/something actual ) && git show-ref >actual && ! grep 'refs/bisect' actual &&
Signature · 1 line
2.43.0
PATCH 15/16 t0100: avoid suppressing git's exit code
In reply to Trieu HuynhUpdate t0100-previous.sh to redirect git-cmds output to a temporary file instead of piping it directly to not hide the exit code of git commands behind pipes, as a crash in git might go unnoticed.
--- t/t0100-previous.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
t/t0100-previous.sh +2 -1
@@ -40,7 +40,8 @@ test_expect_success 'merge @{-1}' ' git checkout other && git checkout main && git merge @{-1} && - git cat-file commit HEAD | grep "Merge branch '\''other'\''" + git cat-file commit HEAD >actual && + test_grep "Merge branch '\''other'\''" actual ' test_expect_success 'merge @{-1}~1' '
Signature · 1 line
2.43.0
PATCH 16/16 t2206: avoid suppressing git's exit code
In reply to Trieu HuynhUpdate t2206-add-submodule-ignored.sh to redirect git-cmds output to a temporary file instead of piping it directly to not hide the exit code of git commands behind pipes, as a crash in git might go unnoticed.
Some tests run inside a subdirectory that is itself a git repo and use 'git add .' on the whole working tree, so the temporary file is written as '../actual' to keep it outside the inner repo and prevent it from being accidentally staged.
--- t/t2206-add-submodule-ignored.sh | 45 +++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 15 deletions(-)
t/t2206-add-submodule-ignored.sh +30 -15
@@ -45,9 +45,11 @@ test_expect_success 'main: add submodule with default config' ' cd main && git submodule add ../sub && git commit -m "add submodule" && - git log --oneline --name-only | grep "^sub$" && + git log --oneline --name-only >actual && + test_grep "^sub$" actual && git -C sub reset --hard v2.0 && - git status --porcelain | grep "^ M sub$" && + git status --porcelain >actual && + test_grep "^ M sub$" actual && echo ' #3
@@ -58,8 +60,10 @@ test_expect_success 'main: submodule config ignore=all' ' git config -f .gitmodules submodule.sub.ignore all && GIT_TRACE=1 git add . && git commit -m "update submodule config sub.ignore all" && - ! git status --porcelain | grep "^.*$" && - ! git log --oneline --name-only | grep "^sub$" && + git status --porcelain >../actual && + test_must_be_empty ../actual && + git log --oneline --name-only >../actual && + test_grep ! "^sub$" ../actual && echo ' #4
@@ -69,8 +73,10 @@ test_expect_success 'sub: change to different sha1 and check status in main' ' cd "${base_path}" && cd main && git -C sub reset --hard v1.0 && - ! git status --porcelain | grep "^ M sub$" && - git status --ignore-submodules=none --porcelain | grep "^ M sub$" && + git status --porcelain >../actual && + test_grep ! "^ M sub$" ../actual && + git status --ignore-submodules=none --porcelain >../actual && + test_grep "^ M sub$" ../actual && echo '
@@ -80,7 +86,8 @@ test_expect_success 'main: check normal add and status' ' cd "${base_path}" && cd main && GIT_TRACE=1 git add . && - ! git status --porcelain | grep "^ M sub$" && + git status --porcelain >../actual && + test_grep ! "^ M sub$" ../actual && echo '
@@ -91,7 +98,8 @@ test_expect_success 'main: check --force add . and status' ' cd "${base_path}" && cd main && GIT_TRACE=1 git add --force . && - ! git status --porcelain | grep "^M sub$" && + git status --porcelain >../actual && + test_grep ! "^M sub$" ../actual && echo '
@@ -101,8 +109,10 @@ test_expect_success 'main: check --force add . and status' ' test_expect_success 'main: check _add sub_ and status' ' cd "${base_path}" && cd main && - GIT_TRACE=1 git add sub 2>&1 | grep "Skipping submodule due to ignore=all: sub" && - ! git status --porcelain | grep "^M sub$" && + GIT_TRACE=1 git add sub >../actual 2>&1 && + test_grep "Skipping submodule due to ignore=all: sub" ../actual && + git status --porcelain >../actual && + test_grep ! "^M sub$" ../actual && echo '
@@ -118,15 +128,20 @@ test_expect_success 'main: check force add sub and ./sub/ and status' ' cd main && echo "Adding with --force should work: git add --force sub" && GIT_TRACE=1 git add --force sub && - git status --porcelain | grep "^M sub$" && + git status --porcelain >../actual && + test_grep "^M sub$" ../actual && git restore --staged sub && - ! git status --porcelain | grep "^M sub$" && + git status --porcelain >../actual && + test_grep ! "^M sub$" ../actual && echo "Adding with --force should work: git add --force ./sub/" && GIT_TRACE=1 git add --force ./sub/ && - git status --porcelain | grep "^M sub$" && + git status --porcelain >../actual && + test_grep "^M sub$" ../actual && git commit -m "update submodule pointer" && - ! git status --porcelain | grep "^ M sub$" && - git log --ignore-submodules=none --name-only --oneline | grep "^sub$" && + git status --porcelain >../actual && + test_grep ! "^ M sub$" ../actual && + git log --ignore-submodules=none --name-only --oneline >../actual && + test_grep "^sub$" ../actual && echo '
Signature · 1 line
2.43.0
Quoted 8 lines · Trieu Huynh
Piping git command output directly to subsequent command (eg. grep) hides the exit code of git behind the pipe. A crash in git would go unnoticed because the shell only sees grep's exit code.
This series extends the same fix to 16 more test files, following the approach introduced in t8003 [1] (redirect output to a temporary file, then use
test_grepon that file).
Quoted 7 lines
Note: t2206 is a special case -- some tests cd into a subdirectory that is itself a git repo and run 'git add .' on the whole working tree. To prevent the temporary file from being accidentally staged, it is written as '../actual', outside the inner repo.
Related-to: https://lore.kernel.org/git/[email protected]/T/#t
See-also: https://lore.kernel.org/git/[email protected]/T/#t
Thanks.
Quoted 15 lines · Junio C Hamano
Quoted 13 lines · Trieu Huynh
Piping git command output directly to subsequent command (eg. grep) hides the exit code of git behind the pipe. A crash in git would go unnoticed because the shell only sees grep's exit code.
This series extends the same fix to 16 more test files, following the approach introduced in t8003 [1] (redirect output to a temporary file, then use
test_grepon that file).Note: t2206 is a special case -- some tests cd into a subdirectory that is itself a git repo and run 'git add .' on the whole working tree. To prevent the temporary file from being accidentally staged, it is written as '../actual', outside the inner repo.
Quoted 6 lines
Quoted 2 lines
Related-to: https://lore.kernel.org/git/[email protected]/T/#t
See-also: https://lore.kernel.org/git/[email protected]/T/#tThanks.
Ack, I missed that point. Could you clarify how many patches or files changed are considered appropriate for the microproject?
BRs,
Quoted 19 lines · Trieu Huynh
Quoted 18 lines · Junio C Hamano
Quoted 15 lines · Trieu Huynh
Piping git command output directly to subsequent command (eg. grep) hides the exit code of git behind the pipe. A crash in git would go unnoticed because the shell only sees grep's exit code.
This series extends the same fix to 16 more test files, following the approach introduced in t8003 [1] (redirect output to a temporary file, then use
test_grepon that file).Note: t2206 is a special case -- some tests cd into a subdirectory that is itself a git repo and run 'git add .' on the whole working tree. To prevent the temporary file from being accidentally staged, it is written as '../actual', outside the inner repo.
Related-to: https://lore.kernel.org/git/[email protected]/T/#t
See-also: https://lore.kernel.org/git/[email protected]/T/#t
Quoted 7 lines
Quoted 3 lines
Thanks.
Ack, I missed that point. Could you clarify how many patches or files changed are considered appropriate for the microproject?
BRs,
Hello,
The microprojects are meant for contributors to get a hang of contributing to the project. As such, we expect only a single file change. This is also listed in the Guidelines [1].
Thanks
[1]: https://git.github.io/General-Microproject-Information/
Quoted 2 lines · Trieu Huynh
Ack, I missed that point. Could you clarify how many patches or files changed are considered appropriate for the microproject?
The end product (i.e., a patch that could be applied to my tree) of a microproject is not expected to have any value to improve the project codebase. The process has two objectives. One is to help new people experience the end-to-end process of sending their first patch, getting it reviewed, engaging in a dialog with the reviewer and communicating with others in the community, and polishing and resubmitting the patch. And the other is to help us see how well each candidate can work with reviewers and others in the community.
The size of a microproject submission to allow us achieve the two goals may ideally be one-liner change ;-) but it may be a bit too hard to gauge the effectiveness of the candidate with such a small patch, so in practice the lower bound would be a single file with a few hunks, with two paragraphs in the proposed log message.
And we certainly do not need 16-patch series, each doing very similar things and likely to be making similar mistakes at the same time. Interactions with reviewers on just one patch would be sufficient for them to learn the community norm, and for us to gauge how effective the canidate is, without doing the same or similar exchanges for the other 15 patches.
Quoted 20 lines · Junio C Hamano
Quoted 2 lines · Trieu Huynh
Ack, I missed that point. Could you clarify how many patches or files changed are considered appropriate for the microproject?
The end product (i.e., a patch that could be applied to my tree) of a microproject is not expected to have any value to improve the project codebase. The process has two objectives. One is to help new people experience the end-to-end process of sending their first patch, getting it reviewed, engaging in a dialog with the reviewer and communicating with others in the community, and polishing and resubmitting the patch. And the other is to help us see how well each candidate can work with reviewers and others in the community.
The size of a microproject submission to allow us achieve the two goals may ideally be one-liner change ;-) but it may be a bit too hard to gauge the effectiveness of the candidate with such a small patch, so in practice the lower bound would be a single file with a few hunks, with two paragraphs in the proposed log message.
Quoted 7 lines
And we certainly do not need 16-patch series, each doing very similar things and likely to be making similar mistakes at the same time. Interactions with reviewers on just one patch would be sufficient for them to learn the community norm, and for us to gauge how effective the canidate is, without doing the same or similar exchanges for the other 15 patches.
Hello, I appreciate all your kind comments. Thank you. Drop this series here.
BRs,