Hello, Jim Meyering <j...@meyering.net> writes:
> Not sure about more "elegant", but here's a lower cost method: Thanks for the patch but I think the problem you have reported here: http://article.gmane.org/gmane.comp.lib.gnulib.bugs/21845 persists. Here an example, where /tmp/foo is a git repository. /tmp/foo$ mkdir bar && cd bar && git rev-parse --verify HEAD eed6a47d30bff7fd268411ae8a0d893c3827edc1 /tmp/foo/bar$ Instead, using the more expensive "git log", you are sure the directory is controlled by git: /tmp/foo$ (test -n "$(git log -z -n1 .)") > /dev/null 2>&1 && echo FOO FOO /tmp/foo$ mkdir bar && cd bar \ && (test -n "$(git log -z -n1 .)") > /dev/null 2>&1 && echo BAR /tmp/foo/bar$ Tested with git 1.7.1. Am I doing something wrong? > * build-aux/git-version-gen: Adjust this script so that it works > when run from any working directory beneath the top-level .git/- > containing directory. Inspired by a patch from Giusseppe Scrivano, > http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/21843/focus=21847 oops, typo in my name. Cheers, Giuseppe