git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 2/2] push: suggest <remote> <branch> for a slash slip

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 25, 2026, 03:36 UTC
Message-ID
<xmqq1pdvgukt.fsf@gitster.g>
In-Reply-To
<xmqqa4sjh85o.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 16 quoted lines
> "Harald Nordgren via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
>> diff --git a/t/t5529-push-errors.sh b/t/t5529-push-errors.sh
>> index 80b06a0cd2..cfb294305d 100755
>> --- a/t/t5529-push-errors.sh
>> +++ b/t/t5529-push-errors.sh
>> @@ -54,6 +54,37 @@ test_expect_success 'detect empty remote with targeted refspec' '
>>  	grep "fatal: bad repository ${SQ}${SQ}" stderr
>>  '
> t5529-push-errors.sh:59: error: bare grep outside pipeline (use test_grep)
> t5529-push-errors.sh:60: error: bare grep outside pipeline (use test_grep)
> t5529-push-errors.sh:62: error: bare grep outside pipeline (use test_grep)
> t5529-push-errors.sh:67: error: bare grep outside pipeline (use test_grep)
> t5529-push-errors.sh:72: error: bare grep outside pipeline (use test_grep)
> t5529-push-errors.sh:77: error: bare grep outside pipeline (use test_grep)
> t5529-push-errors.sh:84: error: bare grep outside pipeline (use test_grep)

I've queued this squashable? fix on top of the branch before merging the result to 'seen' for tonight's push-out.

Thanks.
--- >8 ---
Subject: [PATCH] SQUASH??? use test_grep
---
 t/t5529-push-errors.sh | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/t/t5529-push-errors.sh b/t/t5529-push-errors.sh
index cfb294305d..2294645902 100755
--- a/t/t5529-push-errors.sh
+++ b/t/t5529-push-errors.sh
@@ -56,32 +56,32 @@ test_expect_success 'detect empty remote with targeted refspec' '
 
 test_expect_success 'suggest <remote> <branch> for a <remote>/<branch> slip' '
 	test_must_fail git push origin/main 2>stderr &&
-	grep "${SQ}origin/main${SQ} is not a valid push target" stderr &&
-	grep "hint: Did you mean to use: git push origin main?" stderr &&
+	test_grep "${SQ}origin/main${SQ} is not a valid push target" stderr &&
+	test_grep "hint: Did you mean to use: git push origin main?" stderr &&
 	test_must_fail git -c advice.pushRepoLooksLikeRef=false push origin/main 2>stderr &&
-	! grep "Did you mean" stderr
+	test_grep ! "Did you mean" stderr
 '
 
 test_expect_success 'suggest <remote> <branch> when the branch has slashes' '
 	test_must_fail git push origin/feature/x 2>stderr &&
-	grep "hint: Did you mean to use: git push origin feature/x?" stderr
+	test_grep "hint: Did you mean to use: git push origin feature/x?" stderr
 '
 
 test_expect_success 'no suggestion when prefix is not a configured remote' '
 	test_must_fail git push not-a-remote/main 2>stderr &&
-	! grep "Did you mean" stderr
+	test_grep ! "Did you mean" stderr
 '
 
 test_expect_success 'no suggestion for a trailing slash with no branch' '
 	test_must_fail git push origin/ 2>stderr &&
-	! grep "Did you mean" stderr
+	test_grep ! "Did you mean" stderr
 '
 
 test_expect_success 'no suggestion when the argument is an existing path' '
 	test_when_finished "rm -rf origin" &&
 	git init --bare origin/main &&
 	git push origin/main HEAD:refs/heads/pushed 2>stderr &&
-	! grep "Did you mean" stderr &&
+	test_grep ! "Did you mean" stderr &&
 	git -C origin/main rev-parse --verify refs/heads/pushed
 '
 
-- 
2.55.0-rc2-165-g3249676ba5
Previous: Junio C HamanoNext: Harald Nordgren
Message 19 of 26 in “branch/push: suggest intended form when remote/branch slip given”
  1. 0/2 branch/push: suggest intended form when remote/branch slip givenHarald Nordgren via GitGitGadget, Jun 12, 2026
  2. 1/2 branch: suggest <remote>/<branch> on upstream slipHarald Nordgren via GitGitGadget, Jun 12, 2026
  3. Junio C HamanoJun 22, 2026
  4. Junio C HamanoJun 22, 2026
  5. Ben KnobleJun 24, 2026
  6. 2/2 push: suggest <remote> <branch> for a slash slipHarald Nordgren via GitGitGadget, Jun 12, 2026
  7. Junio C HamanoJun 22, 2026
  8. Harald NordgrenJun 22, 2026
  9. Weijie YuanJun 22, 2026
  10. Junio C HamanoJun 22, 2026
  11. Harald NordgrenJun 23, 2026
  12. 0/2 branch/push: suggest intended form when remote/branch slip givenHarald Nordgren via GitGitGadget, Jun 24, 2026
  13. 1/2 branch: suggest <remote>/<branch> on upstream slipHarald Nordgren via GitGitGadget, Jun 24, 2026
  14. Junio C HamanoJun 24, 2026
  15. Harald NordgrenJun 25, 2026
  16. Junio C HamanoJun 25, 2026
  17. 2/2 push: suggest <remote> <branch> for a slash slipHarald Nordgren via GitGitGadget, Jun 24, 2026
  18. Junio C HamanoJun 24, 2026
  19. Junio C HamanoJun 25, 2026
  20. Harald NordgrenJun 25, 2026
  21. Junio C HamanoJun 25, 2026
  22. 0/2 branch/push: suggest intended form when remote/branch slip givenHarald Nordgren via GitGitGadget, Jun 27, 2026
  23. 1/2 branch: suggest <remote>/<branch> on upstream slipHarald Nordgren via GitGitGadget, Jun 27, 2026
  24. Junio C HamanoJun 28, 2026
  25. Harald NordgrenJun 28, 2026
  26. 2/2 push: suggest <remote> <branch> for a slash slipHarald Nordgren via GitGitGadget, Jun 27, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.