bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] git-version-gen: include command name in one more diagnostic


From: Bruce Korb
Subject: Re: [PATCH] git-version-gen: include command name in one more diagnostic
Date: Mon, 03 Jan 2011 09:36:57 -0800
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20101125 SUSE/3.0.11 Thunderbird/3.0.11

Hi Jim,

On 01/03/11 07:17, Jim Meyering wrote:
> I now see that your patch ... combined stderr with the potentially
> mangled output from a failing "cat" command,...
> 
> Also, while it's not likely that the file is missing at that point,
> it is possible, since there is a race condition.

And if the file contains trash exclusive of 0x0A and starts with
0x30 through 0x39 then you'll get hosed, too.  You have to make
a trade off between programming complexity and usefulness.
If "cat" has a read error, the most likely output will be only
to stderr and you won't have junk.  "cat" would have to use
multiple reads before it would emit junk data before printing
an error message.  It would not make particular sense to read
line-at-a-time.

This whole series of emails came about because some GIT command
emitted a fatal error message to stderr, git-version-gen ignored
the "fatal" error and I was left wondering what happened.
Perhaps the real "best" solution would be to divert all stderr
to a temp file.  It would be printed out on real failure and
otherwise simply removed.

I'll supply that patch, if you like.
Is it okay to use the post-1977 concept of a shell function?
Even the Solaris /bin/sh supports it .....

Cheers  - Bruce



reply via email to

[Prev in Thread] Current Thread [Next in Thread]