public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Andreas Ericsson <ae@op5•se>
To: Johannes Schindelin <Johannes.Schindelin@gmx•de>
Cc: Junio C Hamano <junkio@cox•net>, git@vger•kernel.org
Subject: Re: [PATCH] git.c: Re-introduce sane error messages on missing commands.
Date: Wed, 28 Jun 2006 13:53:26 +0200	[thread overview]
Message-ID: <44A26DB6.1080408@op5.se> (raw)
In-Reply-To: <Pine.LNX.4.63.0606281240480.29667@wbgn013.biozentrum.uni-wuerzburg.de>

Johannes Schindelin wrote:
> Hi,
> 
> On Wed, 28 Jun 2006, Junio C Hamano wrote:
> 
> 
>>Johannes Schindelin <Johannes.Schindelin@gmx•de> writes:
>>
>>
>>>Try this:
>>>
>>>$ mkdir 5
>>>$ cd 5
>>>$ git-init-db
>>>$ rm .git/config # yes, really.
>>>$ git abc
>>
>>Thanks for trying to help, but not really.
> 
> 
> Okay. Does not happen with 'next' here, too. I have some changes in my 
> private repo (which eventually should culminate in the big mmap()ed sooper 
> config parsing / writing thingie), which make it break. The following 
> patch fixes this (and potentially Andreas' problem, too).
> 

It should, although the command it tried to execute will still be empty 
if it fails for some other reason (file not executable / permission 
denied), since it only does the right thing on ENOENT.

This is also, imo, a bit worse than preserving the errno from the 
execve() call in the caller, since errno is sometimes a macro (yes, only 
in threaded apps atm, but still...), and it will be easy to forget to 
look in handle_alias() if other things change in main() that makes this 
bug resurface.

Oh, and the part of my patch removing the git_command variable from 
git.c:main() still has to be applied for arbitrary error-messages to 
look sane.

$ grep -B1 git_command git.c
         char *slash = strrchr(cmd, '/');
         char git_command[PATH_MAX + 1];
--
         fprintf(stderr, "Failed to run command '%s': %s\n",
                 git_command, strerror(errno));


Btw, Junio, did you try this with 'master' as of yesterday morning (git 
version 1.4.1.rc1.g1ef9)? It's reproducible on every machine I've tried 
so far (well, only five, but still), so it seems odd that you don't see it.

-- 
Andreas Ericsson                   andreas.ericsson@op5•se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

  reply	other threads:[~2006-06-28 11:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-27  8:28 [PATCH] git.c: Re-introduce sane error messages on missing commands Andreas Ericsson
2006-06-27 22:57 ` Junio C Hamano
2006-06-28  8:13   ` Andreas Ericsson
2006-06-28  9:21     ` Johannes Schindelin
2006-06-28  9:53       ` Junio C Hamano
2006-06-28 10:45         ` Johannes Schindelin
2006-06-28 11:53           ` Andreas Ericsson [this message]
2006-06-28 12:00           ` Marco Roeland
2006-06-28 14:59             ` Christopher Faylor

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=44A26DB6.1080408@op5.se \
    --to=ae@op5$(echo .)se \
    --cc=Johannes.Schindelin@gmx$(echo .)de \
    --cc=git@vger$(echo .)kernel.org \
    --cc=junkio@cox$(echo .)net \
    /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