[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Do not limit git-version-gen to work only under the reposito
From: |
Giuseppe Scrivano |
Subject: |
Re: [PATCH] Do not limit git-version-gen to work only under the repository root. |
Date: |
Wed, 13 Oct 2010 17:52:42 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
Hello,
Jim Meyering <address@hidden> 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