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

Re: [PATCH v2 resend] git.c: make autocorrected aliases work

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 6, 2009, 08:19 UTC
Message-ID
<7v7i58kfsy.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20090104172833.GA7139@myhost>
Alexander Potashev <aspotashev@gmail.com> writes:
Show 12 quoted lines
>> @@ -479,31 +501,22 @@ int main(int argc, const char **argv)
>> ...
>> +		was_alias = run_argv(&argc, &argv);
>> +		if (errno != ENOENT)
>>  			break;
>> +		if (was_alias) {
>>  			fprintf(stderr, "Expansion of alias '%s' failed; "
>>  				"'%s' is not a git-command\n",
>>  				cmd, argv[0]);
>>  			exit(1);
>
> Why not using 'die' here?

The code is in the context, and I do not think it is a good idea to conflate such a change to a patch that wants to add aliases auto correction.

While I do not think it matters too much in practice (unless existing scripts that runs git depends on the exact error status value), there are two differences: the message will say "fatal: " in front, and the command exits with 128 not with 1.

Previous: Alexander PotashevNext: Junio C Hamano
Message 5 of 6 in “git.c: make autocorrected aliases work”
  1. git.c: make autocorrected aliases workAdeodato Simó, Jan 4, 2009
  2. git.c: make autocorrected aliases workAdeodato Simó, Jan 4, 2009
  3. git.c: make autocorrected aliases workAdeodato Simó, Jan 4, 2009
  4. Alexander PotashevJan 4, 2009
  5. Junio C HamanoJan 6, 2009
  6. Junio C HamanoJan 6, 2009

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.