git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/8] mv: no "Huh?" to the user

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 8, 2014, 17:48 UTC
Message-ID
<xmqqfvh6kh2t.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1407503462-32632-3-git-send-email-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:
Show 8 quoted lines
> 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.

Show 28 quoted lines
> 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++) {
Previous: Nguyễn Thái Ngọc DuyNext: Nguyễn Thái Ngọc Duy
Message 4 of 11 in “builtin/mv.c cleanup”
  1. 0/8 builtin/mv.c cleanupNguyễn Thái Ngọc Duy, Aug 8, 2014
  2. 1/8 mv: mark strings for translationsNguyễn Thái Ngọc Duy, Aug 8, 2014
  3. 2/8 mv: no "Huh?" to the userNguyễn Thái Ngọc Duy, Aug 8, 2014
  4. Junio C HamanoAug 8, 2014
  5. 3/8 mv: flatten error handling code blockNguyễn Thái Ngọc Duy, Aug 8, 2014
  6. Junio C HamanoAug 8, 2014
  7. 4/8 mv: split submodule move preparation code outNguyễn Thái Ngọc Duy, Aug 8, 2014
  8. 5/8 mv: remove an "if" that's always trueNguyễn Thái Ngọc Duy, Aug 8, 2014
  9. 6/8 mv: move index search code outNguyễn Thái Ngọc Duy, Aug 8, 2014
  10. 7/8 mv: unindent one level for directory move codeNguyễn Thái Ngọc Duy, Aug 8, 2014
  11. 8/8 mv: combine two if(s)Nguyễn Thái Ngọc Duy, Aug 8, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.