Re: [PATCH 2/3] Makefile: use `find` to determine static header dependencies

2014-08-26 Thread Jeff King
On Mon, Aug 25, 2014 at 03:08:50PM -0700, Junio C Hamano wrote:

 Jonathan Nieder jrnie...@gmail.com writes:
 
  Wouldn't it be sufficient to start digging not from * but from
  ??*?
 
  Gah, the * was supposed to be . in my examples (though it doesn't
  hurt).
 
 find ??* \( -name Documentation -o -name .\?\* \) -prune -o -name \*.h
 
  Heh.  Yeah, that would work. ;-)
 
 Continuing useless discussion...
 
 Actually as you are not excluding CVS, RCS, etc., and using ??* as
 the starting point will exclude .git, .hg, etc. at the top, I think
 we can shorten it even further and say
 
   find ??* -name Documentation -prune -o -name \*.h
 
 or something.

I had originally considered starting with find *, but I was worried
about shell globbing overflowing command-line limits here. echo * on a
built tree is about 12K. That's laughably small for Linux, but would
other systems (which, after all, are the main targets) be more picky?

POSIX lists 4K as the minimum, and that has to fit the environment, too.

I'd also be fine to try it and see if anybody on an antique system
complains.

 Don't we want to exclude contrib/ by the way?

Probably. For calculating dependencies, it is OK to be overly
conservative (the worst case is that we trigger a recompile if somebody
touched contrib/.../foo.h, which is rather unlikely).

For the .pot file, being conservative is a little annoying.  In theory
we might want to translate stuff in contrib/, but it probably is just
extra work for translators for not much benefit (though I have not
really used gettext; I assume it only pulls in strings marked with _()
and friends, so being conservative is maybe not that big a deal...).

In that sense, maybe we should just hit the whole tree to be on the
conservative side. The two reasons I did not in my initial attempt were:

  1. Performance. But with the final form, we only the run the `find` at
 all very rarely, so shaving off a few readdirs() is not that big a
 deal.

  2. There are a few problematic areas. t/perf may contain build trees
 which are copies of git, which I expect would confuse gettext.

So I dunno.

-Peff
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] Makefile: use `find` to determine static header dependencies

2014-08-26 Thread Junio C Hamano
Jeff King p...@peff.net writes:

 Actually as you are not excluding CVS, RCS, etc., and using ??* as
 the starting point will exclude .git, .hg, etc. at the top, I think
 we can shorten it even further and say
 
  find ??* -name Documentation -prune -o -name \*.h
 
 or something.

 I had originally considered starting with find *, but I was worried
 about shell globbing overflowing command-line limits here. echo * on a
 built tree is about 12K.

OK.  What I queued is still your original which is the most
conservative among various fun alternatives we have seen so far on
this thread, so we should be good ;-)

Thanks.
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] Makefile: use `find` to determine static header dependencies

2014-08-26 Thread Jeff King
On Tue, Aug 26, 2014 at 09:54:19AM -0700, Junio C Hamano wrote:

 Jeff King p...@peff.net writes:
 
  Actually as you are not excluding CVS, RCS, etc., and using ??* as
  the starting point will exclude .git, .hg, etc. at the top, I think
  we can shorten it even further and say
  
 find ??* -name Documentation -prune -o -name \*.h
  
  or something.
 
  I had originally considered starting with find *, but I was worried
  about shell globbing overflowing command-line limits here. echo * on a
  built tree is about 12K.
 
 OK.  What I queued is still your original which is the most
 conservative among various fun alternatives we have seen so far on
 this thread, so we should be good ;-)

The only thing I think mine does not do that Jonathan suggested is
dropping .hg, etc. I do not know why anyone would track git in hg, but
it might make sense to s/.git/.?/ in what I sent.

(I noticed also that you did not queue the third patch to drop
CHECK_HEADER_DEPENDENCIES; I'm OK if we keep it, but I wanted to make
sure it was not an oversight).

-Peff
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] Makefile: use `find` to determine static header dependencies

2014-08-26 Thread Junio C Hamano
Jeff King p...@peff.net writes:

 On Tue, Aug 26, 2014 at 09:54:19AM -0700, Junio C Hamano wrote:

 Jeff King p...@peff.net writes:
 
  Actually as you are not excluding CVS, RCS, etc., and using ??* as
  the starting point will exclude .git, .hg, etc. at the top, I think
  we can shorten it even further and say
  
find ??* -name Documentation -prune -o -name \*.h
  
  or something.
 
  I had originally considered starting with find *, but I was worried
  about shell globbing overflowing command-line limits here. echo * on a
  built tree is about 12K.
 
 OK.  What I queued is still your original which is the most
 conservative among various fun alternatives we have seen so far on
 this thread, so we should be good ;-)

 The only thing I think mine does not do that Jonathan suggested is
 dropping .hg, etc. I do not know why anyone would track git in hg, but
 it might make sense to s/.git/.?/ in what I sent.

 (I noticed also that you did not queue the third patch to drop
 CHECK_HEADER_DEPENDENCIES; I'm OK if we keep it, but I wanted to make
 sure it was not an oversight).

It started as I just ran out of time to really think about it and
transitioned to Ahh, I forgot that I postponed deciding ;-)

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] Makefile: use `find` to determine static header dependencies

2014-08-25 Thread Junio C Hamano
Jeff King p...@peff.net writes:

 Since we do not use the value $(LIB_H) unless either
 COMPUTE_HEADER_DEPENDENCIES is turned on or the user is
 building po/git.pot (where it comes in via $(LOCALIZED_C),
 make is smart enough to not even run this find in most
 cases. However, we do need to stop using the immediate
 variable assignment := for $(LOCALIZED_C). That's OK,
 because it was not otherwise useful here.

 Signed-off-by: Jeff King p...@peff.net
 ---
 I cannot see any reason for the :=, but maybe I am missing something.

If the right-hand-side were something like $(shell find ...) that
was heavy-weight then it might have made sense, but I do not think
it is that.  It has stayed to be := ever since it was introduced by
cd5513a7 (i18n: Makefile: pot target to extract messages marked
for translation, 2011-02-22).

And now you use LIB_H only once ;-).

Also interestingly, I notice that it is very clear that it is not
LIB_H but ANY_H ;-)


  Makefile | 140 
 ---
  1 file changed, 8 insertions(+), 132 deletions(-)

 diff --git a/Makefile b/Makefile
 index cf0ccdf..f2b85c9 100644
 --- a/Makefile
 +++ b/Makefile
 ...
 @@ -2128,9 +2004,9 @@ XGETTEXT_FLAGS_C = $(XGETTEXT_FLAGS) --language=C \
  XGETTEXT_FLAGS_SH = $(XGETTEXT_FLAGS) --language=Shell \
   --keyword=gettextln --keyword=eval_gettextln
  XGETTEXT_FLAGS_PERL = $(XGETTEXT_FLAGS) --keyword=__ --language=Perl
 -LOCALIZED_C := $(C_OBJ:o=c) $(LIB_H) $(GENERATED_H)
 -LOCALIZED_SH := $(SCRIPT_SH)
 -LOCALIZED_PERL := $(SCRIPT_PERL)
 +LOCALIZED_C = $(C_OBJ:o=c) $(GENERATED_H)
 +LOCALIZED_SH = $(SCRIPT_SH)
 +LOCALIZED_PERL = $(SCRIPT_PERL)
  
  ifdef XGETTEXT_INCLUDE_TESTS
  LOCALIZED_C += t/t0200/test.c
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] Makefile: use `find` to determine static header dependencies

2014-08-25 Thread Jeff King
On Mon, Aug 25, 2014 at 12:30:51PM -0700, Junio C Hamano wrote:

 Also interestingly, I notice that it is very clear that it is not
 LIB_H but ANY_H ;-)

Yeah, it has been that way for quite a while. I don't know if it is that
big a deal, but it would not be unreasonable to do a patch to rename on
top (I am not sure what the new one would be; ANY_H is probably OK).

-Peff
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] Makefile: use `find` to determine static header dependencies

2014-08-25 Thread Jonathan Nieder
Jeff King wrote:

 -LOCALIZED_C := $(C_OBJ:o=c) $(LIB_H) $(GENERATED_H)
 +LOCALIZED_C = $(C_OBJ:o=c) $(GENERATED_H)

Why is LIB_H dropped here?  This would mean that po/git.pot stops
including strings from macros and static inline functions in headers
(e.g., in parse-options.h).

The rest looks good.

Thanks,
Jonathan
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] Makefile: use `find` to determine static header dependencies

2014-08-25 Thread Jeff King
On Mon, Aug 25, 2014 at 12:46:41PM -0700, Jonathan Nieder wrote:

 Jeff King wrote:
 
  -LOCALIZED_C := $(C_OBJ:o=c) $(LIB_H) $(GENERATED_H)
  +LOCALIZED_C = $(C_OBJ:o=c) $(GENERATED_H)
 
 Why is LIB_H dropped here?  This would mean that po/git.pot stops
 including strings from macros and static inline functions in headers
 (e.g., in parse-options.h).

Ick, this is an accidental leftover from the earlier iteration of the
patch, which moved that part to a separate line (inside my gross
GIT_REAL_POT conditional). The extra line went away, but I forgot to add
$(LIB_H) back in here. Thanks for noticing.

Here's a revised version of the patch which fixes it (and I
double-checked to make sure it continues to not execute the find unless
you are doing a make pot).

-- 8 --
Subject: Makefile: use `find` to determine static header dependencies

Most modern platforms will use automatically computed header
dependencies to figure out when a C file needs rebuilt due
to a header changing. With old compilers, however, we
fallback to a static list of header files. If any of them
changes, we recompile everything. This is overly
conservative, but the best we can do on older platforms.

It is unfortunately easy for our static header list to grow
stale, as none of the regular developers make use of it.
Instead of trying to keep it up to date, let's invoke find
to generate the list dynamically.

Since we do not use the value $(LIB_H) unless either
COMPUTE_HEADER_DEPENDENCIES is turned on or the user is
building po/git.pot (where it comes in via $(LOCALIZED_C),
make is smart enough to not even run this find in most
cases. However, we do need to stop using the immediate
variable assignment := for $(LOCALIZED_C). That's OK,
because it was not otherwise useful here.

Signed-off-by: Jeff King p...@peff.net
---
 Makefile | 140 ---
 1 file changed, 8 insertions(+), 132 deletions(-)

diff --git a/Makefile b/Makefile
index cf0ccdf..a4fc440 100644
--- a/Makefile
+++ b/Makefile
@@ -432,7 +432,6 @@ XDIFF_OBJS =
 VCSSVN_OBJS =
 GENERATED_H =
 EXTRA_CPPFLAGS =
-LIB_H =
 LIB_OBJS =
 PROGRAM_OBJS =
 PROGRAMS =
@@ -631,131 +630,11 @@ VCSSVN_LIB = vcs-svn/lib.a
 
 GENERATED_H += common-cmds.h
 
-LIB_H += advice.h
-LIB_H += archive.h
-LIB_H += argv-array.h
-LIB_H += attr.h
-LIB_H += bisect.h
-LIB_H += blob.h
-LIB_H += branch.h
-LIB_H += builtin.h
-LIB_H += bulk-checkin.h
-LIB_H += bundle.h
-LIB_H += cache-tree.h
-LIB_H += cache.h
-LIB_H += color.h
-LIB_H += column.h
-LIB_H += commit.h
-LIB_H += compat/bswap.h
-LIB_H += compat/mingw.h
-LIB_H += compat/obstack.h
-LIB_H += compat/poll/poll.h
-LIB_H += compat/precompose_utf8.h
-LIB_H += compat/terminal.h
-LIB_H += compat/win32/dirent.h
-LIB_H += compat/win32/pthread.h
-LIB_H += compat/win32/syslog.h
-LIB_H += connected.h
-LIB_H += convert.h
-LIB_H += credential.h
-LIB_H += csum-file.h
-LIB_H += decorate.h
-LIB_H += delta.h
-LIB_H += diff.h
-LIB_H += diffcore.h
-LIB_H += dir.h
-LIB_H += exec_cmd.h
-LIB_H += ewah/ewok.h
-LIB_H += ewah/ewok_rlw.h
-LIB_H += fetch-pack.h
-LIB_H += fmt-merge-msg.h
-LIB_H += fsck.h
-LIB_H += gettext.h
-LIB_H += git-compat-util.h
-LIB_H += gpg-interface.h
-LIB_H += graph.h
-LIB_H += grep.h
-LIB_H += hashmap.h
-LIB_H += help.h
-LIB_H += http.h
-LIB_H += kwset.h
-LIB_H += levenshtein.h
-LIB_H += line-log.h
-LIB_H += line-range.h
-LIB_H += list-objects.h
-LIB_H += ll-merge.h
-LIB_H += log-tree.h
-LIB_H += mailmap.h
-LIB_H += merge-blobs.h
-LIB_H += merge-recursive.h
-LIB_H += mergesort.h
-LIB_H += notes-cache.h
-LIB_H += notes-merge.h
-LIB_H += notes-utils.h
-LIB_H += notes.h
-LIB_H += object.h
-LIB_H += pack-objects.h
-LIB_H += pack-revindex.h
-LIB_H += pack.h
-LIB_H += pack-bitmap.h
-LIB_H += parse-options.h
-LIB_H += patch-ids.h
-LIB_H += pathspec.h
-LIB_H += pkt-line.h
-LIB_H += prio-queue.h
-LIB_H += progress.h
-LIB_H += prompt.h
-LIB_H += quote.h
-LIB_H += reachable.h
-LIB_H += reflog-walk.h
-LIB_H += refs.h
-LIB_H += remote.h
-LIB_H += rerere.h
-LIB_H += resolve-undo.h
-LIB_H += revision.h
-LIB_H += run-command.h
-LIB_H += send-pack.h
-LIB_H += sequencer.h
-LIB_H += sha1-array.h
-LIB_H += sha1-lookup.h
-LIB_H += shortlog.h
-LIB_H += sideband.h
-LIB_H += sigchain.h
-LIB_H += strbuf.h
-LIB_H += streaming.h
-LIB_H += string-list.h
-LIB_H += submodule.h
-LIB_H += tag.h
-LIB_H += tar.h
-LIB_H += thread-utils.h
-LIB_H += transport.h
-LIB_H += tree-walk.h
-LIB_H += tree.h
-LIB_H += unpack-trees.h
-LIB_H += unicode_width.h
-LIB_H += url.h
-LIB_H += urlmatch.h
-LIB_H += userdiff.h
-LIB_H += utf8.h
-LIB_H += varint.h
-LIB_H += vcs-svn/fast_export.h
-LIB_H += vcs-svn/line_buffer.h
-LIB_H += vcs-svn/repo_tree.h
-LIB_H += vcs-svn/sliding_window.h
-LIB_H += vcs-svn/svndiff.h
-LIB_H += vcs-svn/svndump.h
-LIB_H += walker.h
-LIB_H += wildmatch.h
-LIB_H += wt-status.h
-LIB_H += xdiff-interface.h
-LIB_H += xdiff/xdiff.h
-LIB_H += xdiff/xdiffi.h
-LIB_H += xdiff/xemit.h
-LIB_H += xdiff/xinclude.h
-LIB_H += xdiff/xmacros.h
-LIB_H += 

Re: [PATCH 2/3] Makefile: use `find` to determine static header dependencies

2014-08-25 Thread Jeff King
On Mon, Aug 25, 2014 at 04:00:42PM -0400, Jeff King wrote:

 On Mon, Aug 25, 2014 at 12:46:41PM -0700, Jonathan Nieder wrote:
 
  Jeff King wrote:
  
   -LOCALIZED_C := $(C_OBJ:o=c) $(LIB_H) $(GENERATED_H)
   +LOCALIZED_C = $(C_OBJ:o=c) $(GENERATED_H)
  
  Why is LIB_H dropped here?  This would mean that po/git.pot stops
  including strings from macros and static inline functions in headers
  (e.g., in parse-options.h).
 
 Ick, this is an accidental leftover from the earlier iteration of the
 patch, which moved that part to a separate line (inside my gross
 GIT_REAL_POT conditional). The extra line went away, but I forgot to add
 $(LIB_H) back in here. Thanks for noticing.

As an aside, this makes an interesting case study for our git.git
workflow.

In some workflows, I would have made the original unacceptable patch,
you would have reviewed it, and then I would have made the followup
patch to adjust it, and you would have reviewed that. But it's quite
hard to see my mistake in just the followup patch; the fact that
$(LIB_H) was originally part of $(LOCALIZED_C) does not appear in that
hunk at all.

But in our workflow, we squash out the unacceptable diff, and you review
from scratch the movement from the original working state (assuming the
status quo was working :) ) to the newly proposed state. And there the
mistake is quite a bit more obvious.

Just an interesting observation.

-Peff
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] Makefile: use `find` to determine static header dependencies

2014-08-25 Thread Jonathan Nieder
Jeff King wrote:

 It is unfortunately easy for our static header list to grow
 stale, as none of the regular developers make use of it.
 Instead of trying to keep it up to date, let's invoke find
 to generate the list dynamically.

Yep, I like this.

It does mean that people who run make pot have to be a little more
vigilant about not keeping around extra .h files by mistake.  But I
trust them.

[...]
 +LIB_H = $(shell $(FIND) . \
 + -name .git -prune -o \
 + -name t -prune -o \
 + -name Documentation -prune -o \
 + -name '*.h' -print)

Tiny nit: I might use

$(shell $(FIND) * \
-name . -o
-name '.*' -prune -o \
-name t -prune -o \
-name Documentation -prune -o \
-name '*.h' -print)

or

$(shell $(FIND) * \
-name '.?*' -prune -o \
-name t -prune -o \
-name Documentation -prune -o \
-name '*.h' -print)

to avoid spending time looking in other dot-directories like .svn,
.hg, or .snapshot.

With or without such a change,
Reviewed-by: Jonathan Nieder jrnie...@gmail.com
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] Makefile: use `find` to determine static header dependencies

2014-08-25 Thread Junio C Hamano
Jonathan Nieder jrnie...@gmail.com writes:

 Jeff King wrote:

 It is unfortunately easy for our static header list to grow
 stale, as none of the regular developers make use of it.
 Instead of trying to keep it up to date, let's invoke find
 to generate the list dynamically.

 Yep, I like this.

 It does mean that people who run make pot have to be a little more
 vigilant about not keeping around extra .h files by mistake.  But I
 trust them.

 [...]
 +LIB_H = $(shell $(FIND) . \
 +-name .git -prune -o \
 +-name t -prune -o \
 +-name Documentation -prune -o \
 +-name '*.h' -print)

 Tiny nit: I might use

   $(shell $(FIND) * \
   -name . -o
   -name '.*' -prune -o \
   -name t -prune -o \
   -name Documentation -prune -o \
   -name '*.h' -print)

 or

   $(shell $(FIND) * \
   -name '.?*' -prune -o \
   -name t -prune -o \
   -name Documentation -prune -o \
   -name '*.h' -print)

 to avoid spending time looking in other dot-directories like .svn,
 .hg, or .snapshot.

Wouldn't it be sufficient to start digging not from * but from
??*?  That is, something like

find ??* \( -name Documentation -o -name .\?\* \) -prune -o -name \*.h

;-)

 With or without such a change,
 Reviewed-by: Jonathan Nieder jrnie...@gmail.com

Thanks.
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] Makefile: use `find` to determine static header dependencies

2014-08-25 Thread Jonathan Nieder
Junio C Hamano wrote:
 Jonathan Nieder jrnie...@gmail.com writes:

 Tiny nit: I might use

  $(shell $(FIND) * \
  -name . -o
  -name '.*' -prune -o \
  -name t -prune -o \
  -name Documentation -prune -o \
  -name '*.h' -print)

 or

  $(shell $(FIND) * \
  -name '.?*' -prune -o \
  -name t -prune -o \
  -name Documentation -prune -o \
  -name '*.h' -print)

 to avoid spending time looking in other dot-directories like .svn,
 .hg, or .snapshot.

 Wouldn't it be sufficient to start digging not from * but from
 ??*?

Gah, the * was supposed to be . in my examples (though it doesn't
hurt).

   find ??* \( -name Documentation -o -name .\?\* \) -prune -o -name \*.h

Heh.  Yeah, that would work. ;-)
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/3] Makefile: use `find` to determine static header dependencies

2014-08-25 Thread Junio C Hamano
Jonathan Nieder jrnie...@gmail.com writes:

 Wouldn't it be sufficient to start digging not from * but from
 ??*?

 Gah, the * was supposed to be . in my examples (though it doesn't
 hurt).

  find ??* \( -name Documentation -o -name .\?\* \) -prune -o -name \*.h

 Heh.  Yeah, that would work. ;-)

Continuing useless discussion...

Actually as you are not excluding CVS, RCS, etc., and using ??* as
the starting point will exclude .git, .hg, etc. at the top, I think
we can shorten it even further and say

find ??* -name Documentation -prune -o -name \*.h

or something.

...and time to go back to something more serious and practical.

Don't we want to exclude contrib/ by the way?
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/3] Makefile: use `find` to determine static header dependencies

2014-08-21 Thread Jeff King
Most modern platforms will use automatically computed header
dependencies to figure out when a C file needs rebuilt due
to a header changing. With old compilers, however, we
fallback to a static list of header files. If any of them
changes, we recompile everything. This is overly
conservative, but the best we can do on older platforms.

It is unfortunately easy for our static header list to grow
stale, as none of the regular developers make use of it.
Instead of trying to keep it up to date, let's invoke find
to generate the list dynamically.

Since we do not use the value $(LIB_H) unless either
COMPUTE_HEADER_DEPENDENCIES is turned on or the user is
building po/git.pot (where it comes in via $(LOCALIZED_C),
make is smart enough to not even run this find in most
cases. However, we do need to stop using the immediate
variable assignment := for $(LOCALIZED_C). That's OK,
because it was not otherwise useful here.

Signed-off-by: Jeff King p...@peff.net
---
I cannot see any reason for the :=, but maybe I am missing something.

 Makefile | 140 ---
 1 file changed, 8 insertions(+), 132 deletions(-)

diff --git a/Makefile b/Makefile
index cf0ccdf..f2b85c9 100644
--- a/Makefile
+++ b/Makefile
@@ -432,7 +432,6 @@ XDIFF_OBJS =
 VCSSVN_OBJS =
 GENERATED_H =
 EXTRA_CPPFLAGS =
-LIB_H =
 LIB_OBJS =
 PROGRAM_OBJS =
 PROGRAMS =
@@ -631,131 +630,11 @@ VCSSVN_LIB = vcs-svn/lib.a
 
 GENERATED_H += common-cmds.h
 
-LIB_H += advice.h
-LIB_H += archive.h
-LIB_H += argv-array.h
-LIB_H += attr.h
-LIB_H += bisect.h
-LIB_H += blob.h
-LIB_H += branch.h
-LIB_H += builtin.h
-LIB_H += bulk-checkin.h
-LIB_H += bundle.h
-LIB_H += cache-tree.h
-LIB_H += cache.h
-LIB_H += color.h
-LIB_H += column.h
-LIB_H += commit.h
-LIB_H += compat/bswap.h
-LIB_H += compat/mingw.h
-LIB_H += compat/obstack.h
-LIB_H += compat/poll/poll.h
-LIB_H += compat/precompose_utf8.h
-LIB_H += compat/terminal.h
-LIB_H += compat/win32/dirent.h
-LIB_H += compat/win32/pthread.h
-LIB_H += compat/win32/syslog.h
-LIB_H += connected.h
-LIB_H += convert.h
-LIB_H += credential.h
-LIB_H += csum-file.h
-LIB_H += decorate.h
-LIB_H += delta.h
-LIB_H += diff.h
-LIB_H += diffcore.h
-LIB_H += dir.h
-LIB_H += exec_cmd.h
-LIB_H += ewah/ewok.h
-LIB_H += ewah/ewok_rlw.h
-LIB_H += fetch-pack.h
-LIB_H += fmt-merge-msg.h
-LIB_H += fsck.h
-LIB_H += gettext.h
-LIB_H += git-compat-util.h
-LIB_H += gpg-interface.h
-LIB_H += graph.h
-LIB_H += grep.h
-LIB_H += hashmap.h
-LIB_H += help.h
-LIB_H += http.h
-LIB_H += kwset.h
-LIB_H += levenshtein.h
-LIB_H += line-log.h
-LIB_H += line-range.h
-LIB_H += list-objects.h
-LIB_H += ll-merge.h
-LIB_H += log-tree.h
-LIB_H += mailmap.h
-LIB_H += merge-blobs.h
-LIB_H += merge-recursive.h
-LIB_H += mergesort.h
-LIB_H += notes-cache.h
-LIB_H += notes-merge.h
-LIB_H += notes-utils.h
-LIB_H += notes.h
-LIB_H += object.h
-LIB_H += pack-objects.h
-LIB_H += pack-revindex.h
-LIB_H += pack.h
-LIB_H += pack-bitmap.h
-LIB_H += parse-options.h
-LIB_H += patch-ids.h
-LIB_H += pathspec.h
-LIB_H += pkt-line.h
-LIB_H += prio-queue.h
-LIB_H += progress.h
-LIB_H += prompt.h
-LIB_H += quote.h
-LIB_H += reachable.h
-LIB_H += reflog-walk.h
-LIB_H += refs.h
-LIB_H += remote.h
-LIB_H += rerere.h
-LIB_H += resolve-undo.h
-LIB_H += revision.h
-LIB_H += run-command.h
-LIB_H += send-pack.h
-LIB_H += sequencer.h
-LIB_H += sha1-array.h
-LIB_H += sha1-lookup.h
-LIB_H += shortlog.h
-LIB_H += sideband.h
-LIB_H += sigchain.h
-LIB_H += strbuf.h
-LIB_H += streaming.h
-LIB_H += string-list.h
-LIB_H += submodule.h
-LIB_H += tag.h
-LIB_H += tar.h
-LIB_H += thread-utils.h
-LIB_H += transport.h
-LIB_H += tree-walk.h
-LIB_H += tree.h
-LIB_H += unpack-trees.h
-LIB_H += unicode_width.h
-LIB_H += url.h
-LIB_H += urlmatch.h
-LIB_H += userdiff.h
-LIB_H += utf8.h
-LIB_H += varint.h
-LIB_H += vcs-svn/fast_export.h
-LIB_H += vcs-svn/line_buffer.h
-LIB_H += vcs-svn/repo_tree.h
-LIB_H += vcs-svn/sliding_window.h
-LIB_H += vcs-svn/svndiff.h
-LIB_H += vcs-svn/svndump.h
-LIB_H += walker.h
-LIB_H += wildmatch.h
-LIB_H += wt-status.h
-LIB_H += xdiff-interface.h
-LIB_H += xdiff/xdiff.h
-LIB_H += xdiff/xdiffi.h
-LIB_H += xdiff/xemit.h
-LIB_H += xdiff/xinclude.h
-LIB_H += xdiff/xmacros.h
-LIB_H += xdiff/xprepare.h
-LIB_H += xdiff/xtypes.h
-LIB_H += xdiff/xutils.h
+LIB_H = $(shell $(FIND) . \
+   -name .git -prune -o \
+   -name t -prune -o \
+   -name Documentation -prune -o \
+   -name '*.h' -print)
 
 LIB_OBJS += abspath.o
 LIB_OBJS += advice.o
@@ -1381,7 +1260,6 @@ ifdef NO_INET_PTON
 endif
 ifndef NO_UNIX_SOCKETS
LIB_OBJS += unix-socket.o
-   LIB_H += unix-socket.h
PROGRAM_OBJS += credential-cache.o
PROGRAM_OBJS += credential-cache--daemon.o
 endif
@@ -1405,12 +1283,10 @@ endif
 ifdef BLK_SHA1
SHA1_HEADER = block-sha1/sha1.h
LIB_OBJS += block-sha1/sha1.o
-   LIB_H += block-sha1/sha1.h
 else
 ifdef PPC_SHA1
SHA1_HEADER = ppc/sha1.h
LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o
-