git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Patrick Steinhardt <ps@pks.im>, Jiang Xin <worldhello.net@gmail.com>
Cc: git@vger.kernel.org,  Ramsay Jones <ramsay@ramsayjones.plus.com>
Subject: Re: [PATCH] doc: format.notes specify a ref under refs/notes/ hierarchy
Date: Mon, 18 Dec 2023 08:16:00 -0800	[thread overview]
Message-ID: <xmqq1qbjij0f.fsf@gitster.g> (raw)
In-Reply-To: <ZX_9nRYKVq0jT0Lp@tanuki> (Patrick Steinhardt's message of "Mon, 18 Dec 2023 09:06:53 +0100")

Patrick Steinhardt <ps@pks.im> writes:

> On Fri, Dec 15, 2023 at 02:28:00PM -0800, Junio C Hamano wrote:
>> There is no 'ref/notes/' hierarchy.  '[format] notes = foo' uses notes
>> that are found in 'refs/notes/foo'.
>> 
>> Signed-off-by: Junio C Hamano <gitster@pobox.com>
>> ---
>>  * According to my eyeballing "git grep refs/ Documentation" result,
>>    this was the only remaining mention of "ref/" in Documentation/
>>    hierarchy that misspells "refs/".
>
> This made me look for additional instances where we were referring to
> "ref/". Turns out it's only a very limited set, see the below diff.

Yup, I did the same grep, but I tend to avoid churning what we
published long ago (and kept in Documentation/RelNotes/), my patches
only covered documents that are still relevant.

> the translation changes with a big grain of salt though,

Hopefully pinging Jiang would be sufficient to ask help from the
French, Chinese, and Taiwaneese translation teams.

> diff --git a/po/fr.po b/po/fr.po
> index ee2e610ef1..744550b056 100644
> --- a/po/fr.po
> +++ b/po/fr.po
> @@ -19773,7 +19773,7 @@ msgid ""
>  "Neither worked, so we gave up. You must fully qualify the ref."
>  msgstr ""
>  "La destination que vous avez fournie n'est pas un nom de référence complète\n"
> -"(c'est-à-dire commençant par \"ref/\"). Essai d'approximation par :\n"
> +"(c'est-à-dire commençant par \"refs/\"). Essai d'approximation par :\n"
>  "\n"
>  "- Recherche d'une référence qui correspond à '%s' sur le serveur distant.\n"
>  "- Vérification si la <source> en cours de poussée ('%s')\n"
> diff --git a/po/zh_CN.po b/po/zh_CN.po
> index 86402725b2..eb47e8f9b7 100644
> --- a/po/zh_CN.po
> +++ b/po/zh_CN.po
> @@ -13224,8 +13224,8 @@ msgid ""
>  msgid_plural ""
>  "Note: Some branches outside the refs/remotes/ hierarchy were not removed;\n"
>  "to delete them, use:"
> -msgstr[0] "注意:ref/remotes 层级之外的一个分支未被移除。要删除它,使用:"
> -msgstr[1] "注意:ref/remotes 层级之外的一些分支未被移除。要删除它们,使用:"
> +msgstr[0] "注意:refs/remotes 层级之外的一个分支未被移除。要删除它,使用:"
> +msgstr[1] "注意:refs/remotes 层级之外的一些分支未被移除。要删除它们,使用:"
>  
>  #: builtin/remote.c
>  #, c-format
> diff --git a/po/zh_TW.po b/po/zh_TW.po
> index f777a0596f..b2a79cdd93 100644
> --- a/po/zh_TW.po
> +++ b/po/zh_TW.po
> @@ -13109,7 +13109,7 @@ msgid ""
>  msgid_plural ""
>  "Note: Some branches outside the refs/remotes/ hierarchy were not removed;\n"
>  "to delete them, use:"
> -msgstr[0] "注意:ref/remotes 層級之外的一個分支未被移除。要刪除它,使用:"
> +msgstr[0] "注意:refs/remotes 層級之外的一個分支未被移除。要刪除它,使用:"
>  
>  #: builtin/remote.c
>  #, c-format

> Also, the test is
> interesting because it would fail even if we didn't pass an invalid atom
> to git-for-each-ref(1).

It is interesting but not surprising.  It is not an error to use ref
patterns that do not match any ref.  It is a mere pattern to filtering
what are in refs/ for the ones to be output.

> diff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh
> index 54e2281259..e68f7bec8e 100755
> --- a/t/t6300-for-each-ref.sh
> +++ b/t/t6300-for-each-ref.sh
> @@ -841,7 +841,7 @@ test_expect_success 'err on bad describe atom arg' '
>  		EOF
>  		test_must_fail git for-each-ref \
>  			--format="%(describe:tags,qux=1,abbrev=14)" \
> -			ref/heads/master 2>actual &&
> +			refs/heads/master 2>actual &&
>  		test_cmp expect actual
>  	)
>  '

The "for-each-ref" family's "--format" string is first parsed and
sanity-checked before it is applied.  The bogus ref pattern may not
yield any ref to apply the format string, but we do not optimize out
the parsing and checking, even though we could, as it would be
optimizing for a wrong case.  So regardless of the ref pattern at
the end of the command line does not make a difference to the
outcome of this test.

  reply	other threads:[~2023-12-18 16:16 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-15 20:32 [PATCH 0/5] make room for "special ref" Junio C Hamano
2023-12-15 20:32 ` [PATCH 1/5] git.txt: HEAD is not that special Junio C Hamano
2023-12-15 21:57   ` Ramsay Jones
2023-12-15 22:06     ` Junio C Hamano
2023-12-15 22:19       ` Junio C Hamano
2023-12-15 22:28         ` [PATCH] doc: format.notes specify a ref under refs/notes/ hierarchy Junio C Hamano
2023-12-18  8:06           ` Patrick Steinhardt
2023-12-18 16:16             ` Junio C Hamano [this message]
2023-12-19 15:33               ` Jiang Xin
2023-12-15 22:37         ` [PATCH 1/5] git.txt: HEAD is not that special Ramsay Jones
2023-12-18  8:46   ` Patrick Steinhardt
2023-12-18 16:26     ` Junio C Hamano
2023-12-15 20:32 ` [PATCH 2/5] git-bisect.txt: BISECT_HEAD " Junio C Hamano
2023-12-15 20:32 ` [PATCH 3/5] refs.h: HEAD " Junio C Hamano
2023-12-16 10:03   ` Andy Koppe
2023-12-15 20:32 ` [PATCH 4/5] docs: AUTO_MERGE " Junio C Hamano
2023-12-15 20:32 ` [PATCH 5/5] docs: MERGE_AUTOSTASH " Junio C Hamano
2023-12-16 11:04   ` Andy Koppe
2023-12-15 21:21 ` [PATCH 0/5] make room for "special ref" Junio C Hamano
2023-12-15 22:44   ` Ramsay Jones
2023-12-16  0:44     ` Junio C Hamano
2023-12-18  8:41       ` Patrick Steinhardt
2023-12-16 10:20     ` Andy Koppe
2023-12-18  8:24       ` Patrick Steinhardt
2023-12-16 10:56 ` Andy Koppe
2023-12-18  8:56 ` Patrick Steinhardt

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=xmqq1qbjij0f.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=ps@pks.im \
    --cc=ramsay@ramsayjones.plus.com \
    --cc=worldhello.net@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;
as well as URLs for NNTP newsgroup(s).