Re: [PATCH 06/18] version-gen: remove redundant check
- From
Todd Zullinger <tmz@pobox.com>
- Date
- Apr 14, 2023, 15:11 UTC
- Message-ID
- <ZDltLSTxBCWRoMjK@pobox.com>
- In-Reply-To
- <20230414121841.373980-7-felipe.contreras@gmail.com>
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.
If we drop this, aren't we breaking things for someone building a git tarball which is in a subdirectory of a git repository?
Show 18 quoted lines
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> ---
> GIT-VERSION-GEN | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
> index 34f561752b..cd94a7902e 100755
> --- a/GIT-VERSION-GEN
> +++ b/GIT-VERSION-GEN
> @@ -26,7 +26,7 @@ describe () {
> if test -f version
> then
> VN=$(cat version)
> -elif test -d "${GIT_DIR:-.git}" -o -f .git && describe
> +elif describe
> then
> VN=$(echo "$VN" | sed -e 's/-/./g')
> fi-- Todd