Re: [PATCH] Make GIT-VERSION-GEN tolerate missing git describe command
- From
Linus Torvalds <torvalds@osdl.org>
- Date
- Dec 30, 2005, 18:49 UTC
- Message-ID
- <Pine.LNX.4.64.0512301046230.3249@g5.osdl.org>
- In-Reply-To
- <dp3mtp$rfm$1@sea.gmane.org>
On Fri, 30 Dec 2005, John Ellson wrote:
Show 13 quoted lines
> > I think it is probably a bug that "git non_existent_command" > returns its error message to stdout without an error, where > "git-non_existent_command" behaves differently and does return an > error. > > Older versions of git did not implement "git describe" and > GIT-VERSION-GEN produces an empty version string if run on > a system with such a git installed. The consequence > is that "make rpm" fails. > > This patch fixes GIT-VERSION-GEN so that it works in the > absence of a working "git describe"
Shouldn't you make "git.c" return an error too, so that "git-describe" and "git describe" both fail properly?
I realize that you'd want to do your patch _too_ (in case somebody has an old version of "git" installed), but I just think it would be sensible to fix the problem that causes this in the first place..
Continuing to output to stdout rather than stderr is probably a good idea (so that it's easy to do "git help | less" or something), but yeah, I think an unrecognized command should at least return an error.
Linus