git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Bagas Sanjaya <bagasdotme@gmail.com>, git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>, Ryan Anderson <ryan@michonline.com>
Subject: Re: [PATCH 1/2] request-pull: simplify "remote or HEAD" variable in warning messages
Date: Thu, 16 Sep 2021 15:09:41 +0200	[thread overview]
Message-ID: <02a3f76e-cb59-e4c7-21f2-3772be3cad09@redhat.com> (raw)
In-Reply-To: <20210916113516.76445-2-bagasdotme@gmail.com>

On 16/09/21 13:35, Bagas Sanjaya wrote:
> In order for waring message "Are you sure you pushed 'remote or HEAD'
                ^^^^^^

warning

Otherwise,

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

> there?" to be translatable, replace ${remote:-HEAD} (variable access
> with defaults) in the message by referring it as $remote_or_head.
> 
> Cc: Ryan Anderson <ryan@michonline.com>
> Cc: pbonzini@redhat.com
> Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
> ---
>   git-request-pull.sh | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/git-request-pull.sh b/git-request-pull.sh
> index 2d0e44656c..9e1d2be9eb 100755
> --- a/git-request-pull.sh
> +++ b/git-request-pull.sh
> @@ -116,15 +116,17 @@ set fnord $(git ls-remote "$url" | @@PERL@@ -e "$find_matching_ref" "${remote:-H
>   remote_sha1=$2
>   ref=$3
>   
> +remote_or_head=${remote:-HEAD}
> +
>   if test -z "$ref"
>   then
>   	echo "warn: No match for commit $headrev found at $url" >&2
> -	echo "warn: Are you sure you pushed '${remote:-HEAD}' there?" >&2
> +	echo "warn: Are you sure you pushed '$remote_or_head' there?" >&2
>   	status=1
>   elif test "$local_sha1" != "$remote_sha1"
>   then
>   	echo "warn: $head found at $url but points to a different object" >&2
> -	echo "warn: Are you sure you pushed '${remote:-HEAD}' there?" >&2
> +	echo "warn: Are you sure you pushed '$remote_or_head' there?" >&2
>   	status=1
>   fi
>   
> 


  reply	other threads:[~2021-09-16 13:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-16 11:35 [PATCH 0/2] git-request-pull i18n Bagas Sanjaya
2021-09-16 11:35 ` [PATCH 1/2] request-pull: simplify "remote or HEAD" variable in warning messages Bagas Sanjaya
2021-09-16 13:09   ` Paolo Bonzini [this message]
2021-09-16 11:35 ` [PATCH 2/2] request-pull: mark translatable strings Bagas Sanjaya
2021-09-16 12:15   ` Ævar Arnfjörð Bjarmason
2021-09-16 13:44   ` Đoàn Trần Công Danh
2021-09-16 20:30     ` Junio C Hamano
2021-09-17  7:41       ` Bagas Sanjaya
2021-09-17 16:37         ` Junio C Hamano
2021-09-17 20:50       ` Miklos Vajna

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=02a3f76e-cb59-e4c7-21f2-3772be3cad09@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=bagasdotme@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=ryan@michonline.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).