Re: [PATCH 2/2] version --build-options: report commit, too, if possible
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Dec 14, 2017, 23:27 UTC
- Message-ID
- <alpine.DEB.2.21.1.1712150027360.406@MININT-6BKU6QN.europe.corp.microsoft.com>
- In-Reply-To
- <xmqqy3md85zh.fsf@gitster.mtv.corp.google.com>
Hi Junio,
On Fri, 8 Dec 2017, Junio C Hamano wrote:
Show 26 quoted lines
> Jonathan Nieder <jrnieder@gmail.com> writes: > > >> We need to be careful, though, to report when the current commit cannot be > >> determined, e.g. when building from a tarball without any associated Git > >> repository. > > > > This means that on Debian, it would always print > > > > built from commit: (unknown) > > > > Maybe I shouldn't care, but I wonder if there's a way to improve on > > that. E.g. should there be a makefile knob to allow Debian to specify > > what to put there? > > Another "interesting" possibility is to build from a tarball > extracted into a directory hierarchy that is controlled by an > unrelated Git repository. E.g. "my $HOME is under $HOME/.git > repository, and then I have a tarball extract in $HOME/src/git". > We shouldn't embed the HEAD commit of that $HOME directory project > in the resulting executable in such a case. > > We should be able to do this by being a bit more careful than the > presented patch. Make sure that the toplevel is at the same > directory as we assumed to be (i.e. where we found that Makefile) > and trust rev-parse output only when that is the case, or something > like that.
Cute.
I added specific handling for that.
Ciao, Dscho