git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Philippe Blain <levraiphilippeblain@gmail.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Philippe Blain via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Luke Shumaker <lukeshu@datawire.io>,
	Thomas Koutcher <thomas.koutcher@online.fr>,
	James Limbouris <james@digitalmatter.com>
Subject: Re: [PATCH 4/9] subtree: prefix die messages with 'fatal'
Date: Wed, 26 Oct 2022 17:24:59 -0400	[thread overview]
Message-ID: <3f8e9f2f-aa98-f152-46d3-21f69dc2d3bb@gmail.com> (raw)
In-Reply-To: <221021.86r0z1dtjq.gmgdl@evledraar.gmail.com>



Le 2022-10-21 à 12:30, Ævar Arnfjörð Bjarmason a écrit :
> 
> On Fri, Oct 21 2022, Philippe Blain via GitGitGadget wrote:
> 
>> From: Philippe Blain <levraiphilippeblain@gmail.com>
>>
>> Just as was done in 0008d12284 (submodule: prefix die messages with
>> 'fatal', 2021-07-10) for 'git-submodule.sh', make the 'die' messages
>> outputed by 'git-subtree.sh' more in line with the rest of the code base
>> by prefixing them with "fatal: ", and do not capitalize their first
>> letter.
> 
> I don't really care since we're unlikely to ever give git-subtree the
> i18n treatment, so translators don't need to worry about the churn.
> 
> But given how few in-tree-users we have of "die" and "git-sh-setup" this
> would be much shorter & future-proof as just e.g. (untested):
> 	
> 	diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
> 	index 7562a395c24..0d8f87c5a20 100755
> 	--- a/contrib/subtree/git-subtree.sh
> 	+++ b/contrib/subtree/git-subtree.sh
> 	@@ -25,6 +25,8 @@ then
> 	 	exit 126
> 	 fi
> 	 
> 	+GIT_SH_SETUP_DIE_PREFIX='fatal: '
> 	+
> 	 OPTS_SPEC="\
> 	 git subtree add   --prefix=<prefix> <commit>
> 	 git subtree add   --prefix=<prefix> <repository> <ref>
> 	diff --git a/git-sh-setup.sh b/git-sh-setup.sh
> 	index ce273fe0e48..81456d7266e 100644
> 	--- a/git-sh-setup.sh
> 	+++ b/git-sh-setup.sh
> 	@@ -53,7 +53,7 @@ die () {
> 	 die_with_status () {
> 	 	status=$1
> 	 	shift
> 	-	printf >&2 '%s\n' "$*"
> 	+	printf >&2 '%s%s\n' "$GIT_SH_SETUP_DIE_PREFIX" "$*"
> 	 	exit "$status"
> 	 }
> 	 
>> -		die "assertion failed: $*"
>> +		die "fatal: assertion failed: $*"
> 
> Then you could just leave this, but...
> 
>> -		die "Unknown command '$arg_command'"
>> +		die "fatal: unknown command '$arg_command'"
> 
> ...would still need to change these for the capitalization change.
>

Yeah, I guess to this could be done in a later refactor if someone wishes.

It would probably require changes to other tests scripts (since there are other users
of 'die'), though, and so would widen the scope of the series a bit too much, I would say. 

  reply	other threads:[~2022-10-26 21:25 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-21 15:13 [PATCH 0/9] subtree: fix split and merge after annotated tag was squash-merged Philippe Blain via GitGitGadget
2022-10-21 15:13 ` [PATCH 1/9] test-lib-functions: mark 'test_commit' variables as 'local' Philippe Blain via GitGitGadget
2022-10-21 21:06   ` Junio C Hamano
2022-10-26 21:21     ` Philippe Blain
2022-10-26 21:38       ` Junio C Hamano
2022-10-21 15:13 ` [PATCH 2/9] subtree: use 'git rev-parse --verify [--quiet]' for better error messages Philippe Blain via GitGitGadget
2022-10-21 15:13 ` [PATCH 3/9] subtree: add 'die_incompatible_opt' function to reduce duplication Philippe Blain via GitGitGadget
2022-10-21 16:22   ` Ævar Arnfjörð Bjarmason
2022-10-26 21:23     ` Philippe Blain
2022-10-21 15:13 ` [PATCH 4/9] subtree: prefix die messages with 'fatal' Philippe Blain via GitGitGadget
2022-10-21 16:30   ` Ævar Arnfjörð Bjarmason
2022-10-26 21:24     ` Philippe Blain [this message]
2022-10-21 15:13 ` [PATCH 5/9] subtree: define a variable before its first use in 'find_latest_squash' Philippe Blain via GitGitGadget
2022-10-21 15:13 ` [PATCH 6/9] subtree: use named variables instead of "$@" in cmd_pull Philippe Blain via GitGitGadget
2022-10-21 15:13 ` [PATCH 7/9] subtree: process 'git-subtree-split' trailer in separate function Philippe Blain via GitGitGadget
2022-10-21 15:13 ` [PATCH 8/9] subtree: fix squash merging after annotated tag was squashed merged Philippe Blain via GitGitGadget
2022-10-21 15:13 ` [PATCH 9/9] subtree: fix split " Philippe Blain via GitGitGadget
2022-10-21 16:37   ` Ævar Arnfjörð Bjarmason
2022-10-21 18:24     ` Eric Sunshine
2022-10-26 21:26     ` Philippe Blain

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=3f8e9f2f-aa98-f152-46d3-21f69dc2d3bb@gmail.com \
    --to=levraiphilippeblain@gmail.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=james@digitalmatter.com \
    --cc=lukeshu@datawire.io \
    --cc=thomas.koutcher@online.fr \
    /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).