Possible kinder GIT-VERSION-GEN?

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

 



I have my home directory under git control, and I have a build
directory (not tracked by git) under my home directory into which I
untar files and then in which I build things, including git.

When doing this, the version reported always contains the '-dirty'
suffix, which I find annoying (and potentially misleading).  I traced
this to the GIT-VERSION-GEN script, and I "fixed" it by checking
if there is a '.git' directory present before invoking git diff-index,
something like this:

dirty=$(sh -c 'test -f .git && git diff-index --name-only HEAD' 2>/dev/null) || dirty=
case "$dirty" in
'')
        ;;
*)
        VN="$VN dirty" ;;
esac

If someone of authority here thinks this seems reasonable (or has a
better way), I will test this (along with any suggested improvements)
with the git repo itself (to ensure it puts '-dirty' when it really
should), and submit a patch.


Bill
-
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]

  Powered by Linux