Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Harald Nordgren via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org,  Harald Nordgren <haraldnordgren@gmail.com>
Subject: Re: [PATCH v2 2/2] push: suggest <remote> <branch> for a slash slip
Date: Wed, 24 Jun 2026 15:42:59 -0700	[thread overview]
Message-ID: <xmqqa4sjh85o.fsf@gitster.g> (raw)
In-Reply-To: <49de5a925de506ed9a141eb72927b2548b73af22.1782338114.git.gitgitgadget@gmail.com> (Harald Nordgren via GitGitGadget's message of "Wed, 24 Jun 2026 21:55:14 +0000")

"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
>  '
>  
> +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_must_fail git -c advice.pushRepoLooksLikeRef=false push origin/main 2>stderr &&
> +	! 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_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_expect_success 'no suggestion for a trailing slash with no branch' '
> +	test_must_fail git push origin/ 2>stderr &&
> +	! grep "Did you mean" 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)


      reply	other threads:[~2026-06-24 22:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-12 11:10 [PATCH 0/2] branch/push: suggest intended form when remote/branch slip given Harald Nordgren via GitGitGadget
2026-06-12 11:10 ` [PATCH 1/2] branch: suggest <remote>/<branch> on upstream slip Harald Nordgren via GitGitGadget
2026-06-22 19:56   ` Junio C Hamano
2026-06-22 21:35     ` Junio C Hamano
2026-06-24 12:35     ` Ben Knoble
2026-06-12 11:10 ` [PATCH 2/2] push: suggest <remote> <branch> for a slash slip Harald Nordgren via GitGitGadget
2026-06-22 20:40   ` Junio C Hamano
2026-06-22  8:41 ` [PATCH 0/2] branch/push: suggest intended form when remote/branch slip given Harald Nordgren
2026-06-22  8:59   ` Weijie Yuan
2026-06-22 21:16 ` Junio C Hamano
2026-06-23  7:35   ` Harald Nordgren
2026-06-24 21:55 ` [PATCH v2 " Harald Nordgren via GitGitGadget
2026-06-24 21:55   ` [PATCH v2 1/2] branch: suggest <remote>/<branch> on upstream slip Harald Nordgren via GitGitGadget
2026-06-24 22:33     ` Junio C Hamano
2026-06-24 21:55   ` [PATCH v2 2/2] push: suggest <remote> <branch> for a slash slip Harald Nordgren via GitGitGadget
2026-06-24 22:42     ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqa4sjh85o.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=haraldnordgren@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox