All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bagas Sanjaya <bagasdotme@gmail.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>,
	Bagas Sanjaya <bagasdotme@gmail.com>,
	Ryan Anderson <ryan@michonline.com>,
	pbonzini@redhat.com
Subject: [PATCH 1/2] request-pull: simplify "remote or HEAD" variable in warning messages
Date: Thu, 16 Sep 2021 18:35:16 +0700	[thread overview]
Message-ID: <20210916113516.76445-2-bagasdotme@gmail.com> (raw)
In-Reply-To: <20210916113516.76445-1-bagasdotme@gmail.com>

In order for waring message "Are you sure you pushed 'remote or HEAD'
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
 
-- 
2.25.1


  reply	other threads:[~2021-09-16 11:36 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 ` Bagas Sanjaya [this message]
2021-09-16 13:09   ` [PATCH 1/2] request-pull: simplify "remote or HEAD" variable in warning messages Paolo Bonzini
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

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

  git send-email \
    --in-reply-to=20210916113516.76445-2-bagasdotme@gmail.com \
    --to=bagasdotme@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pbonzini@redhat.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.