Jonathan Nieder [off-list ref] writes:
Junio C Hamano wrote:
quoted
Perhaps something like this is in order?
[...]
quoted
+++ b/Makefile
@@ -2127,17 +2127,25 @@ po/git.pot: $(LOCALIZED_C)
pot: po/git.pot
+git_check = $(shell git ls-files >/dev/null 2>&1; echo $$?)
+ifeq ($(git_check),0)
+FIND_SOURCE_FILES = git ls-files '*.[hcS]'
+else
+FIND_SOURCE_FILES = $(FIND) . \( -name .git -type d -prune \) \
+ -o \( -name '*.[hcS]' -type f -print \)
+endif
Neat. I'd prefer something like
FIND_SOURCE_FILES = \
git ls-files '*.[hcS]' 2>/dev/null || \
$(FIND) . -name .git -prune -o -name '*.[hcS]' -type f -print
that avoid punishing people who were using the makefile for some
purpose unrelated to tags and cscope, though. ;)
Hmm, how would this punish anybody exactly (I just took the structure
from the way how the auto-depend is done)?
Besides, you would need to have the whole thing in a subshell or
something, as this is used as the upstream to "| xargs".