On Monday 12 April 2010 19:38:07 Jim Meyering wrote: > 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
I see ... given that "git update-index" is documented to do exactly what git- version-gen want to do while "git status" does that only as a side effect, and apparently only sometimes, would it make sense to switch to "git update- index"? > 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. Thanks, that could be acceptable. Andreas