git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
	Nicolas Pitre <nico@fluxnic.net>
Subject: [PATCH 3/3] Move header files into a include/ subdirectory
Date: Thu, 17 Feb 2011 20:37:50 -0600	[thread overview]
Message-ID: <20110218023750.GD23435@elie> (raw)
In-Reply-To: <20110218022701.GA23435@elie>

Move most of git's header files to an include/ subdirectory.
This leaves us with 71 fewer files in the toplevel directory,
making the high-level structure of the codebase a little easier
to see.

Three headers stay behind, at least for now: git-compat-util.h,
strbuf.h, and cache.h are referred to by some system-specific code
(in compat/) using paths starting with "..".  Making these three core
headers especially visible doesn't seem like a bad idea, anyway.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 Makefile                                       |  146 ++++++++++++------------
 advice.h => include/advice.h                   |    0
 [ etc etc ]
 72 files changed, 73 insertions(+), 73 deletions(-)

diff --git a/Makefile b/Makefile
index f458f65..1e96504 100644
--- a/Makefile
+++ b/Makefile
@@ -333,7 +333,7 @@ SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
 # Those must not be GNU-specific; they are shared with perl/ which may
 # be built by a different compiler. (Note that this is an artifact now
 # but it still might be nice to keep that distinction.)
-BASIC_CFLAGS = -I.
+BASIC_CFLAGS = -I. -Iinclude
 BASIC_LDFLAGS =
 
 # Guard against environment variables
@@ -491,15 +491,15 @@ LIB_FILE=libgit.a
 XDIFF_LIB=xdiff/lib.a
 VCSSVN_LIB=vcs-svn/lib.a
 
-LIB_H += advice.h
-LIB_H += archive.h
-LIB_H += attr.h
-LIB_H += blob.h
-LIB_H += builtin.h
+LIB_H += include/advice.h
+LIB_H += include/archive.h
+LIB_H += include/attr.h
+LIB_H += include/blob.h
+LIB_H += include/builtin.h
 LIB_H += cache.h
-LIB_H += cache-tree.h
-LIB_H += color.h
-LIB_H += commit.h
+LIB_H += include/cache-tree.h
+LIB_H += include/color.h
+LIB_H += include/commit.h
 LIB_H += compat/bswap.h
 LIB_H += compat/cygwin.h
 LIB_H += compat/mingw.h
@@ -507,58 +507,58 @@ LIB_H += compat/win32/pthread.h
 LIB_H += compat/win32/syslog.h
 LIB_H += compat/win32/sys/poll.h
 LIB_H += compat/win32/dirent.h
-LIB_H += csum-file.h
-LIB_H += decorate.h
-LIB_H += delta.h
-LIB_H += diffcore.h
-LIB_H += diff.h
-LIB_H += dir.h
-LIB_H += exec_cmd.h
-LIB_H += fsck.h
+LIB_H += include/csum-file.h
+LIB_H += include/decorate.h
+LIB_H += include/delta.h
+LIB_H += include/diffcore.h
+LIB_H += include/diff.h
+LIB_H += include/dir.h
+LIB_H += include/exec_cmd.h
+LIB_H += include/fsck.h
 LIB_H += git-compat-util.h
-LIB_H += graph.h
-LIB_H += grep.h
-LIB_H += hash.h
-LIB_H += help.h
-LIB_H += levenshtein.h
-LIB_H += list-objects.h
-LIB_H += ll-merge.h
-LIB_H += log-tree.h
-LIB_H += mailmap.h
-LIB_H += merge-recursive.h
-LIB_H += notes.h
-LIB_H += notes-cache.h
-LIB_H += notes-merge.h
-LIB_H += object.h
-LIB_H += pack.h
-LIB_H += pack-refs.h
-LIB_H += pack-revindex.h
-LIB_H += parse-options.h
-LIB_H += patch-ids.h
-LIB_H += pkt-line.h
-LIB_H += progress.h
-LIB_H += quote.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 += sha1-lookup.h
-LIB_H += sideband.h
-LIB_H += sigchain.h
+LIB_H += include/graph.h
+LIB_H += include/grep.h
+LIB_H += include/hash.h
+LIB_H += include/help.h
+LIB_H += include/levenshtein.h
+LIB_H += include/list-objects.h
+LIB_H += include/ll-merge.h
+LIB_H += include/log-tree.h
+LIB_H += include/mailmap.h
+LIB_H += include/merge-recursive.h
+LIB_H += include/notes.h
+LIB_H += include/notes-cache.h
+LIB_H += include/notes-merge.h
+LIB_H += include/object.h
+LIB_H += include/pack.h
+LIB_H += include/pack-refs.h
+LIB_H += include/pack-revindex.h
+LIB_H += include/parse-options.h
+LIB_H += include/patch-ids.h
+LIB_H += include/pkt-line.h
+LIB_H += include/progress.h
+LIB_H += include/quote.h
+LIB_H += include/reflog-walk.h
+LIB_H += include/refs.h
+LIB_H += include/remote.h
+LIB_H += include/rerere.h
+LIB_H += include/resolve-undo.h
+LIB_H += include/revision.h
+LIB_H += include/run-command.h
+LIB_H += include/sha1-lookup.h
+LIB_H += include/sideband.h
+LIB_H += include/sigchain.h
 LIB_H += strbuf.h
-LIB_H += string-list.h
-LIB_H += submodule.h
-LIB_H += tag.h
-LIB_H += transport.h
-LIB_H += tree.h
-LIB_H += tree-walk.h
-LIB_H += unpack-trees.h
-LIB_H += userdiff.h
-LIB_H += utf8.h
-LIB_H += xdiff-interface.h
+LIB_H += include/string-list.h
+LIB_H += include/submodule.h
+LIB_H += include/tag.h
+LIB_H += include/transport.h
+LIB_H += include/tree.h
+LIB_H += include/tree-walk.h
+LIB_H += include/unpack-trees.h
+LIB_H += include/userdiff.h
+LIB_H += include/utf8.h
+LIB_H += include/xdiff-interface.h
 LIB_H += xdiff/xdiff.h
 
 LIB_OBJS += libgit/abspath.o
@@ -1949,20 +1949,20 @@ else
 # gcc detects!
 
 $(GIT_OBJS): $(LIB_H)
-builtin/branch.o builtin/checkout.o builtin/clone.o builtin/reset.o: branch.h
-libgit/branch.o libgit/transport.o: branch.h
-builtin/bundle.o libgit/bundle.o libgit/transport.o: bundle.h
-builtin/bisect--helper.o builtin/rev-list.o libgit/bisect.o: bisect.h
-builtin/clone.o builtin/fetch-pack.o libgit/transport.o: fetch-pack.h
-builtin/grep.o builtin/pack-objects.o libgit/transport-helper.o: thread-utils.h
-builtin/send-pack.o libgit/transport.o: send-pack.h
-builtin/log.o builtin/shortlog.o: shortlog.h
-builtin/prune.o builtin/reflog.o libgit/reachable.o: reachable.h
-builtin/commit.o builtin/revert.o libgit/wt-status.o: wt-status.h
-builtin/tar-tree.o libgit/archive-tar.o: tar.h
-libgit/connect.o libgit/transport.o http-backend.o: url.h
-http-fetch.o http-walker.o remote-curl.o libgit/transport.o libgit/walker.o: walker.h
-http.o http-walker.o http-push.o http-fetch.o remote-curl.o: http.h url.h
+builtin/branch.o builtin/checkout.o builtin/clone.o builtin/reset.o: include/branch.h
+libgit/branch.o libgit/transport.o: include/branch.h
+builtin/bundle.o libgit/bundle.o libgit/transport.o: include/bundle.h
+builtin/bisect--helper.o builtin/rev-list.o libgit/bisect.o: include/bisect.h
+builtin/clone.o builtin/fetch-pack.o libgit/transport.o: include/fetch-pack.h
+builtin/grep.o builtin/pack-objects.o libgit/transport-helper.o: include/thread-utils.h
+builtin/send-pack.o libgit/transport.o: include/send-pack.h
+builtin/log.o builtin/shortlog.o: include/shortlog.h
+builtin/prune.o builtin/reflog.o libgit/reachable.o: include/reachable.h
+builtin/commit.o builtin/revert.o libgit/wt-status.o: include/wt-status.h
+builtin/tar-tree.o libgit/archive-tar.o: include/tar.h
+libgit/connect.o libgit/transport.o http-backend.o: include/url.h
+http-fetch.o http-walker.o remote-curl.o libgit/transport.o libgit/walker.o: include/walker.h
+http.o http-walker.o http-push.o http-fetch.o remote-curl.o: include/http.h include/url.h
 
 libgit/xdiff-interface.o $(XDIFF_OBJS): \
 	xdiff/xinclude.h xdiff/xmacros.h xdiff/xdiff.h xdiff/xtypes.h \
diff --git a/advice.h b/include/advice.h
similarity index 100%
rename from advice.h
rename to include/advice.h
diff --git a/archive.h b/include/archive.h
similarity index 100%
rename from archive.h
rename to include/archive.h
diff --git a/attr.h b/include/attr.h
similarity index 100%
rename from attr.h
rename to include/attr.h
diff --git a/bisect.h b/include/bisect.h
similarity index 100%
rename from bisect.h
rename to include/bisect.h
diff --git a/blob.h b/include/blob.h
similarity index 100%
rename from blob.h
rename to include/blob.h
diff --git a/branch.h b/include/branch.h
similarity index 100%
rename from branch.h
rename to include/branch.h
diff --git a/builtin.h b/include/builtin.h
similarity index 100%
rename from builtin.h
rename to include/builtin.h
diff --git a/bundle.h b/include/bundle.h
similarity index 100%
rename from bundle.h
rename to include/bundle.h
diff --git a/cache-tree.h b/include/cache-tree.h
similarity index 100%
rename from cache-tree.h
rename to include/cache-tree.h
diff --git a/color.h b/include/color.h
similarity index 100%
rename from color.h
rename to include/color.h
diff --git a/commit.h b/include/commit.h
similarity index 100%
rename from commit.h
rename to include/commit.h
diff --git a/csum-file.h b/include/csum-file.h
similarity index 100%
rename from csum-file.h
rename to include/csum-file.h
diff --git a/decorate.h b/include/decorate.h
similarity index 100%
rename from decorate.h
rename to include/decorate.h
diff --git a/delta.h b/include/delta.h
similarity index 100%
rename from delta.h
rename to include/delta.h
diff --git a/diff.h b/include/diff.h
similarity index 100%
rename from diff.h
rename to include/diff.h
diff --git a/diffcore.h b/include/diffcore.h
similarity index 100%
rename from diffcore.h
rename to include/diffcore.h
diff --git a/dir.h b/include/dir.h
similarity index 100%
rename from dir.h
rename to include/dir.h
diff --git a/exec_cmd.h b/include/exec_cmd.h
similarity index 100%
rename from exec_cmd.h
rename to include/exec_cmd.h
diff --git a/fetch-pack.h b/include/fetch-pack.h
similarity index 100%
rename from fetch-pack.h
rename to include/fetch-pack.h
diff --git a/fsck.h b/include/fsck.h
similarity index 100%
rename from fsck.h
rename to include/fsck.h
diff --git a/graph.h b/include/graph.h
similarity index 100%
rename from graph.h
rename to include/graph.h
diff --git a/grep.h b/include/grep.h
similarity index 100%
rename from grep.h
rename to include/grep.h
diff --git a/hash.h b/include/hash.h
similarity index 100%
rename from hash.h
rename to include/hash.h
diff --git a/help.h b/include/help.h
similarity index 100%
rename from help.h
rename to include/help.h
diff --git a/http.h b/include/http.h
similarity index 100%
rename from http.h
rename to include/http.h
diff --git a/levenshtein.h b/include/levenshtein.h
similarity index 100%
rename from levenshtein.h
rename to include/levenshtein.h
diff --git a/list-objects.h b/include/list-objects.h
similarity index 100%
rename from list-objects.h
rename to include/list-objects.h
diff --git a/ll-merge.h b/include/ll-merge.h
similarity index 100%
rename from ll-merge.h
rename to include/ll-merge.h
diff --git a/log-tree.h b/include/log-tree.h
similarity index 100%
rename from log-tree.h
rename to include/log-tree.h
diff --git a/mailmap.h b/include/mailmap.h
similarity index 100%
rename from mailmap.h
rename to include/mailmap.h
diff --git a/merge-recursive.h b/include/merge-recursive.h
similarity index 100%
rename from merge-recursive.h
rename to include/merge-recursive.h
diff --git a/notes-cache.h b/include/notes-cache.h
similarity index 100%
rename from notes-cache.h
rename to include/notes-cache.h
diff --git a/notes-merge.h b/include/notes-merge.h
similarity index 100%
rename from notes-merge.h
rename to include/notes-merge.h
diff --git a/notes.h b/include/notes.h
similarity index 100%
rename from notes.h
rename to include/notes.h
diff --git a/object.h b/include/object.h
similarity index 100%
rename from object.h
rename to include/object.h
diff --git a/pack-refs.h b/include/pack-refs.h
similarity index 100%
rename from pack-refs.h
rename to include/pack-refs.h
diff --git a/pack-revindex.h b/include/pack-revindex.h
similarity index 100%
rename from pack-revindex.h
rename to include/pack-revindex.h
diff --git a/pack.h b/include/pack.h
similarity index 100%
rename from pack.h
rename to include/pack.h
diff --git a/parse-options.h b/include/parse-options.h
similarity index 100%
rename from parse-options.h
rename to include/parse-options.h
diff --git a/patch-ids.h b/include/patch-ids.h
similarity index 100%
rename from patch-ids.h
rename to include/patch-ids.h
diff --git a/pkt-line.h b/include/pkt-line.h
similarity index 100%
rename from pkt-line.h
rename to include/pkt-line.h
diff --git a/progress.h b/include/progress.h
similarity index 100%
rename from progress.h
rename to include/progress.h
diff --git a/quote.h b/include/quote.h
similarity index 100%
rename from quote.h
rename to include/quote.h
diff --git a/reachable.h b/include/reachable.h
similarity index 100%
rename from reachable.h
rename to include/reachable.h
diff --git a/reflog-walk.h b/include/reflog-walk.h
similarity index 100%
rename from reflog-walk.h
rename to include/reflog-walk.h
diff --git a/refs.h b/include/refs.h
similarity index 100%
rename from refs.h
rename to include/refs.h
diff --git a/remote.h b/include/remote.h
similarity index 100%
rename from remote.h
rename to include/remote.h
diff --git a/rerere.h b/include/rerere.h
similarity index 100%
rename from rerere.h
rename to include/rerere.h
diff --git a/resolve-undo.h b/include/resolve-undo.h
similarity index 100%
rename from resolve-undo.h
rename to include/resolve-undo.h
diff --git a/revision.h b/include/revision.h
similarity index 100%
rename from revision.h
rename to include/revision.h
diff --git a/run-command.h b/include/run-command.h
similarity index 100%
rename from run-command.h
rename to include/run-command.h
diff --git a/send-pack.h b/include/send-pack.h
similarity index 100%
rename from send-pack.h
rename to include/send-pack.h
diff --git a/sha1-lookup.h b/include/sha1-lookup.h
similarity index 100%
rename from sha1-lookup.h
rename to include/sha1-lookup.h
diff --git a/shortlog.h b/include/shortlog.h
similarity index 100%
rename from shortlog.h
rename to include/shortlog.h
diff --git a/sideband.h b/include/sideband.h
similarity index 100%
rename from sideband.h
rename to include/sideband.h
diff --git a/sigchain.h b/include/sigchain.h
similarity index 100%
rename from sigchain.h
rename to include/sigchain.h
diff --git a/string-list.h b/include/string-list.h
similarity index 100%
rename from string-list.h
rename to include/string-list.h
diff --git a/submodule.h b/include/submodule.h
similarity index 100%
rename from submodule.h
rename to include/submodule.h
diff --git a/tag.h b/include/tag.h
similarity index 100%
rename from tag.h
rename to include/tag.h
diff --git a/tar.h b/include/tar.h
similarity index 100%
rename from tar.h
rename to include/tar.h
diff --git a/thread-utils.h b/include/thread-utils.h
similarity index 100%
rename from thread-utils.h
rename to include/thread-utils.h
diff --git a/transport.h b/include/transport.h
similarity index 100%
rename from transport.h
rename to include/transport.h
diff --git a/tree-walk.h b/include/tree-walk.h
similarity index 100%
rename from tree-walk.h
rename to include/tree-walk.h
diff --git a/tree.h b/include/tree.h
similarity index 100%
rename from tree.h
rename to include/tree.h
diff --git a/unpack-trees.h b/include/unpack-trees.h
similarity index 100%
rename from unpack-trees.h
rename to include/unpack-trees.h
diff --git a/url.h b/include/url.h
similarity index 100%
rename from url.h
rename to include/url.h
diff --git a/userdiff.h b/include/userdiff.h
similarity index 100%
rename from userdiff.h
rename to include/userdiff.h
diff --git a/utf8.h b/include/utf8.h
similarity index 100%
rename from utf8.h
rename to include/utf8.h
diff --git a/walker.h b/include/walker.h
similarity index 100%
rename from walker.h
rename to include/walker.h
diff --git a/wt-status.h b/include/wt-status.h
similarity index 100%
rename from wt-status.h
rename to include/wt-status.h
diff --git a/xdiff-interface.h b/include/xdiff-interface.h
similarity index 100%
rename from xdiff-interface.h
rename to include/xdiff-interface.h
-- 
1.7.4.1

  parent reply	other threads:[~2011-02-18  2:38 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-09 15:14 [PATCH/RFC] Move test-*.c to test/ subdirectory Nguyễn Thái Ngọc Duy
2011-02-09 15:23 ` Nguyen Thai Ngoc Duy
2011-02-09 22:15 ` Junio C Hamano
2011-02-10  2:14   ` [PATCH] Move test-* to t/helper/ subdirectory Nguyễn Thái Ngọc Duy
2011-02-18  2:27     ` [RFC/PATCH 0/3] Thinning the git toplevel directory Jonathan Nieder
2011-02-18  2:31       ` [PATCH 1/3] Move libgit.a sources into a libgit/ subdirectory Jonathan Nieder
2011-02-18  3:47         ` Nguyen Thai Ngoc Duy
2011-02-18  4:14           ` Jonathan Nieder
2011-02-18  4:18             ` Jeff King
2011-02-18  5:58               ` Jonathan Nieder
2011-02-18  4:31         ` Nguyen Thai Ngoc Duy
2011-02-18  2:33       ` [PATCH 2/3] Move test-* into a test-programs/ subdirectory Jonathan Nieder
2011-02-18  2:37       ` Jonathan Nieder [this message]
2011-02-18  3:52         ` [PATCH 3/3] Move header files into a include/ subdirectory Nguyen Thai Ngoc Duy
2011-02-18  4:29           ` [RFC/PATCH 4 to 6/3] Move remaining " Jonathan Nieder
2011-02-18  4:32             ` [PATCH 4/3] compat: do not use relative paths to refer to git-compat-util.h et al Jonathan Nieder
2011-02-18  4:34             ` [PATCH 5/3] block-sha1: do not use relative path for git-compat-util.h Jonathan Nieder
2011-02-18  4:35             ` [PATCH 6/3] Move git-compat-util.h, strbuf.h, and cache.h to include/ Jonathan Nieder
2011-02-18  3:56       ` [RFC/PATCH 0/3] Thinning the git toplevel directory Nguyen Thai Ngoc Duy
2011-02-18  4:51         ` [RFC/PATCH 7 - 9/3] " Jonathan Nieder
2011-02-18  4:52           ` [PATCH 7/3] Move test-sha1.sh to test-programs/ Jonathan Nieder
2011-02-18  4:55           ` [PATCH 8/3] Move build helpers to scripts/ subdirectory Jonathan Nieder
2011-02-18  5:04           ` [PATCH 9/3] Move non-builtin git commands and script libraries to a subdirectory Jonathan Nieder
2011-02-18  9:25         ` [RFC/PATCH 0/3] Thinning the git toplevel directory Jonathan Nieder
2011-02-18 11:08           ` Jeff King
2011-02-18 12:33             ` Jonathan Nieder
2011-02-18 12:33           ` Nguyen Thai Ngoc Duy
2011-02-18 18:55           ` Junio C Hamano
2011-02-19 11:11             ` Jonathan Nieder
2011-02-19 23:05               ` Sverre Rabbelier
2011-02-19 23:15                 ` The git_remote_helpers package (Re: [RFC/PATCH 0/3] Thinning the git toplevel directory) Jonathan Nieder
2011-02-22 15:56               ` [RFC/PATCH 0/3] Thinning the git toplevel directory Jeff King
2011-02-22 19:30                 ` Junio C Hamano
2011-02-22 19:32                   ` Sverre Rabbelier
2011-02-23  4:51                   ` Jeff King
2011-02-23  8:29                     ` Jonathan Nieder
2011-02-23  8:43                       ` Jeff King
2011-02-23  9:56                         ` Recursive make and variations on the theme Jonathan Nieder
2011-02-23 16:42                     ` [RFC/PATCH 0/3] Thinning the git toplevel directory Junio C Hamano
2011-02-23 17:18                       ` Nicolas Pitre
2011-02-23 23:09                         ` Drew Northup
2011-02-24  0:14                           ` Nicolas Pitre
2011-02-24 17:10                             ` Drew Northup
2011-02-24 18:04                               ` Nicolas Pitre
2011-02-24 19:08                                 ` Jeff King
2011-02-24 19:46                                   ` Drew Northup
2011-02-19  0:10           ` Piotr Krukowiecki
2011-02-19  0:31             ` Junio C Hamano
2011-02-19  0:50               ` Jonathan Nieder
2011-02-19  9:27                 ` Piotr Krukowiecki
2011-02-19  9:24               ` Piotr Krukowiecki
2011-02-19  9:41                 ` Advertising the prebuilt htmldocs and manpages Jonathan Nieder
2011-02-20  6:52                   ` Junio C Hamano
2011-02-20  9:40                     ` Jonathan Nieder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110218023750.GD23435@elie \
    --to=jrnieder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=nico@fluxnic.net \
    --cc=pclouds@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).