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

From: Felipe Contreras <[email-masked]>
Date: Fri, 14 Apr 2023 11:47:49 -0600

Todd Zullinger wrote:
> Felipe Contreras wrote:
> > If we are not in a git repository `git describe` will fail anyway.
> 
> The parent directory may be a git repository though.  The
> current code ensures that we're running `git describe` in
> the proper repository.

How exactly does it do that?

The current code expects the cwd to be the git repo, run it in any other
directory and it will generate GIT-VERSION-FILE in that directory, which is
clearly not intended.

> If we drop this, aren't we breaking things for someone
> building a git tarball which is in a subdirectory of a git
> repository?

How exactly would this hypothetical person build such a tarball?

  git init /tmp/foo
  mkdir -p /tmp/foo/bar
  cd /tmp/foo/bar
  make -C ~/dev/git dist

Works fine.

-- 
Felipe Contreras