Re: [PATCH v3] To make GIT-VERSION-FILE, search for git more widely

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

 



Matthias Andree <matthias.andree@xxxxxx> writes:

> The underlying problem flow is:
>
> 1 - Makefile has "include GIT-VERSION-FILE", thus gmake builds
>     GIT-VERSION-FILE early.
>
> 2 - GIT-VERSION-FILE depends on a .PHONY target (.FORCE-GIT-VERSION-FILE)
> 3 - Thus, GNU make *always* executes GIT-VERSION-GEN
> 4 - GIT-VERSION-GEN now, under the stripped $PATH, cannot find "git" and
>     sees a different version number.
> 5 - GIT-VERSION-GEN notes the difference in versions and regenerates
>     GIT-VERSION-FILE, with up-to-date timestamp.

Interesting.  I wonder if you need the change to the Makefile.

As long as GIT-VERSION-GEN notices that you have a freshly built git
available (test -x) and uses it, falling back to whatever on the PATH, it
would not have to touch GIT-VERSION-FILE, no?

IOW, instead of this:

> diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
> index 39cde78..d0dfef3 100755
> --- a/GIT-VERSION-GEN
> +++ b/GIT-VERSION-GEN
> @@ -2,6 +2,7 @@
>  
>  GVF=GIT-VERSION-FILE
>  DEF_VER=v1.6.3.GIT
> +test -x "$GIT" || GIT=git

wouldn't it make more sense to do

	if test -x "git"
        then
        	GIT=./git
	elif test -x "git.exe"
        then
        	GIT=./git.exe
	else
        	GIT=git
	fi

and use the rest of the patch to GIT-VERSION-GEN, without touching
Makefile at all?
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]