Subject: Re: [PATCH 06/18] version-gen: remove redundant check

From: Todd Zullinger <[email-masked]>
Date: Fri, 14 Apr 2023 15:41:55 -0400

Felipe Contreras wrote:
> Todd Zullinger wrote:
>> If I have a git repo, say ~/fedora/git which contains the
>> fedora packaging (spec file, etc.) and extract a git archive
>> in this directory, the describe will now pick up the data
>> from the parent git directory, won't it?
>> 
>>     $ git -C ~/fedora clone https://src.fedoraproject.org/rpms/git.git
>>     $ cd ~/fedora/git
>>     $ git -C ~/upstream/git archive --format=tar --prefix=git/ HEAD | tar xf -
>>     $ cd git
>>     $ make GIT-VERSION-GEN
>>     $ cat GIT-VERSION-FILE 
>>     GIT_VERSION = 
> 
> I don't think this is a realistic use-case, but supposing it is, what would be
> the desired outcome in this case?
> 
>  GIT_VERSION = 2.40.GIT
> 
> ?

That's what we get before this change.  I don't have an
opinion on whether that could/should change, but if it does,
it should be deliberate I think.

>> The version file in the tarballs prevents this from
>> happening in the most common case, but it still feels like
>> this is loosening things a little more than it should.
> 
> If we care about this, the same behavior can be achieved with GIT_CEILING_DIRECTORIES:
> 
>  GIT_CEILING_DIRECTORIES=$(cd .. && pwd) git describe ...

I only mention it because it seemed like a change in
behavior when the series aimed to not change any behavior.
I'm sure there are plenty of things which could be changed
while making imrpveoments here.  I think we'll be better off
if those changes are all noted and deliberate.

Thanks for working on this stuff, it is good to see
improvements to this sort of plumbing.

-- 
Todd