public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: "Nguyễn Thái Ngọc Duy" <pclouds@gmail•com>
Cc: git@vger•kernel.org
Subject: Re: [PATCH 2/8] mv: no "Huh?" to the user
Date: Fri, 08 Aug 2014 10:48:58 -0700	[thread overview]
Message-ID: <xmqqfvh6kh2t.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1407503462-32632-3-git-send-email-pclouds@gmail.com> ("Nguyễn	Thái Ngọc Duy"'s message of "Fri, 8 Aug 2014 20:10:56 +0700")

Nguyễn Thái Ngọc Duy  <pclouds@gmail•com> writes:

> Although if we are frisky, this could do
>
>    static NORETURN void die_builtin(const char *err, va_list params)
>    {
>   -	vreportf("fatal: ", err, params);
>   +	vreportf("Huh? ", err, params);
>    	exit(128);
>    }

;-)

While at it we may want to remove the extra SP between dies and
their opening parentheses.

> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail•com>
> ---
>  builtin/mv.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/builtin/mv.c b/builtin/mv.c
> index b892f63..a7e02c0 100644
> --- a/builtin/mv.c
> +++ b/builtin/mv.c
> @@ -135,7 +135,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
>  			if (first >= 0) {
>  				struct strbuf submodule_dotgit = STRBUF_INIT;
>  				if (!S_ISGITLINK(active_cache[first]->ce_mode))
> -					die (_("Huh? Directory %s is in index and no submodule?"), src);
> +					die (_("Directory %s is in index and no submodule?"), src);
>  				if (!is_staging_gitmodules_ok())
>  					die (_("Please, stage your changes to .gitmodules or stash them to proceed"));
>  				strbuf_addf(&submodule_dotgit, "%s/.git", src);
> @@ -153,8 +153,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
>  
>  				first = cache_name_pos(src_w_slash, len_w_slash);
>  				if (first >= 0)
> -					die (_("Huh? %.*s is in index?"),
> -							len_w_slash, src_w_slash);
> +					die (_("%.*s is in index"), len_w_slash, src_w_slash);
>  
>  				first = -1 - first;
>  				for (last = first; last < active_nr; last++) {

  reply	other threads:[~2014-08-08 17:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-08 13:10 [PATCH 0/8] builtin/mv.c cleanup Nguyễn Thái Ngọc Duy
2014-08-08 13:10 ` [PATCH 1/8] mv: mark strings for translations Nguyễn Thái Ngọc Duy
2014-08-08 13:10 ` [PATCH 2/8] mv: no "Huh?" to the user Nguyễn Thái Ngọc Duy
2014-08-08 17:48   ` Junio C Hamano [this message]
2014-08-08 13:10 ` [PATCH 3/8] mv: flatten error handling code block Nguyễn Thái Ngọc Duy
2014-08-08 17:54   ` Junio C Hamano
2014-08-08 13:10 ` [PATCH 4/8] mv: split submodule move preparation code out Nguyễn Thái Ngọc Duy
2014-08-08 13:10 ` [PATCH 5/8] mv: remove an "if" that's always true Nguyễn Thái Ngọc Duy
2014-08-08 13:11 ` [PATCH 6/8] mv: move index search code out Nguyễn Thái Ngọc Duy
2014-08-08 13:11 ` [PATCH 7/8] mv: unindent one level for directory move code Nguyễn Thái Ngọc Duy
2014-08-08 13:11 ` [PATCH 8/8] mv: combine two if(s) Nguyễn Thái Ngọc Duy

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=xmqqfvh6kh2t.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=pclouds@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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