bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] git-version-gen: Support git-archive tarballs.


From: Jim Meyering
Subject: Re: [PATCH] git-version-gen: Support git-archive tarballs.
Date: Sat, 28 Dec 2024 09:42:30 -0800

On Fri, Dec 27, 2024 at 3:35 AM Simon Josefsson <simon@josefsson.org> wrote:
> Hi Jim, all,

Hi Simon,

> If I run git-version-gen in a snapshot of a git repository it will
> return UNKNOWN because it cannot find out the version.
>
> Git has a .gitattribute mechanism to mark some files as 'export-subst'
> which makes git-archive substitute some strings in the file, when it is
> exporting a snapshot.
>
> Instead of giving UNKNOWN in this situation, I think it would be nice if
> git-version-gen handled this case, when the maintainer has opted in on
> this scheme.
>
> The code addition is small, after all current logic I'm adding this:
>
> if test "x$v" = xUNKNOWN \
>         && test -f ${tarball_version_file}-git \
>         && head -1 ${tarball_version_file}-git \
>             | grep -v '^$Format' > /dev/null 2>&1; then
>     v=$(head -1 ${tarball_version_file}-git)
> fi

That code uses "grep -v" where the intent must have been to use just "grep".
I've fixed that and cleaned up via this just-pushed change:

Attachment: git-version-gen-git.diff
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]