bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCH] Really update the git index to avoid false -dirty versions


From: Jim Meyering
Subject: Re: [PATCH] Really update the git index to avoid false -dirty versions
Date: Mon, 12 Apr 2010 19:38:07 +0200

Andreas Gruenbacher wrote:

> On Monday 12 April 2010 18:25:01 Jim Meyering wrote:
>> Can you describe a scenario in which
>> using "git update-index --refresh" makes
>> git-version-gen work better than with "git status"?
>> In the example I tried (touch an unmodified, vc'd file),
>> they appear to have the same net effect.
>
> I can't pinpoint it.  In some versions or configurations of git, git status
> seems to be enough, but I get the following here with git 1.7.0.2.273.gc2413:
>
>       $ git diff-index --name-only HEAD
>       $ touch README
>       $ git diff-index --name-only HEAD
>       README
>       $ git status > /dev/null
>       $ git diff-index --name-only HEAD
>       README
>       $ git update-index --refresh
>       $ git diff-index --name-only HEAD

Yes, that's exactly what I tried.
Only for me (with git's "next"), they work as well.

  $ git diff-index --name-only HEAD
  $ touch README
  $ git diff-index --name-only HEAD
  README
  $ git status > /dev/null
  $ git diff-index --name-only HEAD
  $ git --version
  git version 1.7.1.rc1.237.ge1730

> Another unrelated issue with how git-version-gen is used in packages like
> diffutils (and now, patch) is that version string changes do not trigger
> autoconf: when you build, change something, optionally commit stuff, and then
> rebuild, the string that git-version-gen reports will differ from the version
> string used during the build.  This is really quite bad.

You may want to add the "gnumakefile" module to patch's bootstrap.conf.
That pulls in framework to manage version numbers.

Not updating version information is deliberate, because running autoreconf
can cause recompilation of everything.  When you *do* want to regenerate
an up to date version string, "make _version" will do that.
(as will "make dist", etc.)

Here's a comment from GNUmakefile:

  # Ensure that $(VERSION) is up to date for dist-related targets, but not
  # for others: rerunning autoreconf and recompiling everything isn't cheap.




reply via email to

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