Header cleanups (splitting up cache.h)
cover Header cleanups (splitting up cache.h)
Maintainer notes: (1) This series is based on a merge of en/header-split-cleanup and ab/remove-implicit-use-of-the-repository (both in next). (2) Although I've tweaked the series to minimize conflicts (and this series merges syntactically cleanly with next and seen), there is a semantic conflict with ja/worktree-orphan in seen; to correct, simply add an include of advice.h in builtin/worktree.c.
This series builds on en/header-cleanup
(https://lore.kernel.org/git/[email protected]/)
and en/header-split-cleanup
(https://lore.kernel.org/git/[email protected]/),
and continues to focus on splitting declarations from cache.h to separate headers.
The series may appear to be long at first glance, but is repetitive and simple. It should be relatively easy to review, and falls into roughly 3 categories. An overview:
* Patches 1-6: Being more explicit about dependencies. This was motivated by the fact that trying to find unnecessary dependencies on cache.h were being made harder by implicit dependencies on trace.h, trace2.h, and advice.h that were included via cache.h. (Similar to gettext.h handling in the previous series.) So I simply try to make dependencies more explicit, for both these headers and a few others. To make review easy, I split it into half a dozen patches, one header per patch (well, except that I handle trace.h and trace2.h together).
* Patch 7: Remove several includes of cache.h that are no longer needed due to patches 1-6.
* Patches 8-18: For several choices of FOO, move declarations of functions for FOO.c from cache.h to FOO.h. To simplify reviewing, each case is split into two patches, with the second patch cleaning up unnecessary includes of cache.h in other source files. (Patch 14 is a slight exception that wasn't split into two patches since the movement was otherwise so small)
* Patches 19-24: Other small manual cleanups noticed while doing above work
Since patches 1-14 & 16-18 are just more of the same types of patches already reviewed in the last two series, it probably makes more sense for reviewers to focus on the other patches: 15 + 19-24 (which also happen to be smaller). I would particularly most like review of patches 15, 21, & 24 since they are the least like any previously reviewed patches.
There are more changes I plan to make after this series graduates (still focused around splitting up cache.h), but this series was long enough.
And thanks once again to Dscho for gitgitgadget. Getting multiple platform testing + all the special tests (sparse, cocci, hdr-check, etc.) really helps clean out all the issues that would otherwise hit a series like this.
Elijah Newren (24):
treewide: be explicit about dependence on trace.h & trace2.h
treewide: be explicit about dependence on advice.h
treewide: be explicit about dependence on convert.h
treewide: be explicit about dependence on pack-revindex.h
treewide: be explicit about dependence on oid-array.h
treewide: be explicit about dependence on mem-pool.h
treewide: remove unnecessary cache.h inclusion object-name.h: move declarations for object-name.c functions from
cache.h
treewide: remove cache.h inclusion due to object-name.h changes
git-zlib: move declarations for git-zlib functions from cache.h
treewide: remove cache.h inclusion due to git-zlib changes object-file.h: move declarations for object-file.c functions from
cache.h
treewide: remove cache.h inclusion due to object-file.h changes object.h: move an inline function and some defines from cache.h
editor: move editor-related functions and declarations into common
file
treewide: remove cache.h inclusion due to editor.h changes pager.h: move declarations for pager.c functions from cache.h
treewide: remove cache.h inclusion due to pager.h changes cache.h: remove unnecessary includes
strbuf: move forward declarations to beginning of file
treewide: remove double forward declaration of read_in_full
treewide: reduce includes of cache.h in other headers chdir-notify, quote: replace cache.h include with path.h mailmap, quote: move declarations of global vars to correct unit
Makefile | 2 +- add-patch.c | 3 + apply.c | 2 + archive-tar.c | 1 + archive-zip.c | 1 + archive.c | 1 + archive.h | 3 +- blame.c | 2 + branch.c | 4 +- builtin/add.c | 2 + builtin/am.c | 4 + builtin/bisect.c | 2 + builtin/blame.c | 2 + builtin/branch.c | 2 + builtin/bugreport.c | 2 + builtin/cat-file.c | 3 + builtin/check-attr.c | 1 + builtin/checkout.c | 3 + builtin/clone.c | 3 + builtin/commit-graph.c | 1 + builtin/commit-tree.c | 1 + builtin/commit.c | 3 + builtin/config.c | 1 + builtin/credential-cache--daemon.c | 1 + builtin/describe.c | 1 + builtin/diagnose.c | 1 + builtin/difftool.c | 1 + builtin/fast-export.c | 1 + builtin/fast-import.c | 2 + builtin/fetch.c | 6 + builtin/fsck.c | 2 + builtin/fsmonitor--daemon.c | 1 + builtin/gc.c | 2 + builtin/grep.c | 3 + builtin/hash-object.c | 1 + builtin/help.c | 1 + builtin/index-pack.c | 3 + builtin/init-db.c | 1 + builtin/log.c | 4 + builtin/ls-files.c | 2 + builtin/ls-tree.c | 1 + builtin/merge-base.c | 1 + builtin/merge-recursive.c | 2 + builtin/merge-tree.c | 1 + builtin/merge.c | 3 + builtin/mktag.c | 1 + builtin/mv.c | 2 + builtin/name-rev.c | 2 + builtin/notes.c | 2 + builtin/pack-objects.c | 1 + builtin/prune.c | 1 + builtin/pull.c | 2 + builtin/push.c | 2 + builtin/range-diff.c | 1 + builtin/read-tree.c | 1 + builtin/rebase.c | 3 + builtin/receive-pack.c | 3 + builtin/replace.c | 3 + builtin/reset.c | 4 + builtin/rev-list.c | 1 + builtin/rev-parse.c | 1 + builtin/rm.c | 1 + builtin/show-branch.c | 1 + builtin/show-ref.c | 1 + builtin/sparse-checkout.c | 2 + builtin/stash.c | 1 + builtin/submodule--helper.c | 2 + builtin/tag.c | 3 + builtin/unpack-file.c | 1 + builtin/unpack-objects.c | 1 + builtin/update-index.c | 1 + builtin/update-ref.c | 1 + builtin/var.c | 2 + builtin/verify-commit.c | 1 + builtin/verify-tag.c | 1 + builtin/worktree.c | 2 + bulk-checkin.c | 4 +- bundle.c | 2 +- cache-tree.c | 3 + cache.h | 279 +---------------------- chdir-notify.c | 4 +- checkout.c | 4 +- color.c | 2 + column.c | 3 +- combine-diff.c | 3 + commit-graph.c | 4 +- commit.c | 1 + common-main.c | 1 + compat/fsmonitor/fsm-listen-win32.c | 1 + compat/mingw.c | 1 + compat/pread.c | 1 + compat/simple-ipc/ipc-unix-socket.c | 3 +- compat/simple-ipc/ipc-win32.c | 2 + compat/win32/trace2_win32_process_info.c | 1 + config.c | 6 + connect.c | 3 +- convert.c | 3 + date.c | 1 + delta-islands.c | 2 +- diff-lib.c | 2 + diff.c | 5 + dir.c | 3 + editor.c | 34 ++- editor.h | 34 +++ environment.c | 4 +- exec-cmd.c | 2 + fetch-pack.c | 3 +- fmt-merge-msg.c | 3 +- fsck.c | 2 +- fsmonitor.c | 1 + fsmonitor.h | 1 + git-compat-util.h | 6 - zlib.c => git-zlib.c | 3 +- git-zlib.h | 28 +++ git.c | 3 + grep.c | 1 + http-backend.c | 3 +- http-fetch.c | 2 +- http-push.c | 2 +- http-walker.c | 2 +- http.c | 2 + http.h | 4 +- list-objects-filter.c | 1 + list-objects.c | 2 +- ll-merge.c | 1 + log-tree.c | 1 + mailmap.c | 3 +- mailmap.h | 3 + merge-ort.c | 4 + merge-recursive.c | 1 + midx.c | 1 + name-hash.c | 1 + notes-merge.c | 6 +- notes.c | 3 +- object-file.c | 2 + object-file.h | 121 ++++++++++ object-name.c | 2 + object-name.h | 99 ++++++++ object.c | 1 + object.h | 21 ++ pack-bitmap-write.c | 2 +- pack-bitmap.c | 4 +- pack-check.c | 3 +- pack-mtimes.c | 3 +- pack-revindex.c | 4 +- pack-write.c | 4 +- packfile.c | 3 + pager.c | 6 +- pager.h | 17 ++ parse-options-cb.c | 1 + path.c | 1 + pkt-line.c | 1 + preload-index.c | 1 + pretty.c | 3 +- progress.c | 4 +- promisor-remote.c | 3 +- protocol.c | 3 +- quote.c | 3 +- quote.h | 2 + range-diff.c | 2 + read-cache.c | 5 + rebase-interactive.c | 2 + ref-filter.c | 2 + refs.c | 4 +- refs/files-backend.c | 1 + refs/packed-backend.c | 1 + refs/ref-cache.h | 2 +- remote-curl.c | 1 + remote.c | 3 +- repository.c | 1 + rerere.c | 3 +- reset.c | 1 + resolve-undo.h | 7 +- revision.c | 4 +- run-command.c | 2 + scalar.c | 3 +- send-pack.c | 1 + sequencer.c | 4 + server-info.c | 1 + setup.c | 5 +- shallow.c | 1 + sideband.c | 3 +- split-index.c | 1 + split-index.h | 2 +- strbuf.c | 31 +-- strbuf.h | 33 +-- streaming.c | 4 +- submodule-config.c | 3 +- submodule.c | 3 + t/helper/test-date.c | 2 +- t/helper/test-fast-rebase.c | 1 + t/helper/test-lazy-init-name-hash.c | 1 + t/helper/test-match-trees.c | 1 + t/helper/test-mergesort.c | 1 + t/helper/test-oidmap.c | 2 +- t/helper/test-path-utils.c | 1 + t/helper/test-reach.c | 2 +- t/helper/test-submodule-config.c | 2 +- tag.c | 1 + tmp-objdir.c | 3 +- trace.c | 3 +- trace2.c | 1 + transport-helper.c | 3 +- transport.c | 3 + tree-walk.c | 2 + tree.c | 1 + unpack-trees.c | 2 + unpack-trees.h | 1 + upload-pack.c | 5 +- walker.c | 2 +- wrapper.c | 1 + wt-status.c | 4 + 212 files changed, 743 insertions(+), 404 deletions(-) create mode 100644 editor.h rename zlib.c => git-zlib.c (99%) create mode 100644 git-zlib.h create mode 100644 object-file.h create mode 100644 object-name.h create mode 100644 pager.h
base-commit: dc1c48a4a2bce29542f330137106c01daa728f9e
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1509%2Fnewren%2Fheader-cleanup-3-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1509/newren/header-cleanup-3-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1509
Signature · 1 line
gitgitgadget
PATCH 3/24 treewide: be explicit about dependence on convert.h
From: Elijah Newren <[email protected]>
--- archive.c | 1 + blame.c | 1 + builtin/cat-file.c | 1 + builtin/ls-files.c | 1 + cache.h | 1 - combine-diff.c | 1 + config.c | 1 + convert.c | 1 + diff.c | 1 + dir.c | 1 + environment.c | 1 + ll-merge.c | 1 + object-file.c | 1 + streaming.c | 1 + unpack-trees.h | 1 + 15 files changed, 14 insertions(+), 1 deletion(-)
archive.c +1 -0
@@ -2,6 +2,7 @@#include "abspath.h" #include "alloc.h" #include "config.h" +#include "convert.h" #include "environment.h" #include "gettext.h" #include "hex.h"
blame.c +1 -0
@@ -3,6 +3,7 @@#include "object-store.h" #include "cache-tree.h" #include "mergesort.h" +#include "convert.h" #include "diff.h" #include "diffcore.h" #include "gettext.h"
builtin/cat-file.c +1 -0
@@ -7,6 +7,7 @@#include "cache.h" #include "alloc.h" #include "config.h" +#include "convert.h" #include "builtin.h" #include "diff.h" #include "environment.h"
builtin/ls-files.c +1 -0
@@ -8,6 +8,7 @@#include "cache.h" #include "repository.h" #include "config.h" +#include "convert.h" #include "quote.h" #include "dir.h" #include "builtin.h"
cache.h +0 -1
@@ -6,7 +6,6 @@#include "hashmap.h" #include "list.h" #include "gettext.h" -#include "convert.h" #include "string-list.h" #include "pack-revindex.h" #include "hash.h"
combine-diff.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "object-store.h" #include "commit.h" +#include "convert.h" #include "blob.h" #include "diff.h" #include "diffcore.h"
config.c +1 -0
@@ -12,6 +12,7 @@#include "date.h" #include "branch.h" #include "config.h" +#include "convert.h" #include "environment.h" #include "gettext.h" #include "ident.h"
convert.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "advice.h" #include "config.h" +#include "convert.h" #include "gettext.h" #include "hex.h" #include "object-store.h"
diff.c +1 -0
@@ -5,6 +5,7 @@#include "abspath.h" #include "alloc.h" #include "config.h" +#include "convert.h" #include "environment.h" #include "gettext.h" #include "tempfile.h"
dir.c +1 -0
@@ -9,6 +9,7 @@#include "abspath.h" #include "alloc.h" #include "config.h" +#include "convert.h" #include "dir.h" #include "environment.h" #include "gettext.h"
environment.c +1 -0
@@ -10,6 +10,7 @@#include "cache.h" #include "abspath.h" #include "branch.h" +#include "convert.h" #include "environment.h" #include "gettext.h" #include "repository.h"
ll-merge.c +1 -0
@@ -6,6 +6,7 @@#include "cache.h" #include "config.h" +#include "convert.h" #include "attr.h" #include "xdiff-interface.h" #include "run-command.h"
object-file.c +1 -0
@@ -10,6 +10,7 @@#include "abspath.h" #include "alloc.h" #include "config.h" +#include "convert.h" #include "environment.h" #include "gettext.h" #include "hex.h"
streaming.c +1 -0
@@ -2,6 +2,7 @@* Copyright (c) 2011, Google Inc. */ #include "cache.h" +#include "convert.h" #include "environment.h" #include "streaming.h" #include "repository.h"
unpack-trees.h +1 -0
@@ -2,6 +2,7 @@#define UNPACK_TREES_H #include "cache.h" +#include "convert.h" #include "strvec.h" #include "string-list.h" #include "tree-walk.h"
Signature · 1 line
gitgitgadget
PATCH 1/24 treewide: be explicit about dependence on trace.h & trace2.h
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
Dozens of files made use of trace and trace2 functions, without explicitly including trace.h or trace2.h. This made it more difficult to find which files could remove a dependence on cache.h. Make C files explicitly include trace.h or trace2.h if they are using them.
--- blame.c | 1 + builtin/checkout.c | 1 + builtin/commit-graph.c | 1 + builtin/fetch.c | 2 ++ builtin/fsmonitor--daemon.c | 1 + builtin/gc.c | 1 + builtin/push.c | 1 + builtin/rebase.c | 1 + builtin/receive-pack.c | 2 ++ builtin/reset.c | 2 ++ cache-tree.c | 2 ++ cache.h | 2 -- chdir-notify.c | 1 + common-main.c | 1 + compat/fsmonitor/fsm-listen-win32.c | 1 + compat/mingw.c | 1 + compat/simple-ipc/ipc-unix-socket.c | 1 + compat/simple-ipc/ipc-win32.c | 2 ++ compat/win32/trace2_win32_process_info.c | 1 + config.c | 1 + connect.c | 1 + convert.c | 1 + diff-lib.c | 1 + dir.c | 1 + environment.c | 1 + exec-cmd.c | 2 ++ fetch-pack.c | 1 + fsmonitor.c | 1 + fsmonitor.h | 1 + git.c | 2 ++ http.c | 1 + merge-ort.c | 1 + name-hash.c | 1 + notes-merge.c | 1 + pack-bitmap.c | 1 + pack-revindex.c | 1 + packfile.c | 1 + pkt-line.c | 1 + preload-index.c | 1 + progress.c | 1 + promisor-remote.c | 1 + protocol.c | 1 + read-cache.c | 1 + remote-curl.c | 1 + repository.c | 1 + revision.c | 1 + run-command.c | 2 ++ scalar.c | 1 + setup.c | 1 + shallow.c | 1 + submodule.c | 1 + t/helper/test-date.c | 1 + t/helper/test-lazy-init-name-hash.c | 1 + t/helper/test-path-utils.c | 1 + trace.c | 1 + trace2.c | 1 + transport.c | 1 + tree-walk.c | 1 + unpack-trees.c | 1 + upload-pack.c | 1 + wrapper.c | 1 + wt-status.c | 2 ++ 62 files changed, 70 insertions(+), 2 deletions(-)
blame.c +1 -0
@@ -9,6 +9,7 @@#include "hex.h" #include "setup.h" #include "tag.h" +#include "trace2.h" #include "blame.h" #include "alloc.h" #include "commit-slab.h"
builtin/checkout.c +1 -0
@@ -26,6 +26,7 @@#include "setup.h" #include "submodule.h" #include "submodule-config.h" +#include "trace2.h" #include "tree.h" #include "tree-walk.h" #include "unpack-trees.h"
builtin/commit-graph.c +1 -0
@@ -12,6 +12,7 @@#include "progress.h" #include "replace-object.h" #include "tag.h" +#include "trace2.h" #define BUILTIN_COMMIT_GRAPH_VERIFY_USAGE \ N_("git commit-graph verify [--object-dir <dir>] [--shallow] [--[no-]progress]")
builtin/fetch.c +2 -0
@@ -31,6 +31,8 @@#include "promisor-remote.h" #include "commit-graph.h" #include "shallow.h" +#include "trace.h" +#include "trace2.h" #include "worktree.h" #include "bundle-uri.h"
builtin/fsmonitor--daemon.c +1 -0
@@ -14,6 +14,7 @@#include "simple-ipc.h" #include "khash.h" #include "pkt-line.h" +#include "trace2.h" static const char *const builtin_fsmonitor__daemon_usage[] = {N_ ("git fsmonitor--daemon start [<options>]" ),
builtin/gc.c +1 -0
@@ -37,6 +37,7 @@#include "gettext.h" #include "hook.h" #include "setup.h" +#include "trace2.h" #include "wrapper.h" #define FAILED_RUN "failed to run %s"
builtin/push.c +1 -0
@@ -16,6 +16,7 @@#include "submodule.h" #include "submodule-config.h" #include "send-pack.h" +#include "trace2.h" #include "color.h" static const char *const push_usage[] = {
builtin/rebase.c +1 -0
@@ -32,6 +32,7 @@#include "sequencer.h" #include "rebase-interactive.h" #include "reset.h" +#include "trace2.h" #include "hook.h" #include "wrapper.h"
builtin/receive-pack.c +2 -0
@@ -32,6 +32,8 @@#include "object-store.h" #include "protocol.h" #include "commit-reach.h" +#include "trace.h" +#include "trace2.h" #include "worktree.h" #include "shallow.h" #include "wrapper.h"
builtin/reset.c +2 -0
@@ -29,6 +29,8 @@#include "setup.h" #include "submodule.h" #include "submodule-config.h" +#include "trace.h" +#include "trace2.h" #include "dir.h" #include "add-interactive.h"
cache-tree.c +2 -0
@@ -11,6 +11,8 @@#include "replace-object.h" #include "promisor-remote.h" #include "sparse-index.h" +#include "trace.h" +#include "trace2.h" #ifndef DEBUG_CACHE_TREE #define DEBUG_CACHE_TREE 0
cache.h +0 -2
@@ -8,8 +8,6 @@#include "advice.h" #include "gettext.h" #include "convert.h" -#include "trace.h" -#include "trace2.h" #include "string-list.h" #include "pack-revindex.h" #include "hash.h"
chdir-notify.c +1 -0
@@ -3,6 +3,7 @@#include "chdir-notify.h" #include "list.h" #include "strbuf.h" +#include "trace.h" struct chdir_notify_entry {const char *name;
common-main.c +1 -0
@@ -3,6 +3,7 @@#include "gettext.h" #include "attr.h" #include "setup.h" +#include "trace2.h" /* * Many parts of Git have subprograms communicate via pipe, expect the
compat/fsmonitor/fsm-listen-win32.c +1 -0
@@ -4,6 +4,7 @@#include "fsm-listen.h" #include "fsmonitor--daemon.h" #include "gettext.h" +#include "trace2.h" /* * The documentation of ReadDirectoryChangesW() states that the maximum
compat/mingw.c +1 -0
@@ -12,6 +12,7 @@#include "win32/lazyload.h" #include "../config.h" #include "../environment.h" +#include "../trace2.h" #include "../wrapper.h" #include "dir.h" #include "gettext.h"
compat/simple-ipc/ipc-unix-socket.c +1 -0
@@ -4,6 +4,7 @@#include "strbuf.h" #include "pkt-line.h" #include "thread-utils.h" +#include "trace2.h" #include "unix-socket.h" #include "unix-stream-server.h"
compat/simple-ipc/ipc-win32.c +2 -0
@@ -5,6 +5,8 @@#include "strbuf.h" #include "pkt-line.h" #include "thread-utils.h" +#include "trace.h" +#include "trace2.h" #include "accctrl.h" #include "aclapi.h"
compat/win32/trace2_win32_process_info.c +1 -0
@@ -1,5 +1,6 @@#include "../../cache.h" #include "../../json-writer.h" +#include "../../trace2.h" #include "lazyload.h" #include <Psapi.h> #include <tlHelp32.h>
config.c +1 -0
@@ -28,6 +28,7 @@#include "replace-object.h" #include "refs.h" #include "setup.h" +#include "trace2.h" #include "worktree.h" #include "wrapper.h" #include "write-or-die.h"
connect.c +1 -0
@@ -14,6 +14,7 @@#include "string-list.h" #include "oid-array.h" #include "transport.h" +#include "trace2.h" #include "strbuf.h" #include "version.h" #include "protocol.h"
convert.c +1 -0
@@ -9,6 +9,7 @@#include "sigchain.h" #include "pkt-line.h" #include "sub-process.h" +#include "trace.h" #include "utf8.h" #include "ll-merge.h" #include "wrapper.h"
diff-lib.c +1 -0
@@ -13,6 +13,7 @@#include "unpack-trees.h" #include "refs.h" #include "submodule.h" +#include "trace.h" #include "dir.h" #include "fsmonitor.h" #include "commit-reach.h"
dir.c +1 -0
@@ -23,6 +23,7 @@#include "fsmonitor.h" #include "setup.h" #include "submodule-config.h" +#include "trace2.h" #include "wrapper.h" /*
environment.c +1 -0
@@ -24,6 +24,7 @@#include "chdir-notify.h" #include "setup.h" #include "shallow.h" +#include "trace.h" #include "wrapper.h" #include "write-or-die.h"
exec-cmd.c +2 -0
@@ -5,6 +5,8 @@#include "gettext.h" #include "quote.h" #include "strvec.h" +#include "trace.h" +#include "trace2.h" #if defined(RUNTIME_PREFIX )
fetch-pack.c +1 -0
@@ -17,6 +17,7 @@#include "remote.h" #include "run-command.h" #include "connect.h" +#include "trace2.h" #include "transport.h" #include "version.h" #include "oid-array.h"
fsmonitor.c +1 -0
@@ -7,6 +7,7 @@#include "fsmonitor-ipc.h" #include "run-command.h" #include "strbuf.h" +#include "trace2.h" #define INDEX_EXTENSION_VERSION1 (1)#define INDEX_EXTENSION_VERSION2 (2)
fsmonitor.h +1 -0
@@ -4,6 +4,7 @@#include "cache.h" #include "dir.h" #include "fsmonitor-settings.h" +#include "trace.h" extern struct trace_key trace_fsmonitor;
git.c +2 -0
@@ -9,6 +9,8 @@#include "replace-object.h" #include "setup.h" #include "shallow.h" +#include "trace.h" +#include "trace2.h" #define RUN_SETUP (1<<0)#define RUN_SETUP_GENTLY (1<<1)
http.c +1 -0
@@ -12,6 +12,7 @@#include "version.h" #include "pkt-line.h" #include "gettext.h" +#include "trace.h" #include "transport.h" #include "packfile.h" #include "protocol.h"
merge-ort.c +1 -0
@@ -37,6 +37,7 @@#include "strmap.h" #include "submodule-config.h" #include "submodule.h" +#include "trace2.h" #include "tree.h" #include "unpack-trees.h" #include "xdiff-interface.h"
name-hash.c +1 -0
@@ -9,6 +9,7 @@#include "environment.h" #include "gettext.h" #include "thread-utils.h" +#include "trace.h" #include "trace2.h" #include "sparse-index.h"
notes-merge.c +1 -0
@@ -13,6 +13,7 @@#include "notes.h" #include "notes-merge.h" #include "strbuf.h" +#include "trace.h" #include "notes-utils.h" #include "commit-reach.h" #include "wrapper.h"
pack-bitmap.c +1 -0
@@ -15,6 +15,7 @@#include "pack-objects.h" #include "packfile.h" #include "repository.h" +#include "trace2.h" #include "object-store.h" #include "list-objects-filter-options.h" #include "midx.h"
pack-revindex.c +1 -0
@@ -3,6 +3,7 @@#include "pack-revindex.h" #include "object-store.h" #include "packfile.h" +#include "trace2.h" #include "config.h" #include "midx.h"
packfile.c +1 -0
@@ -15,6 +15,7 @@#include "commit.h" #include "object.h" #include "tag.h" +#include "trace.h" #include "tree-walk.h" #include "tree.h" #include "object-store.h"
pkt-line.c +1 -0
@@ -3,6 +3,7 @@#include "gettext.h" #include "hex.h" #include "run-command.h" +#include "trace.h" #include "wrapper.h" #include "write-or-die.h"
preload-index.c +1 -0
@@ -11,6 +11,7 @@#include "progress.h" #include "thread-utils.h" #include "repository.h" +#include "trace2.h" /* * Mostly randomly chosen maximum thread counts: we
progress.c +1 -0
@@ -13,6 +13,7 @@#include "progress.h" #include "strbuf.h" #include "trace.h" +#include "trace2.h" #include "utf8.h" #include "config.h"
promisor-remote.c +1 -0
@@ -4,6 +4,7 @@#include "object-store.h" #include "promisor-remote.h" #include "config.h" +#include "trace2.h" #include "transport.h" #include "strvec.h" #include "packfile.h"
protocol.c +1 -0
@@ -2,6 +2,7 @@#include "config.h" #include "environment.h" #include "protocol.h" +#include "trace2.h" static enum protocol_version parse_protocol_version (const char *value) {
read-cache.c +1 -0
@@ -23,6 +23,7 @@#include "resolve-undo.h" #include "run-command.h" #include "strbuf.h" +#include "trace2.h" #include "varint.h" #include "split-index.h" #include "utf8.h"
remote-curl.c +1 -0
@@ -21,6 +21,7 @@#include "setup.h" #include "protocol.h" #include "quote.h" +#include "trace2.h" #include "transport.h" #include "write-or-die.h"
repository.c +1 -0
@@ -14,6 +14,7 @@#include "setup.h" #include "submodule-config.h" #include "sparse-index.h" +#include "trace2.h" #include "promisor-remote.h" /* The main repository */
revision.c +1 -0
@@ -31,6 +31,7 @@#include "worktree.h" #include "setup.h" #include "strvec.h" +#include "trace2.h" #include "commit-reach.h" #include "commit-graph.h" #include "prio-queue.h"
run-command.c +2 -0
@@ -8,6 +8,8 @@#include "thread-utils.h" #include "strbuf.h" #include "string-list.h" +#include "trace.h" +#include "trace2.h" #include "quote.h" #include "config.h" #include "packfile.h"
scalar.c +1 -0
@@ -16,6 +16,7 @@#include "packfile.h" #include "help.h" #include "setup.h" +#include "trace2.h" static void setup_enlistment_directory(int argc, const char **argv, const char * const *usagestr,
setup.c +1 -0
@@ -10,6 +10,7 @@#include "chdir-notify.h" #include "promisor-remote.h" #include "quote.h" +#include "trace2.h" static int inside_git_dir =-1 ;static int inside_work_tree =-1 ;
shallow.c +1 -0
@@ -17,6 +17,7 @@#include "list-objects.h" #include "commit-reach.h" #include "shallow.h" +#include "trace.h" #include "wrapper.h" void set_alternate_shallow_file (struct repository *r,const char *path,int override)
submodule.c +1 -0
@@ -28,6 +28,7 @@#include "commit-reach.h" #include "setup.h" #include "shallow.h" +#include "trace2.h" static int config_update_recurse_submodules =RECURSE_SUBMODULES_OFF ;static int initialized_fetch_ref_tips;
t/helper/test-date.c +1 -0
@@ -1,6 +1,7 @@#include "test-tool.h" #include "cache.h" #include "date.h" +#include "trace.h" static const char *usage_msg ="\n" " test-tool date relative [time_t]...\n"
t/helper/test-lazy-init-name-hash.c +1 -0
@@ -4,6 +4,7 @@#include "environment.h" #include "parse-options.h" #include "setup.h" +#include "trace.h" static int single;static int multi;
t/helper/test-path-utils.c +1 -0
@@ -4,6 +4,7 @@#include "environment.h" #include "setup.h" #include "string-list.h" +#include "trace.h" #include "utf8.h" /*
trace.c +1 -0
@@ -26,6 +26,7 @@#include "environment.h" #include "quote.h" #include "setup.h" +#include "trace.h" #include "wrapper.h" struct trace_key trace_default_key = {"GIT_TRACE" ,0 ,0 ,0 };
trace2.c +1 -0
@@ -7,6 +7,7 @@#include "thread-utils.h" #include "version.h" #include "trace.h" +#include "trace2.h" #include "trace2/tr2_cfg.h" #include "trace2/tr2_cmd_name.h" #include "trace2/tr2_ctr.h"
transport.c +1 -0
@@ -22,6 +22,7 @@#include "string-list.h" #include "oid-array.h" #include "sigchain.h" +#include "trace2.h" #include "transport-internal.h" #include "protocol.h" #include "object-store.h"
tree-walk.c +1 -0
@@ -5,6 +5,7 @@#include "gettext.h" #include "hex.h" #include "object-store.h" +#include "trace2.h" #include "tree.h" #include "pathspec.h" #include "json-writer.h"
unpack-trees.c +1 -0
@@ -17,6 +17,7 @@#include "sparse-index.h" #include "submodule.h" #include "submodule-config.h" +#include "trace2.h" #include "fsmonitor.h" #include "object-store.h" #include "promisor-remote.h"
upload-pack.c +1 -0
@@ -22,6 +22,7 @@#include "version.h" #include "string-list.h" #include "strvec.h" +#include "trace2.h" #include "prio-queue.h" #include "protocol.h" #include "quote.h"
wrapper.c +1 -0
@@ -5,6 +5,7 @@#include "abspath.h" #include "config.h" #include "gettext.h" +#include "trace2.h" #include "wrapper.h" static intmax_t count_fsync_writeout_only;
wt-status.c +2 -0
@@ -18,6 +18,8 @@#include "column.h" #include "setup.h" #include "strbuf.h" +#include "trace.h" +#include "trace2.h" #include "utf8.h" #include "worktree.h" #include "lockfile.h"
Signature · 1 line
gitgitgadget
PATCH 2/24 treewide: be explicit about dependence on advice.h
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
Dozens of files made use of advice functions, without explicitly including advice.h. This made it more difficult to find which files could remove a dependence on cache.h. Make C files explicitly include advice.h if they are using it.
--- add-patch.c | 1 + branch.c | 1 + builtin/add.c | 1 + builtin/am.c | 1 + builtin/clone.c | 1 + builtin/commit.c | 1 + builtin/fetch.c | 1 + builtin/merge-recursive.c | 1 + builtin/merge.c | 1 + builtin/mv.c | 1 + builtin/pull.c | 1 + builtin/push.c | 1 + builtin/reset.c | 1 + builtin/tag.c | 1 + cache.h | 1 - config.c | 1 + convert.c | 1 + editor.c | 1 + notes-merge.c | 1 + object-name.c | 1 + refs.c | 1 + sequencer.c | 1 + transport.c | 1 + unpack-trees.c | 1 + wt-status.c | 1 + 25 files changed, 24 insertions(+), 1 deletion(-)
add-patch.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "add-interactive.h" +#include "advice.h" #include "alloc.h" #include "environment.h" #include "gettext.h"
branch.c +1 -0
@@ -1,5 +1,6 @@#include "git-compat-util.h" #include "cache.h" +#include "advice.h" #include "config.h" #include "branch.h" #include "environment.h"
builtin/add.c +1 -0
@@ -5,6 +5,7 @@*/ #define USE_THE_INDEX_VARIABLE #include "cache.h" +#include "advice.h" #include "config.h" #include "builtin.h" #include "lockfile.h"
builtin/am.c +1 -0
@@ -6,6 +6,7 @@#define USE_THE_INDEX_VARIABLE #include "cache.h" #include "abspath.h" +#include "advice.h" #include "config.h" #include "builtin.h" #include "environment.h"
builtin/clone.c +1 -0
@@ -11,6 +11,7 @@#define USE_THE_INDEX_VARIABLE #include "builtin.h" #include "abspath.h" +#include "advice.h" #include "config.h" #include "environment.h" #include "gettext.h"
builtin/commit.c +1 -0
@@ -7,6 +7,7 @@#define USE_THE_INDEX_VARIABLE #include "cache.h" +#include "advice.h" #include "config.h" #include "lockfile.h" #include "cache-tree.h"
builtin/fetch.c +1 -0
@@ -2,6 +2,7 @@* "git fetch" */ #include "cache.h" +#include "advice.h" #include "config.h" #include "gettext.h" #include "environment.h"
builtin/merge-recursive.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "builtin.h" +#include "advice.h" #include "commit.h" #include "gettext.h" #include "tag.h"
builtin/merge.c +1 -0
@@ -9,6 +9,7 @@#define USE_THE_INDEX_VARIABLE #include "cache.h" #include "abspath.h" +#include "advice.h" #include "alloc.h" #include "config.h" #include "environment.h"
builtin/mv.c +1 -0
@@ -6,6 +6,7 @@#define USE_THE_INDEX_VARIABLE #include "builtin.h" #include "abspath.h" +#include "advice.h" #include "alloc.h" #include "config.h" #include "environment.h"
builtin/pull.c +1 -0
@@ -7,6 +7,7 @@*/ #define USE_THE_INDEX_VARIABLE #include "cache.h" +#include "advice.h" #include "config.h" #include "builtin.h" #include "gettext.h"
builtin/push.c +1 -0
@@ -2,6 +2,7 @@* "git push" */ #include "cache.h" +#include "advice.h" #include "branch.h" #include "config.h" #include "environment.h"
builtin/reset.c +1 -0
@@ -9,6 +9,7 @@*/ #define USE_THE_INDEX_VARIABLE #include "builtin.h" +#include "advice.h" #include "config.h" #include "environment.h" #include "gettext.h"
builtin/tag.c +1 -0
@@ -7,6 +7,7 @@*/ #include "cache.h" +#include "advice.h" #include "config.h" #include "builtin.h" #include "environment.h"
cache.h +0 -1
@@ -5,7 +5,6 @@#include "strbuf.h" #include "hashmap.h" #include "list.h" -#include "advice.h" #include "gettext.h" #include "convert.h" #include "string-list.h"
config.c +1 -0
@@ -7,6 +7,7 @@*/ #include "cache.h" #include "abspath.h" +#include "advice.h" #include "alloc.h" #include "date.h" #include "branch.h"
convert.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "advice.h" #include "config.h" #include "gettext.h" #include "hex.h"
editor.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "abspath.h" +#include "advice.h" #include "config.h" #include "environment.h" #include "gettext.h"
notes-merge.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "advice.h" #include "commit.h" #include "gettext.h" #include "refs.h"
object-name.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "advice.h" #include "config.h" #include "environment.h" #include "gettext.h"
refs.c +1 -0
@@ -3,6 +3,7 @@*/ #include "cache.h" +#include "advice.h" #include "alloc.h" #include "config.h" #include "environment.h"
sequencer.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "abspath.h" +#include "advice.h" #include "alloc.h" #include "config.h" #include "environment.h"
transport.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "advice.h" #include "alloc.h" #include "config.h" #include "environment.h"
unpack-trees.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "advice.h" #include "strvec.h" #include "repository.h" #include "config.h"
wt-status.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "advice.h" #include "wt-status.h" #include "object.h" #include "dir.h"
Signature · 1 line
gitgitgadget
PATCH 4/24 treewide: be explicit about dependence on pack-revindex.h
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
--- builtin/index-pack.c | 1 + cache.h | 1 - pack-write.c | 1 + packfile.c | 1 + 4 files changed, 3 insertions(+), 1 deletion(-)
builtin/index-pack.c +1 -0
@@ -17,6 +17,7 @@#include "streaming.h" #include "thread-utils.h" #include "packfile.h" +#include "pack-revindex.h" #include "object-store.h" #include "replace-object.h" #include "promisor-remote.h"
cache.h +0 -1
@@ -7,7 +7,6 @@#include "list.h" #include "gettext.h" #include "string-list.h" -#include "pack-revindex.h" #include "hash.h" #include "path.h" #include "pathspec.h"
pack-write.c +1 -0
@@ -9,6 +9,7 @@#include "pack-mtimes.h" #include "oidmap.h" #include "pack-objects.h" +#include "pack-revindex.h" void reset_pack_idx_option (struct pack_idx_option *opts) {
packfile.c +1 -0
@@ -21,6 +21,7 @@#include "object-store.h" #include "midx.h" #include "commit-graph.h" +#include "pack-revindex.h" #include "promisor-remote.h" #include "wrapper.h"
Signature · 1 line
gitgitgadget
PATCH 5/24 treewide: be explicit about dependence on oid-array.h
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
--- builtin/bisect.c | 1 + builtin/fetch.c | 1 + builtin/index-pack.c | 1 + builtin/log.c | 1 + cache.h | 1 - commit-graph.c | 1 + diff.c | 1 + merge-ort.c | 1 + read-cache.c | 1 + ref-filter.c | 1 + upload-pack.c | 1 + 11 files changed, 10 insertions(+), 1 deletion(-)
builtin/bisect.c +1 -0
@@ -9,6 +9,7 @@#include "dir.h" #include "strvec.h" #include "run-command.h" +#include "oid-array.h" #include "prompt.h" #include "quote.h" #include "revision.h"
builtin/fetch.c +1 -0
@@ -12,6 +12,7 @@#include "refspec.h" #include "object-store.h" #include "oidset.h" +#include "oid-array.h" #include "commit.h" #include "builtin.h" #include "string-list.h"
builtin/index-pack.c +1 -0
@@ -19,6 +19,7 @@#include "packfile.h" #include "pack-revindex.h" #include "object-store.h" +#include "oid-array.h" #include "replace-object.h" #include "promisor-remote.h" #include "setup.h"
builtin/log.c +1 -0
@@ -20,6 +20,7 @@#include "revision.h" #include "log-tree.h" #include "builtin.h" +#include "oid-array.h" #include "tag.h" #include "reflog-walk.h" #include "patch-ids.h"
cache.h +0 -1
@@ -11,7 +11,6 @@#include "path.h" #include "pathspec.h" #include "object.h" -#include "oid-array.h" #include "repository.h" #include "statinfo.h" #include "mem-pool.h"
commit-graph.c +1 -0
@@ -12,6 +12,7 @@#include "hash-lookup.h" #include "commit-graph.h" #include "object-store.h" +#include "oid-array.h" #include "alloc.h" #include "hashmap.h" #include "replace-object.h"
diff.c +1 -0
@@ -29,6 +29,7 @@#include "string-list.h" #include "strvec.h" #include "graph.h" +#include "oid-array.h" #include "packfile.h" #include "parse-options.h" #include "help.h"
merge-ort.c +1 -0
@@ -32,6 +32,7 @@#include "entry.h" #include "ll-merge.h" #include "object-store.h" +#include "oid-array.h" #include "promisor-remote.h" #include "revision.h" #include "strmap.h"
read-cache.c +1 -0
@@ -15,6 +15,7 @@#include "refs.h" #include "dir.h" #include "object-store.h" +#include "oid-array.h" #include "tree.h" #include "commit.h" #include "blob.h"
ref-filter.c +1 -0
@@ -7,6 +7,7 @@#include "refs.h" #include "wildmatch.h" #include "object-store.h" +#include "oid-array.h" #include "repository.h" #include "commit.h" #include "remote.h"
upload-pack.c +1 -0
@@ -8,6 +8,7 @@#include "sideband.h" #include "repository.h" #include "object-store.h" +#include "oid-array.h" #include "tag.h" #include "object.h" #include "commit.h"
Signature · 1 line
gitgitgadget
PATCH 6/24 treewide: be explicit about dependence on mem-pool.h
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
--- builtin/checkout.c | 1 + cache.h | 1 - merge-ort.c | 1 + read-cache.c | 1 + split-index.c | 1 + t/helper/test-mergesort.c | 1 + 6 files changed, 5 insertions(+), 1 deletion(-)
builtin/checkout.c +1 -0
@@ -15,6 +15,7 @@#include "hook.h" #include "ll-merge.h" #include "lockfile.h" +#include "mem-pool.h" #include "merge-recursive.h" #include "object-store.h" #include "parse-options.h"
cache.h +0 -1
@@ -13,7 +13,6 @@#include "object.h" #include "repository.h" #include "statinfo.h" -#include "mem-pool.h" typedef struct git_zstream { z_stream z;
merge-ort.c +1 -0
@@ -31,6 +31,7 @@#include "hex.h" #include "entry.h" #include "ll-merge.h" +#include "mem-pool.h" #include "object-store.h" #include "oid-array.h" #include "promisor-remote.h"
read-cache.c +1 -0
@@ -21,6 +21,7 @@#include "blob.h" #include "environment.h" #include "gettext.h" +#include "mem-pool.h" #include "resolve-undo.h" #include "run-command.h" #include "strbuf.h"
split-index.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "alloc.h" #include "gettext.h" +#include "mem-pool.h" #include "split-index.h" #include "ewah/ewok.h"
t/helper/test-mergesort.c +1 -0
@@ -1,5 +1,6 @@#include "test-tool.h" #include "cache.h" +#include "mem-pool.h" #include "mergesort.h" static uint32_t minstd_rand (uint32_t *state)
Signature · 1 line
gitgitgadget
PATCH 10/24 git-zlib: move declarations for git-zlib functions from cache.h
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
Move functions from cache.h for zlib.c into a new header file. Since adding a "zlib.h" would cause issues with the real zlib, rename zlib.c to git-zlib.c while we are at it.
--- Makefile | 2 +- archive-tar.c | 1 + archive-zip.c | 1 + builtin/unpack-objects.c | 1 + cache.h | 25 +------------------------ zlib.c => git-zlib.c | 3 ++- git-zlib.h | 28 ++++++++++++++++++++++++++++ http-backend.c | 1 + http.h | 3 +++ 9 files changed, 39 insertions(+), 26 deletions(-) rename zlib.c => git-zlib.c (99%) create mode 100644 git-zlib.h
Makefile +1 -1
@@ -1036,6 +1036,7 @@ LIB_OBJS += fsmonitor.o LIB_OBJS += fsmonitor-ipc.o LIB_OBJS += fsmonitor-settings.o LIB_OBJS += gettext.o +LIB_OBJS += git-zlib.o LIB_OBJS += gpg-interface.o LIB_OBJS += graph.o LIB_OBJS += grep.o
@@ -1196,7 +1197,6 @@ LIB_OBJS += write-or-die.o LIB_OBJS += ws.o LIB_OBJS += wt-status.o LIB_OBJS += xdiff-interface.o -LIB_OBJS += zlib.o BUILTIN_OBJS += builtin/add.o BUILTIN_OBJS += builtin/am.o
archive-tar.c +1 -0
@@ -5,6 +5,7 @@#include "alloc.h" #include "config.h" #include "gettext.h" +#include "git-zlib.h" #include "hex.h" #include "tar.h" #include "archive.h"
archive-zip.c +1 -0
@@ -5,6 +5,7 @@#include "config.h" #include "archive.h" #include "gettext.h" +#include "git-zlib.h" #include "hex.h" #include "streaming.h" #include "utf8.h"
builtin/unpack-objects.c +1 -0
@@ -4,6 +4,7 @@#include "config.h" #include "environment.h" #include "gettext.h" +#include "git-zlib.h" #include "hex.h" #include "object-store.h" #include "object.h"
cache.h +1 -24
@@ -3,6 +3,7 @@#include "git-compat-util.h" #include "strbuf.h" +#include "git-zlib.h" #include "hashmap.h" #include "list.h" #include "gettext.h"
@@ -14,30 +15,6 @@#include "repository.h" #include "statinfo.h" -typedef struct git_zstream { -z_stream z; -unsigned long avail_in; -unsigned long avail_out; -unsigned long total_in; -unsigned long total_out; -unsigned char *next_in; -unsigned char *next_out; -}git_zstream ; - -void git_inflate_init (git_zstream *); -void git_inflate_init_gzip_only (git_zstream *); -void git_inflate_end (git_zstream *); -int git_inflate (git_zstream *,int flush); - -void git_deflate_init (git_zstream *,int level); -void git_deflate_init_gzip (git_zstream *,int level); -void git_deflate_init_raw (git_zstream *,int level); -void git_deflate_end (git_zstream *); -int git_deflate_abort (git_zstream *); -int git_deflate_end_gently (git_zstream *); -int git_deflate (git_zstream *,int flush); -unsigned long git_deflate_bound (git_zstream *,unsigned long ); -#if defined(DT_UNKNOWN ) && !defined(NO_D_TYPE_IN_DIRENT )#define DTYPE (de) ((de)->d_type)#else
git-zlib.c renamed from zlib.c +2 -1
@@ -2,7 +2,8 @@* zlib wrappers to make sure we don't silently miss errors * at init time. */ -#include "cache.h" +#include "git-compat-util.h" +#include "git-zlib.h" static const char *zerr_to_string (int status) {
git-zlib.h new file +28 -0
@@ -0,0 +1,28 @@ +#ifndef GIT_ZLIB_H +#define GIT_ZLIB_H + +typedef struct git_zstream { +z_stream z; +unsigned long avail_in; +unsigned long avail_out; +unsigned long total_in; +unsigned long total_out; +unsigned char *next_in; +unsigned char *next_out; +}git_zstream ; + +void git_inflate_init (git_zstream *); +void git_inflate_init_gzip_only (git_zstream *); +void git_inflate_end (git_zstream *); +int git_inflate (git_zstream *,int flush); + +void git_deflate_init (git_zstream *,int level); +void git_deflate_init_gzip (git_zstream *,int level); +void git_deflate_init_raw (git_zstream *,int level); +void git_deflate_end (git_zstream *); +int git_deflate_abort (git_zstream *); +int git_deflate_end_gently (git_zstream *); +int git_deflate (git_zstream *,int flush); +unsigned long git_deflate_bound (git_zstream *,unsigned long ); + +#endif /* GIT_ZLIB_H */
http-backend.c +1 -0
@@ -2,6 +2,7 @@#include "alloc.h" #include "config.h" #include "environment.h" +#include "git-zlib.h" #include "hex.h" #include "repository.h" #include "refs.h"
http.h +3 -0
@@ -1,7 +1,10 @@#ifndef HTTP_H #define HTTP_H +struct packed_git ; +#include "cache.h" +#include "git-zlib.h" #include <curl/curl.h> #include <curl/easy.h>
Signature · 1 line
gitgitgadget
PATCH 7/24 treewide: remove unnecessary cache.h inclusion
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
Several files were including cache.h solely to get other headers, such as trace.h and trace2.h. Since the last few commits have modified files to make these dependencies more explicit, the inclusion of cache.h is no longer needed in several cases. Remove it.
--- compat/simple-ipc/ipc-unix-socket.c | 2 +- connect.c | 2 +- fetch-pack.c | 2 +- pack-write.c | 2 +- promisor-remote.c | 2 +- protocol.c | 2 +- scalar.c | 2 +- t/helper/test-date.c | 1 - trace.c | 2 +- upload-pack.c | 2 +- 10 files changed, 9 insertions(+), 10 deletions(-)
compat/simple-ipc/ipc-unix-socket.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "gettext.h" #include "simple-ipc.h" #include "strbuf.h"
connect.c +1 -1
@@ -1,5 +1,5 @@#include "git-compat-util.h" -#include "cache.h" +#include "git-compat-util.h" #include "config.h" #include "environment.h" #include "gettext.h"
fetch-pack.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "alloc.h" #include "repository.h" #include "config.h"
pack-write.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "environment.h" #include "gettext.h" #include "hex.h"
promisor-remote.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "gettext.h" #include "hex.h" #include "object-store.h"
protocol.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "config.h" #include "environment.h" #include "protocol.h"
scalar.c +1 -1
@@ -2,7 +2,7 @@* The Scalar command-line interface. */ -#include "cache.h" +#include "git-compat-util.h" #include "abspath.h" #include "gettext.h" #include "parse-options.h"
t/helper/test-date.c +0 -1
@@ -1,5 +1,4 @@#include "test-tool.h" -#include "cache.h" #include "date.h" #include "trace.h"
trace.c +1 -1
@@ -21,7 +21,7 @@* along with this program; if not, see <http://www.gnu.org/licenses/>. */ -#include "cache.h" +#include "git-compat-util.h" #include "abspath.h" #include "environment.h" #include "quote.h"
upload-pack.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "config.h" #include "environment.h" #include "gettext.h"
Signature · 1 line
gitgitgadget
PATCH 9/24 treewide: remove cache.h inclusion due to object-name.h changes
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
--- branch.c | 2 +- checkout.c | 3 ++- fmt-merge-msg.c | 2 +- mailmap.c | 2 +- notes.c | 2 +- refs.c | 2 +- remote.c | 2 +- setup.c | 2 +- strbuf.c | 2 +- t/helper/test-oidmap.c | 1 - t/helper/test-reach.c | 1 - t/helper/test-submodule-config.c | 1 - transport-helper.c | 2 +- 13 files changed, 11 insertions(+), 13 deletions(-)
branch.c +1 -1
@@ -1,5 +1,5 @@#include "git-compat-util.h" -#include "cache.h" +#include "git-compat-util.h" #include "advice.h" #include "config.h" #include "branch.h"
checkout.c +2 -1
@@ -1,9 +1,10 @@ -#include "cache.h" +#include "git-compat-util.h" #include "object-name.h" #include "remote.h" #include "refspec.h" #include "checkout.h" #include "config.h" +#include "strbuf.h" struct tracking_name_data {/* const */ char *src_ref;
fmt-merge-msg.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "alloc.h" #include "config.h" #include "environment.h"
mailmap.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "environment.h" #include "string-list.h" #include "mailmap.h"
notes.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "config.h" #include "environment.h" #include "hex.h"
refs.c +1 -1
@@ -2,7 +2,7 @@* The backend-independent part of the reference module. */ -#include "cache.h" +#include "git-compat-util.h" #include "advice.h" #include "alloc.h" #include "config.h"
remote.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "abspath.h" #include "alloc.h" #include "config.h"
setup.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "abspath.h" #include "environment.h" #include "gettext.h"
strbuf.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "abspath.h" #include "alloc.h" #include "environment.h"
t/helper/test-oidmap.c +0 -1
@@ -1,5 +1,4 @@#include "test-tool.h" -#include "cache.h" #include "hex.h" #include "object-name.h" #include "oidmap.h"
t/helper/test-reach.c +0 -1
@@ -1,5 +1,4 @@#include "test-tool.h" -#include "cache.h" #include "alloc.h" #include "commit.h" #include "commit-reach.h"
t/helper/test-submodule-config.c +0 -1
@@ -1,5 +1,4 @@#include "test-tool.h" -#include "cache.h" #include "config.h" #include "object-name.h" #include "setup.h"
transport-helper.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "transport.h" #include "quote.h" #include "run-command.h"
Signature · 1 line
gitgitgadget
PATCH 11/24 treewide: remove cache.h inclusion due to git-zlib changes
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
This actually only affects http-backend.c, but the git-zlib changes are going to be instrumental in pulling out an object-file.h which will help with several more files.
--- http-backend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
http-backend.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "alloc.h" #include "config.h" #include "environment.h"
Signature · 1 line
gitgitgadget
PATCH 13/24 treewide: remove cache.h inclusion due to object-file.h changes
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
--- bulk-checkin.c | 2 +- commit-graph.c | 2 +- http-fetch.c | 2 +- http-walker.c | 2 +- http.h | 1 - notes-merge.c | 2 +- pack-bitmap.c | 2 +- pack-check.c | 2 +- pack-mtimes.c | 2 +- pack-revindex.c | 2 +- streaming.c | 2 +- tmp-objdir.c | 2 +- 12 files changed, 11 insertions(+), 12 deletions(-)
bulk-checkin.c +1 -1
@@ -1,7 +1,7 @@/* * Copyright (c) 2011, Google Inc. */ -#include "cache.h" +#include "git-compat-util.h" #include "alloc.h" #include "bulk-checkin.h" #include "environment.h"
commit-graph.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "config.h" #include "gettext.h" #include "hex.h"
http-fetch.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "config.h" #include "exec-cmd.h" #include "gettext.h"
http-walker.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "repository.h" #include "commit.h" #include "hex.h"
http.h +0 -1
@@ -3,7 +3,6 @@struct packed_git ; -#include "cache.h" #include "git-zlib.h" #include <curl/curl.h>
notes-merge.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "advice.h" #include "commit.h" #include "gettext.h"
pack-bitmap.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "alloc.h" #include "commit.h" #include "gettext.h"
pack-check.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "environment.h" #include "hex.h" #include "repository.h"
pack-mtimes.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "gettext.h" #include "pack-mtimes.h" #include "object-file.h"
pack-revindex.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "gettext.h" #include "pack-revindex.h" #include "object-file.h"
streaming.c +1 -1
@@ -1,7 +1,7 @@/* * Copyright (c) 2011, Google Inc. */ -#include "cache.h" +#include "git-compat-util.h" #include "convert.h" #include "environment.h" #include "streaming.h"
tmp-objdir.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "tmp-objdir.h" #include "abspath.h" #include "chdir-notify.h"
Signature · 1 line
gitgitgadget
PATCH 8/24 object-name.h: move declarations for object-name.c functions from cache.h
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
--- add-patch.c | 1 + apply.c | 1 + archive.h | 1 + branch.c | 1 + builtin/am.c | 1 + builtin/bisect.c | 1 + builtin/blame.c | 1 + builtin/branch.c | 1 + builtin/cat-file.c | 1 + builtin/check-attr.c | 1 + builtin/checkout.c | 1 + builtin/commit-tree.c | 1 + builtin/commit.c | 1 + builtin/describe.c | 1 + builtin/fast-import.c | 1 + builtin/fetch.c | 1 + builtin/fsck.c | 1 + builtin/grep.c | 1 + builtin/log.c | 1 + builtin/ls-files.c | 1 + builtin/ls-tree.c | 1 + builtin/merge-base.c | 1 + builtin/merge-recursive.c | 1 + builtin/merge-tree.c | 1 + builtin/merge.c | 1 + builtin/name-rev.c | 1 + builtin/notes.c | 1 + builtin/prune.c | 1 + builtin/pull.c | 1 + builtin/range-diff.c | 1 + builtin/read-tree.c | 1 + builtin/rebase.c | 1 + builtin/receive-pack.c | 1 + builtin/replace.c | 1 + builtin/reset.c | 1 + builtin/rev-list.c | 1 + builtin/rev-parse.c | 1 + builtin/rm.c | 1 + builtin/show-branch.c | 1 + builtin/show-ref.c | 1 + builtin/sparse-checkout.c | 1 + builtin/stash.c | 1 + builtin/submodule--helper.c | 1 + builtin/tag.c | 1 + builtin/unpack-file.c | 1 + builtin/update-ref.c | 1 + builtin/verify-commit.c | 1 + builtin/verify-tag.c | 1 + builtin/worktree.c | 1 + cache.h | 88 ---------------------------- checkout.c | 1 + combine-diff.c | 1 + commit.c | 1 + config.c | 1 + diff-lib.c | 1 + diff.c | 1 + fmt-merge-msg.c | 1 + list-objects-filter.c | 1 + log-tree.c | 1 + mailmap.c | 1 + merge-ort.c | 1 + notes-merge.c | 1 + notes.c | 1 + object-name.c | 1 + object-name.h | 99 ++++++++++++++++++++++++++++++++ parse-options-cb.c | 1 + range-diff.c | 1 + read-cache.c | 1 + rebase-interactive.c | 1 + ref-filter.c | 1 + refs.c | 1 + remote.c | 1 + reset.c | 1 + revision.c | 1 + sequencer.c | 1 + setup.c | 1 + strbuf.c | 1 + submodule-config.c | 1 + submodule.c | 1 + t/helper/test-fast-rebase.c | 1 + t/helper/test-match-trees.c | 1 + t/helper/test-oidmap.c | 1 + t/helper/test-reach.c | 1 + t/helper/test-submodule-config.c | 1 + tag.c | 1 + transport-helper.c | 1 + transport.c | 1 + tree.c | 1 + wt-status.c | 1 + 89 files changed, 186 insertions(+), 88 deletions(-) create mode 100644 object-name.h
add-patch.c +1 -0
@@ -4,6 +4,7 @@#include "alloc.h" #include "environment.h" #include "gettext.h" +#include "object-name.h" #include "strbuf.h" #include "run-command.h" #include "strvec.h"
apply.c +1 -0
@@ -22,6 +22,7 @@#include "xdiff-interface.h" #include "ll-merge.h" #include "lockfile.h" +#include "object-name.h" #include "parse-options.h" #include "quote.h" #include "rerere.h"
archive.h +1 -0
@@ -2,6 +2,7 @@#define ARCHIVE_H #include "cache.h" +#include "object-name.h" #include "pathspec.h" struct repository ;
branch.c +1 -0
@@ -6,6 +6,7 @@#include "environment.h" #include "gettext.h" #include "hex.h" +#include "object-name.h" #include "refs.h" #include "refspec.h" #include "remote.h"
builtin/am.c +1 -0
@@ -27,6 +27,7 @@#include "diffcore.h" #include "unpack-trees.h" #include "branch.h" +#include "object-name.h" #include "sequencer.h" #include "revision.h" #include "merge-recursive.h"
builtin/bisect.c +1 -0
@@ -3,6 +3,7 @@#include "environment.h" #include "gettext.h" #include "hex.h" +#include "object-name.h" #include "parse-options.h" #include "bisect.h" #include "refs.h"
builtin/blame.c +1 -0
@@ -28,6 +28,7 @@#include "line-log.h" #include "dir.h" #include "progress.h" +#include "object-name.h" #include "object-store.h" #include "blame.h" #include "refs.h"
builtin/branch.c +1 -0
@@ -13,6 +13,7 @@#include "commit.h" #include "builtin.h" #include "gettext.h" +#include "object-name.h" #include "remote.h" #include "parse-options.h" #include "branch.h"
builtin/cat-file.c +1 -0
@@ -20,6 +20,7 @@#include "tree-walk.h" #include "oid-array.h" #include "packfile.h" +#include "object-name.h" #include "object-store.h" #include "replace-object.h" #include "promisor-remote.h"
builtin/check-attr.c +1 -0
@@ -5,6 +5,7 @@#include "attr.h" #include "environment.h" #include "gettext.h" +#include "object-name.h" #include "quote.h" #include "setup.h" #include "parse-options.h"
builtin/checkout.c +1 -0
@@ -17,6 +17,7 @@#include "lockfile.h" #include "mem-pool.h" #include "merge-recursive.h" +#include "object-name.h" #include "object-store.h" #include "parse-options.h" #include "refs.h"
builtin/commit-tree.c +1 -0
@@ -7,6 +7,7 @@#include "config.h" #include "gettext.h" #include "hex.h" +#include "object-name.h" #include "object-store.h" #include "repository.h" #include "commit.h"
builtin/commit.c +1 -0
@@ -27,6 +27,7 @@#include "log-tree.h" #include "strbuf.h" #include "utf8.h" +#include "object-name.h" #include "parse-options.h" #include "string-list.h" #include "rerere.h"
builtin/describe.c +1 -0
@@ -11,6 +11,7 @@#include "refs.h" #include "builtin.h" #include "exec-cmd.h" +#include "object-name.h" #include "parse-options.h" #include "revision.h" #include "diff.h"
builtin/fast-import.c +1 -0
@@ -19,6 +19,7 @@#include "dir.h" #include "run-command.h" #include "packfile.h" +#include "object-name.h" #include "object-store.h" #include "mem-pool.h" #include "commit-reach.h"
builtin/fetch.c +1 -0
@@ -10,6 +10,7 @@#include "repository.h" #include "refs.h" #include "refspec.h" +#include "object-name.h" #include "object-store.h" #include "oidset.h" #include "oid-array.h"
builtin/fsck.c +1 -0
@@ -19,6 +19,7 @@#include "streaming.h" #include "decorate.h" #include "packfile.h" +#include "object-name.h" #include "object-store.h" #include "replace-object.h" #include "resolve-undo.h"
builtin/grep.c +1 -0
@@ -26,6 +26,7 @@#include "setup.h" #include "submodule.h" #include "submodule-config.h" +#include "object-name.h" #include "object-store.h" #include "packfile.h" #include "write-or-die.h"
builtin/log.c +1 -0
@@ -12,6 +12,7 @@#include "gettext.h" #include "hex.h" #include "refs.h" +#include "object-name.h" #include "object-store.h" #include "color.h" #include "commit.h"
builtin/ls-files.c +1 -0
@@ -13,6 +13,7 @@#include "dir.h" #include "builtin.h" #include "gettext.h" +#include "object-name.h" #include "strbuf.h" #include "tree.h" #include "cache-tree.h"
builtin/ls-tree.c +1 -0
@@ -7,6 +7,7 @@#include "config.h" #include "gettext.h" #include "hex.h" +#include "object-name.h" #include "object-store.h" #include "blob.h" #include "tree.h"
builtin/merge-base.c +1 -0
@@ -7,6 +7,7 @@#include "refs.h" #include "diff.h" #include "revision.h" +#include "object-name.h" #include "parse-options.h" #include "repository.h" #include "commit-reach.h"
builtin/merge-recursive.c +1 -0
@@ -5,6 +5,7 @@#include "gettext.h" #include "tag.h" #include "merge-recursive.h" +#include "object-name.h" #include "xdiff-interface.h" static const char builtin_merge_recursive_usage[] =
builtin/merge-tree.c +1 -0
@@ -8,6 +8,7 @@#include "commit.h" #include "commit-reach.h" #include "merge-ort.h" +#include "object-name.h" #include "object-store.h" #include "parse-options.h" #include "repository.h"
builtin/merge.c +1 -0
@@ -15,6 +15,7 @@#include "environment.h" #include "gettext.h" #include "hex.h" +#include "object-name.h" #include "parse-options.h" #include "builtin.h" #include "lockfile.h"
builtin/name-rev.c +1 -0
@@ -8,6 +8,7 @@#include "commit.h" #include "tag.h" #include "refs.h" +#include "object-name.h" #include "parse-options.h" #include "prio-queue.h" #include "hash-lookup.h"
builtin/notes.c +1 -0
@@ -13,6 +13,7 @@#include "gettext.h" #include "hex.h" #include "notes.h" +#include "object-name.h" #include "object-store.h" #include "repository.h" #include "blob.h"
builtin/prune.c +1 -0
@@ -11,6 +11,7 @@#include "progress.h" #include "prune-packed.h" #include "replace-object.h" +#include "object-name.h" #include "object-store.h" #include "shallow.h"
builtin/pull.c +1 -0
@@ -12,6 +12,7 @@#include "builtin.h" #include "gettext.h" #include "hex.h" +#include "object-name.h" #include "parse-options.h" #include "exec-cmd.h" #include "run-command.h"
builtin/range-diff.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "builtin.h" #include "gettext.h" +#include "object-name.h" #include "parse-options.h" #include "range-diff.h" #include "config.h"
builtin/read-tree.c +1 -0
@@ -11,6 +11,7 @@#include "hex.h" #include "lockfile.h" #include "object.h" +#include "object-name.h" #include "tree.h" #include "tree-walk.h" #include "cache-tree.h"
builtin/rebase.c +1 -0
@@ -21,6 +21,7 @@#include "cache-tree.h" #include "unpack-trees.h" #include "lockfile.h" +#include "object-name.h" #include "parse-options.h" #include "commit.h" #include "diff.h"
builtin/receive-pack.c +1 -0
@@ -29,6 +29,7 @@#include "tmp-objdir.h" #include "oidset.h" #include "packfile.h" +#include "object-name.h" #include "object-store.h" #include "protocol.h" #include "commit-reach.h"
builtin/replace.c +1 -0
@@ -17,6 +17,7 @@#include "refs.h" #include "parse-options.h" #include "run-command.h" +#include "object-name.h" #include "object-store.h" #include "replace-object.h" #include "repository.h"
builtin/reset.c +1 -0
@@ -24,6 +24,7 @@#include "diffcore.h" #include "tree.h" #include "branch.h" +#include "object-name.h" #include "parse-options.h" #include "unpack-trees.h" #include "cache-tree.h"
builtin/rev-list.c +1 -0
@@ -10,6 +10,7 @@#include "list-objects-filter.h" #include "list-objects-filter-options.h" #include "object.h" +#include "object-name.h" #include "object-store.h" #include "pack.h" #include "pack-bitmap.h"
builtin/rev-parse.c +1 -0
@@ -15,6 +15,7 @@#include "refs.h" #include "quote.h" #include "builtin.h" +#include "object-name.h" #include "parse-options.h" #include "diff.h" #include "revision.h"
builtin/rm.c +1 -0
@@ -13,6 +13,7 @@#include "cache-tree.h" #include "gettext.h" #include "tree-walk.h" +#include "object-name.h" #include "parse-options.h" #include "string-list.h" #include "setup.h"
builtin/show-branch.c +1 -0
@@ -8,6 +8,7 @@#include "builtin.h" #include "color.h" #include "strvec.h" +#include "object-name.h" #include "parse-options.h" #include "dir.h" #include "commit-slab.h"
builtin/show-ref.c +1 -0
@@ -4,6 +4,7 @@#include "gettext.h" #include "hex.h" #include "refs.h" +#include "object-name.h" #include "object-store.h" #include "object.h" #include "tag.h"
builtin/sparse-checkout.c +1 -0
@@ -4,6 +4,7 @@#include "dir.h" #include "environment.h" #include "gettext.h" +#include "object-name.h" #include "parse-options.h" #include "pathspec.h" #include "repository.h"
builtin/stash.c +1 -0
@@ -5,6 +5,7 @@#include "environment.h" #include "gettext.h" #include "hex.h" +#include "object-name.h" #include "parse-options.h" #include "refs.h" #include "lockfile.h"
builtin/submodule--helper.c +1 -0
@@ -24,6 +24,7 @@#include "revision.h" #include "diffcore.h" #include "diff.h" +#include "object-name.h" #include "object-store.h" #include "advice.h" #include "branch.h"
builtin/tag.c +1 -0
@@ -14,6 +14,7 @@#include "gettext.h" #include "hex.h" #include "refs.h" +#include "object-name.h" #include "object-store.h" #include "tag.h" #include "run-command.h"
builtin/unpack-file.c +1 -0
@@ -1,6 +1,7 @@#include "builtin.h" #include "config.h" #include "hex.h" +#include "object-name.h" #include "object-store.h" #include "wrapper.h"
builtin/update-ref.c +1 -0
@@ -3,6 +3,7 @@#include "gettext.h" #include "refs.h" #include "builtin.h" +#include "object-name.h" #include "parse-options.h" #include "quote.h" #include "strvec.h"
builtin/verify-commit.c +1 -0
@@ -9,6 +9,7 @@#include "config.h" #include "builtin.h" #include "gettext.h" +#include "object-name.h" #include "object-store.h" #include "repository.h" #include "commit.h"
builtin/verify-tag.c +1 -0
@@ -11,6 +11,7 @@#include "gettext.h" #include "tag.h" #include "run-command.h" +#include "object-name.h" #include "parse-options.h" #include "gpg-interface.h" #include "ref-filter.h"
builtin/worktree.c +1 -0
@@ -7,6 +7,7 @@#include "environment.h" #include "gettext.h" #include "hex.h" +#include "object-name.h" #include "parse-options.h" #include "strvec.h" #include "branch.h"
cache.h +0 -88
106 lines not on this page · raw message
checkout.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "object-name.h" #include "remote.h" #include "refspec.h" #include "checkout.h"
combine-diff.c +1 -0
@@ -7,6 +7,7 @@#include "diffcore.h" #include "environment.h" #include "hex.h" +#include "object-name.h" #include "quote.h" #include "xdiff-interface.h" #include "xdiff/xmacros.h"
commit.c +1 -0
@@ -6,6 +6,7 @@#include "gettext.h" #include "hex.h" #include "repository.h" +#include "object-name.h" #include "object-store.h" #include "pkt-line.h" #include "utf8.h"
config.c +1 -0
@@ -23,6 +23,7 @@#include "quote.h" #include "hashmap.h" #include "string-list.h" +#include "object-name.h" #include "object-store.h" #include "utf8.h" #include "dir.h"
diff-lib.c +1 -0
@@ -8,6 +8,7 @@#include "diffcore.h" #include "gettext.h" #include "hex.h" +#include "object-name.h" #include "revision.h" #include "cache-tree.h" #include "unpack-trees.h"
diff.c +1 -0
@@ -35,6 +35,7 @@#include "help.h" #include "promisor-remote.h" #include "dir.h" +#include "object-name.h" #include "setup.h" #include "strmap.h" #include "wrapper.h"
fmt-merge-msg.c +1 -0
@@ -3,6 +3,7 @@#include "config.h" #include "environment.h" #include "refs.h" +#include "object-name.h" #include "object-store.h" #include "diff.h" #include "diff-merges.h"
list-objects-filter.c +1 -0
@@ -15,6 +15,7 @@#include "list-objects-filter-options.h" #include "oidmap.h" #include "oidset.h" +#include "object-name.h" #include "object-store.h" /* Remember to update object flag allocation in object.h */
log-tree.c +1 -0
@@ -4,6 +4,7 @@#include "diff.h" #include "environment.h" #include "hex.h" +#include "object-name.h" #include "object-store.h" #include "repository.h" #include "tmp-objdir.h"
mailmap.c +1 -0
@@ -2,6 +2,7 @@#include "environment.h" #include "string-list.h" #include "mailmap.h" +#include "object-name.h" #include "object-store.h" #include "setup.h"
merge-ort.c +1 -0
@@ -32,6 +32,7 @@#include "entry.h" #include "ll-merge.h" #include "mem-pool.h" +#include "object-name.h" #include "object-store.h" #include "oid-array.h" #include "promisor-remote.h"
notes-merge.c +1 -0
@@ -3,6 +3,7 @@#include "commit.h" #include "gettext.h" #include "refs.h" +#include "object-name.h" #include "object-store.h" #include "repository.h" #include "diff.h"
notes.c +1 -0
@@ -3,6 +3,7 @@#include "environment.h" #include "hex.h" #include "notes.h" +#include "object-name.h" #include "object-store.h" #include "blob.h" #include "tree.h"
object-name.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "object-name.h" #include "advice.h" #include "config.h" #include "environment.h"
object-name.h new file +99 -0
99 lines not on this page · raw message
parse-options-cb.c +1 -0
@@ -6,6 +6,7 @@#include "color.h" #include "environment.h" #include "gettext.h" +#include "object-name.h" #include "string-list.h" #include "strvec.h" #include "oid-array.h"
range-diff.c +1 -0
@@ -2,6 +2,7 @@#include "environment.h" #include "gettext.h" #include "range-diff.h" +#include "object-name.h" #include "string-list.h" #include "run-command.h" #include "strvec.h"
read-cache.c +1 -0
@@ -22,6 +22,7 @@#include "environment.h" #include "gettext.h" #include "mem-pool.h" +#include "object-name.h" #include "resolve-undo.h" #include "run-command.h" #include "strbuf.h"
rebase-interactive.c +1 -0
@@ -8,6 +8,7 @@#include "commit-slab.h" #include "config.h" #include "dir.h" +#include "object-name.h" #include "wrapper.h" static const char edit_todo_list_advice[] =
ref-filter.c +1 -0
@@ -6,6 +6,7 @@#include "parse-options.h" #include "refs.h" #include "wildmatch.h" +#include "object-name.h" #include "object-store.h" #include "oid-array.h" #include "repository.h"
refs.c +1 -0
@@ -16,6 +16,7 @@#include "refs/refs-internal.h" #include "run-command.h" #include "hook.h" +#include "object-name.h" #include "object-store.h" #include "object.h" #include "tag.h"
remote.c +1 -0
@@ -9,6 +9,7 @@#include "urlmatch.h" #include "refs.h" #include "refspec.h" +#include "object-name.h" #include "object-store.h" #include "commit.h" #include "diff.h"
reset.c +1 -0
@@ -3,6 +3,7 @@#include "gettext.h" #include "hex.h" #include "lockfile.h" +#include "object-name.h" #include "refs.h" #include "reset.h" #include "run-command.h"
revision.c +1 -0
@@ -4,6 +4,7 @@#include "environment.h" #include "gettext.h" #include "hex.h" +#include "object-name.h" #include "object-store.h" #include "tag.h" #include "blob.h"
sequencer.c +1 -0
@@ -8,6 +8,7 @@#include "hex.h" #include "lockfile.h" #include "dir.h" +#include "object-name.h" #include "object-store.h" #include "object.h" #include "commit.h"
setup.c +1 -0
@@ -2,6 +2,7 @@#include "abspath.h" #include "environment.h" #include "gettext.h" +#include "object-name.h" #include "repository.h" #include "config.h" #include "dir.h"
strbuf.c +1 -0
@@ -4,6 +4,7 @@#include "environment.h" #include "gettext.h" #include "hex.h" +#include "object-name.h" #include "refs.h" #include "string-list.h" #include "utf8.h"
submodule-config.c +1 -0
@@ -9,6 +9,7 @@#include "submodule-config.h" #include "submodule.h" #include "strbuf.h" +#include "object-name.h" #include "object-store.h" #include "parse-options.h" #include "tree-walk.h"
submodule.c +1 -0
@@ -24,6 +24,7 @@#include "remote.h" #include "worktree.h" #include "parse-options.h" +#include "object-name.h" #include "object-store.h" #include "commit-reach.h" #include "setup.h"
t/helper/test-fast-rebase.c +1 -0
@@ -20,6 +20,7 @@#include "hex.h" #include "lockfile.h" #include "merge-ort.h" +#include "object-name.h" #include "refs.h" #include "revision.h" #include "sequencer.h"
t/helper/test-match-trees.c +1 -0
@@ -1,6 +1,7 @@#include "test-tool.h" #include "cache.h" #include "hex.h" +#include "object-name.h" #include "setup.h" #include "tree.h"
t/helper/test-oidmap.c +1 -0
@@ -1,6 +1,7 @@#include "test-tool.h" #include "cache.h" #include "hex.h" +#include "object-name.h" #include "oidmap.h" #include "setup.h" #include "strbuf.h"
t/helper/test-reach.c +1 -0
@@ -6,6 +6,7 @@#include "config.h" #include "gettext.h" #include "hex.h" +#include "object-name.h" #include "parse-options.h" #include "ref-filter.h" #include "setup.h"
t/helper/test-submodule-config.c +1 -0
@@ -1,6 +1,7 @@#include "test-tool.h" #include "cache.h" #include "config.h" +#include "object-name.h" #include "setup.h" #include "submodule-config.h" #include "submodule.h"
tag.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "environment.h" #include "tag.h" +#include "object-name.h" #include "object-store.h" #include "commit.h" #include "tree.h"
transport-helper.c +1 -0
@@ -7,6 +7,7 @@#include "environment.h" #include "gettext.h" #include "hex.h" +#include "object-name.h" #include "revision.h" #include "remote.h" #include "string-list.h"
transport.c +1 -0
@@ -26,6 +26,7 @@#include "trace2.h" #include "transport-internal.h" #include "protocol.h" +#include "object-name.h" #include "object-store.h" #include "color.h" #include "bundle-uri.h"
tree.c +1 -0
@@ -2,6 +2,7 @@#include "cache-tree.h" #include "hex.h" #include "tree.h" +#include "object-name.h" #include "object-store.h" #include "blob.h" #include "commit.h"
wt-status.c +1 -0
@@ -8,6 +8,7 @@#include "environment.h" #include "gettext.h" #include "hex.h" +#include "object-name.h" #include "revision.h" #include "diffcore.h" #include "quote.h"
Signature · 1 line
gitgitgadget
PATCH 14/24 object.h: move an inline function and some defines from cache.h
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
The object_type() inline function is very tied to the enum object_type declaration within object.h, and just seemed to make more sense to live there. Move it, and as a side-effect, remove a bunch of dependencies on cache.h that are no longer needed.
--- bundle.c | 2 +- cache.h | 21 --------------------- delta-islands.c | 2 +- fsck.c | 2 +- http-push.c | 2 +- list-objects.c | 2 +- object.h | 21 +++++++++++++++++++++ pack-bitmap-write.c | 2 +- submodule-config.c | 2 +- walker.c | 2 +- 10 files changed, 29 insertions(+), 29 deletions(-)
bundle.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "lockfile.h" #include "bundle.h" #include "environment.h"
cache.h +0 -21
@@ -29,18 +29,6 @@#define DTYPE (de) DT_UNKNOWN#endif -/* unknown mode (impossible combination S_IFIFO|S_IFCHR) */ -#define S_IFINVALID 0030000 - -/* -* A "directory link" is a link to another git directory. -* -* The value 0160000 is not normally a valid mode, and -* also just happens to be S_IFDIR + S_IFLNK -*/ -#define S_IFGITLINK 0160000 -#define S_ISGITLINK (m) (((m) & S_IFMT) == S_IFGITLINK) -/* * Some mode bits are also used internally for computations. *
@@ -156,8 +144,6 @@ struct cache_entry {#error "CE_EXTENDED_FLAGS out of range"#endif -#define S_ISSPARSEDIR (m) ((m) == S_IFDIR) -/* Forward structure decls */ struct pathspec ;struct child_process ;
@@ -415,13 +401,6 @@ void prefetch_cache_entries(const struct index_state *istate,extern struct index_state the_index;#endif -static inline enum object_type object_type (unsigned int mode) -{ -return S_ISDIR (mode) ?OBJ_TREE : -S_ISGITLINK (mode) ?OBJ_COMMIT : -OBJ_BLOB ; -} -#define INIT_DB_QUIET 0x0001#define INIT_DB_EXIST_OK 0x0002
delta-islands.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "alloc.h" #include "attr.h" #include "object.h"
fsck.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "alloc.h" #include "hex.h" #include "object-store.h"
http-push.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "environment.h" #include "hex.h" #include "repository.h"
list-objects.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "tag.h" #include "commit.h" #include "gettext.h"
object.h +21 -0
@@ -101,6 +101,27 @@ enum object_type { OBJ_MAX }; +/* unknown mode (impossible combination S_IFIFO|S_IFCHR) */ +#define S_IFINVALID 0030000 + +/* +* A "directory link" is a link to another git directory. +* +* The value 0160000 is not normally a valid mode, and +* also just happens to be S_IFDIR + S_IFLNK +*/ +#define S_IFGITLINK 0160000 +#define S_ISGITLINK (m) (((m) & S_IFMT) == S_IFGITLINK) + +#define S_ISSPARSEDIR (m) ((m) == S_IFDIR) + +static inline enum object_type object_type (unsigned int mode) +{ +return S_ISDIR (mode) ?OBJ_TREE : +S_ISGITLINK (mode) ?OBJ_COMMIT : +OBJ_BLOB ; +} +/* * The object type is stored in 3 bits. */
pack-bitmap-write.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "alloc.h" #include "environment.h" #include "gettext.h"
submodule-config.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "alloc.h" #include "dir.h" #include "environment.h"
walker.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "gettext.h" #include "hex.h" #include "walker.h"
Signature · 1 line
gitgitgadget
PATCH 17/24 pager.h: move declarations for pager.c functions from cache.h
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
--- builtin/am.c | 1 + builtin/blame.c | 1 + builtin/fetch.c | 1 + builtin/grep.c | 1 + builtin/help.c | 1 + builtin/log.c | 1 + builtin/name-rev.c | 1 + builtin/var.c | 1 + cache.h | 12 ------------ color.c | 1 + column.c | 1 + config.c | 1 + date.c | 1 + diff.c | 1 + editor.c | 1 + environment.c | 1 - git.c | 1 + pager.c | 3 +++ pager.h | 17 +++++++++++++++++ pretty.c | 1 + progress.c | 1 + range-diff.c | 1 + sequencer.c | 1 + 23 files changed, 39 insertions(+), 13 deletions(-) create mode 100644 pager.h
builtin/am.c +1 -0
@@ -40,6 +40,7 @@#include "apply.h" #include "string-list.h" #include "packfile.h" +#include "pager.h" #include "repository.h" #include "pretty.h" #include "wrapper.h"
builtin/blame.c +1 -0
@@ -30,6 +30,7 @@#include "progress.h" #include "object-name.h" #include "object-store.h" +#include "pager.h" #include "blame.h" #include "refs.h" #include "setup.h"
builtin/fetch.c +1 -0
@@ -28,6 +28,7 @@#include "strvec.h" #include "utf8.h" #include "packfile.h" +#include "pager.h" #include "list-objects-filter-options.h" #include "commit-reach.h" #include "branch.h"
builtin/grep.c +1 -0
@@ -30,6 +30,7 @@#include "object-name.h" #include "object-store.h" #include "packfile.h" +#include "pager.h" #include "write-or-die.h" static const char *grep_prefix;
builtin/help.c +1 -0
@@ -6,6 +6,7 @@#include "builtin.h" #include "exec-cmd.h" #include "gettext.h" +#include "pager.h" #include "parse-options.h" #include "run-command.h" #include "config-list.h"
builtin/log.c +1 -0
@@ -15,6 +15,7 @@#include "object-file.h" #include "object-name.h" #include "object-store.h" +#include "pager.h" #include "color.h" #include "commit.h" #include "diff.h"
builtin/name-rev.c +1 -0
@@ -9,6 +9,7 @@#include "tag.h" #include "refs.h" #include "object-name.h" +#include "pager.h" #include "parse-options.h" #include "prio-queue.h" #include "hash-lookup.h"
builtin/var.c +1 -0
@@ -7,6 +7,7 @@#include "config.h" #include "editor.h" #include "ident.h" +#include "pager.h" #include "refs.h" static const char var_usage[] ="git var (-l | <variable>)" ;
cache.h +0 -12
@@ -665,8 +665,6 @@ int df_name_compare(const char *name1, size_t len1, int mode1,int name_compare (const char *name1,size_t len1,const char *name2,size_t len2);int cache_name_stage_compare (const char *name1,int len1,int stage1,const char *name2,int len2,int stage2); -const char *git_pager (int stdout_is_tty); -struct cache_def {struct strbuf path;int flags;
@@ -723,16 +721,6 @@ int copy_fd(int ifd, int ofd);int copy_file (const char *dst,const char *src,int mode);int copy_file_with_time (const char *dst,const char *src,int mode); -/* pager.c */ -void setup_pager (void ); -int pager_in_use (void ); -extern int pager_use_color; -int term_columns (void ); -void term_clear_line (void ); -int decimal_width (uintmax_t ); -int check_pager_config (const char *cmd); -void prepare_pager_args (struct child_process *,const char *pager); -/* base85 */ int decode_85 (char *dst,const char *line,int linelen);void encode_85 (char *buf,const unsigned char *data,int bytes);
color.c +1 -0
@@ -4,6 +4,7 @@#include "editor.h" #include "gettext.h" #include "hex.h" +#include "pager.h" static int git_use_color_default =GIT_COLOR_AUTO ;int color_stdout_is_tty =-1 ;
column.c +1 -0
@@ -2,6 +2,7 @@#include "config.h" #include "column.h" #include "string-list.h" +#include "pager.h" #include "parse-options.h" #include "run-command.h" #include "utf8.h"
config.c +1 -0
@@ -25,6 +25,7 @@#include "string-list.h" #include "object-name.h" #include "object-store.h" +#include "pager.h" #include "utf8.h" #include "dir.h" #include "color.h"
date.c +1 -0
@@ -7,6 +7,7 @@#include "cache.h" #include "date.h" #include "gettext.h" +#include "pager.h" /* * This is like mktime, but without normalization of tm_wday and tm_yday.
diff.c +1 -0
@@ -31,6 +31,7 @@#include "graph.h" #include "oid-array.h" #include "packfile.h" +#include "pager.h" #include "parse-options.h" #include "help.h" #include "promisor-remote.h"
editor.c +1 -0
@@ -5,6 +5,7 @@#include "editor.h" #include "environment.h" #include "gettext.h" +#include "pager.h" #include "strbuf.h" #include "strvec.h" #include "run-command.h"
environment.c +0 -1
@@ -59,7 +59,6 @@ size_t packed_git_window_size = DEFAULT_PACKED_GIT_WINDOW_SIZE;size_t packed_git_limit =DEFAULT_PACKED_GIT_LIMIT ;size_t delta_base_cache_limit =96 *1024 *1024 ;unsigned long big_file_threshold =512 *1024 *1024 ; -int pager_use_color =1 ;const char *editor_program;const char *askpass_program;const char *excludes_file;
git.c +1 -0
@@ -4,6 +4,7 @@#include "exec-cmd.h" #include "gettext.h" #include "help.h" +#include "pager.h" #include "run-command.h" #include "alias.h" #include "replace-object.h"
pager.c +3 -0
@@ -1,10 +1,13 @@#include "cache.h" #include "config.h" #include "editor.h" +#include "pager.h" #include "run-command.h" #include "sigchain.h" #include "alias.h" +int pager_use_color =1 ; +#ifndef DEFAULT_PAGER #define DEFAULT_PAGER "less"#endif
pager.h new file +17 -0
@@ -0,0 +1,17 @@ +#ifndef PAGER_H +#define PAGER_H + +struct child_process ; + +const char *git_pager (int stdout_is_tty); +void setup_pager (void ); +int pager_in_use (void ); +int term_columns (void ); +void term_clear_line (void ); +int decimal_width (uintmax_t ); +int check_pager_config (const char *cmd); +void prepare_pager_args (struct child_process *,const char *pager); + +extern int pager_use_color; + +#endif /* PAGER_H */
pretty.c +1 -0
@@ -7,6 +7,7 @@#include "hex.h" #include "utf8.h" #include "diff.h" +#include "pager.h" #include "revision.h" #include "string-list.h" #include "mailmap.h"
progress.c +1 -0
@@ -10,6 +10,7 @@#define GIT_TEST_PROGRESS_ONLY #include "cache.h" +#include "pager.h" #include "progress.h" #include "strbuf.h" #include "trace.h"
range-diff.c +1 -0
@@ -11,6 +11,7 @@#include "linear-assignment.h" #include "diffcore.h" #include "commit.h" +#include "pager.h" #include "pretty.h" #include "userdiff.h" #include "apply.h"
sequencer.c +1 -0
@@ -12,6 +12,7 @@#include "object-name.h" #include "object-store.h" #include "object.h" +#include "pager.h" #include "commit.h" #include "sequencer.h" #include "tag.h"
Signature · 1 line
gitgitgadget
PATCH 12/24 object-file.h: move declarations for object-file.c functions from cache.h
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
--- apply.c | 1 + builtin/bugreport.c | 1 + builtin/cat-file.c | 1 + builtin/clone.c | 1 + builtin/credential-cache--daemon.c | 1 + builtin/diagnose.c | 1 + builtin/difftool.c | 1 + builtin/fast-export.c | 1 + builtin/fast-import.c | 1 + builtin/fsck.c | 1 + builtin/gc.c | 1 + builtin/grep.c | 1 + builtin/hash-object.c | 1 + builtin/index-pack.c | 1 + builtin/init-db.c | 1 + builtin/log.c | 1 + builtin/mktag.c | 1 + builtin/mv.c | 1 + builtin/pack-objects.c | 1 + builtin/rebase.c | 1 + builtin/replace.c | 1 + builtin/sparse-checkout.c | 1 + builtin/submodule--helper.c | 1 + builtin/update-index.c | 1 + builtin/worktree.c | 1 + bulk-checkin.c | 1 + cache-tree.c | 1 + cache.h | 114 --------------------------- commit-graph.c | 1 + diff.c | 1 + dir.c | 1 + environment.c | 1 + http.c | 1 + merge-recursive.c | 1 + midx.c | 1 + notes-merge.c | 1 + object-file.c | 1 + object-file.h | 121 +++++++++++++++++++++++++++++ object.c | 1 + pack-bitmap.c | 1 + pack-check.c | 1 + pack-mtimes.c | 1 + pack-revindex.c | 1 + packfile.c | 1 + read-cache.c | 1 + refs/files-backend.c | 1 + rerere.c | 1 + sequencer.c | 1 + server-info.c | 1 + streaming.c | 1 + submodule.c | 1 + tmp-objdir.c | 1 + tree-walk.c | 1 + 53 files changed, 172 insertions(+), 114 deletions(-) create mode 100644 object-file.h
apply.c +1 -0
@@ -23,6 +23,7 @@#include "ll-merge.h" #include "lockfile.h" #include "object-name.h" +#include "object-file.h" #include "parse-options.h" #include "quote.h" #include "rerere.h"
builtin/bugreport.c +1 -0
@@ -8,6 +8,7 @@#include "hook.h" #include "hook-list.h" #include "diagnose.h" +#include "object-file.h" #include "setup.h" #include "wrapper.h"
builtin/cat-file.c +1 -0
@@ -20,6 +20,7 @@#include "tree-walk.h" #include "oid-array.h" #include "packfile.h" +#include "object-file.h" #include "object-name.h" #include "object-store.h" #include "replace-object.h"
builtin/clone.c +1 -0
@@ -21,6 +21,7 @@#include "fetch-pack.h" #include "refs.h" #include "refspec.h" +#include "object-file.h" #include "object-store.h" #include "tree.h" #include "tree-walk.h"
builtin/credential-cache--daemon.c +1 -0
@@ -2,6 +2,7 @@#include "abspath.h" #include "alloc.h" #include "gettext.h" +#include "object-file.h" #include "parse-options.h" #ifndef NO_UNIX_SOCKETS
builtin/diagnose.c +1 -0
@@ -1,6 +1,7 @@#include "builtin.h" #include "abspath.h" #include "gettext.h" +#include "object-file.h" #include "parse-options.h" #include "diagnose.h"
builtin/difftool.c +1 -0
@@ -25,6 +25,7 @@#include "strvec.h" #include "strbuf.h" #include "lockfile.h" +#include "object-file.h" #include "object-store.h" #include "dir.h" #include "entry.h"
builtin/fast-export.c +1 -0
@@ -10,6 +10,7 @@#include "hex.h" #include "refs.h" #include "refspec.h" +#include "object-file.h" #include "object-store.h" #include "commit.h" #include "object.h"
builtin/fast-import.c +1 -0
@@ -19,6 +19,7 @@#include "dir.h" #include "run-command.h" #include "packfile.h" +#include "object-file.h" #include "object-name.h" #include "object-store.h" #include "mem-pool.h"
builtin/fsck.c +1 -0
@@ -19,6 +19,7 @@#include "streaming.h" #include "decorate.h" #include "packfile.h" +#include "object-file.h" #include "object-name.h" #include "object-store.h" #include "replace-object.h"
builtin/gc.c +1 -0
@@ -25,6 +25,7 @@#include "commit.h" #include "commit-graph.h" #include "packfile.h" +#include "object-file.h" #include "object-store.h" #include "pack.h" #include "pack-objects.h"
builtin/grep.c +1 -0
@@ -26,6 +26,7 @@#include "setup.h" #include "submodule.h" #include "submodule-config.h" +#include "object-file.h" #include "object-name.h" #include "object-store.h" #include "packfile.h"
builtin/hash-object.c +1 -0
@@ -9,6 +9,7 @@#include "config.h" #include "gettext.h" #include "hex.h" +#include "object-file.h" #include "object-store.h" #include "blob.h" #include "quote.h"
builtin/index-pack.c +1 -0
@@ -18,6 +18,7 @@#include "thread-utils.h" #include "packfile.h" #include "pack-revindex.h" +#include "object-file.h" #include "object-store.h" #include "oid-array.h" #include "replace-object.h"
builtin/init-db.c +1 -0
@@ -11,6 +11,7 @@#include "refs.h" #include "builtin.h" #include "exec-cmd.h" +#include "object-file.h" #include "parse-options.h" #include "setup.h" #include "worktree.h"
builtin/log.c +1 -0
@@ -12,6 +12,7 @@#include "gettext.h" #include "hex.h" #include "refs.h" +#include "object-file.h" #include "object-name.h" #include "object-store.h" #include "color.h"
builtin/mktag.c +1 -0
@@ -4,6 +4,7 @@#include "parse-options.h" #include "tag.h" #include "replace-object.h" +#include "object-file.h" #include "object-store.h" #include "fsck.h" #include "config.h"
builtin/mv.c +1 -0
@@ -11,6 +11,7 @@#include "config.h" #include "environment.h" #include "gettext.h" +#include "object-file.h" #include "pathspec.h" #include "lockfile.h" #include "dir.h"
builtin/pack-objects.c +1 -0
@@ -33,6 +33,7 @@#include "strvec.h" #include "list.h" #include "packfile.h" +#include "object-file.h" #include "object-store.h" #include "replace-object.h" #include "dir.h"
builtin/rebase.c +1 -0
@@ -21,6 +21,7 @@#include "cache-tree.h" #include "unpack-trees.h" #include "lockfile.h" +#include "object-file.h" #include "object-name.h" #include "parse-options.h" #include "commit.h"
builtin/replace.c +1 -0
@@ -17,6 +17,7 @@#include "refs.h" #include "parse-options.h" #include "run-command.h" +#include "object-file.h" #include "object-name.h" #include "object-store.h" #include "replace-object.h"
builtin/sparse-checkout.c +1 -0
@@ -4,6 +4,7 @@#include "dir.h" #include "environment.h" #include "gettext.h" +#include "object-file.h" #include "object-name.h" #include "parse-options.h" #include "pathspec.h"
builtin/submodule--helper.c +1 -0
@@ -24,6 +24,7 @@#include "revision.h" #include "diffcore.h" #include "diff.h" +#include "object-file.h" #include "object-name.h" #include "object-store.h" #include "advice.h"
builtin/update-index.c +1 -0
@@ -15,6 +15,7 @@#include "cache-tree.h" #include "tree-walk.h" #include "builtin.h" +#include "object-file.h" #include "refs.h" #include "resolve-undo.h" #include "parse-options.h"
builtin/worktree.c +1 -0
@@ -7,6 +7,7 @@#include "environment.h" #include "gettext.h" #include "hex.h" +#include "object-file.h" #include "object-name.h" #include "parse-options.h" #include "strvec.h"
bulk-checkin.c +1 -0
@@ -15,6 +15,7 @@#include "string-list.h" #include "tmp-objdir.h" #include "packfile.h" +#include "object-file.h" #include "object-store.h" static int odb_transaction_nesting;
cache-tree.c +1 -0
@@ -7,6 +7,7 @@#include "tree-walk.h" #include "cache-tree.h" #include "bulk-checkin.h" +#include "object-file.h" #include "object-store.h" #include "replace-object.h" #include "promisor-remote.h"
cache.h +0 -114
132 lines not on this page · raw message
commit-graph.c +1 -0
@@ -11,6 +11,7 @@#include "revision.h" #include "hash-lookup.h" #include "commit-graph.h" +#include "object-file.h" #include "object-store.h" #include "oid-array.h" #include "alloc.h"
diff.c +1 -0
@@ -35,6 +35,7 @@#include "help.h" #include "promisor-remote.h" #include "dir.h" +#include "object-file.h" #include "object-name.h" #include "setup.h" #include "strmap.h"
dir.c +1 -0
@@ -13,6 +13,7 @@#include "dir.h" #include "environment.h" #include "gettext.h" +#include "object-file.h" #include "object-store.h" #include "attr.h" #include "refs.h"
environment.c +1 -0
@@ -19,6 +19,7 @@#include "fmt-merge-msg.h" #include "commit.h" #include "strvec.h" +#include "object-file.h" #include "object-store.h" #include "replace-object.h" #include "tmp-objdir.h"
http.c +1 -0
@@ -17,6 +17,7 @@#include "packfile.h" #include "protocol.h" #include "string-list.h" +#include "object-file.h" #include "object-store.h" static struct trace_key trace_curl =TRACE_KEY_INIT (CURL );
merge-recursive.c +1 -0
@@ -22,6 +22,7 @@#include "hex.h" #include "ll-merge.h" #include "lockfile.h" +#include "object-file.h" #include "object-store.h" #include "repository.h" #include "revision.h"
midx.c +1 -0
@@ -8,6 +8,7 @@#include "hex.h" #include "lockfile.h" #include "packfile.h" +#include "object-file.h" #include "object-store.h" #include "hash-lookup.h" #include "midx.h"
notes-merge.c +1 -0
@@ -3,6 +3,7 @@#include "commit.h" #include "gettext.h" #include "refs.h" +#include "object-file.h" #include "object-name.h" #include "object-store.h" #include "repository.h"
object-file.c +1 -0
@@ -36,6 +36,7 @@#include "mergesort.h" #include "quote.h" #include "packfile.h" +#include "object-file.h" #include "object-store.h" #include "promisor-remote.h" #include "setup.h"
object-file.h new file +121 -0
121 lines not on this page · raw message
object.c +1 -0
@@ -3,6 +3,7 @@#include "hex.h" #include "object.h" #include "replace-object.h" +#include "object-file.h" #include "object-store.h" #include "blob.h" #include "tree.h"
pack-bitmap.c +1 -0
@@ -16,6 +16,7 @@#include "packfile.h" #include "repository.h" #include "trace2.h" +#include "object-file.h" #include "object-store.h" #include "list-objects-filter-options.h" #include "midx.h"
pack-check.c +1 -0
@@ -6,6 +6,7 @@#include "pack-revindex.h" #include "progress.h" #include "packfile.h" +#include "object-file.h" #include "object-store.h" struct idx_entry {
pack-mtimes.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "gettext.h" #include "pack-mtimes.h" +#include "object-file.h" #include "object-store.h" #include "packfile.h"
pack-revindex.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "gettext.h" #include "pack-revindex.h" +#include "object-file.h" #include "object-store.h" #include "packfile.h" #include "trace2.h"
packfile.c +1 -0
@@ -18,6 +18,7 @@#include "trace.h" #include "tree-walk.h" #include "tree.h" +#include "object-file.h" #include "object-store.h" #include "midx.h" #include "commit-graph.h"
read-cache.c +1 -0
@@ -14,6 +14,7 @@#include "cache-tree.h" #include "refs.h" #include "dir.h" +#include "object-file.h" #include "object-store.h" #include "oid-array.h" #include "tree.h"
refs/files-backend.c +1 -0
@@ -12,6 +12,7 @@#include "../dir-iterator.h" #include "../lockfile.h" #include "../object.h" +#include "../object-file.h" #include "../dir.h" #include "../chdir-notify.h" #include "../setup.h"
rerere.c +1 -0
@@ -13,6 +13,7 @@#include "ll-merge.h" #include "attr.h" #include "pathspec.h" +#include "object-file.h" #include "object-store.h" #include "hash-lookup.h" #include "strmap.h"
sequencer.c +1 -0
@@ -8,6 +8,7 @@#include "hex.h" #include "lockfile.h" #include "dir.h" +#include "object-file.h" #include "object-name.h" #include "object-store.h" #include "object.h"
server-info.c +1 -0
@@ -9,6 +9,7 @@#include "commit.h" #include "tag.h" #include "packfile.h" +#include "object-file.h" #include "object-store.h" #include "strbuf.h" #include "wrapper.h"
streaming.c +1 -0
@@ -6,6 +6,7 @@#include "environment.h" #include "streaming.h" #include "repository.h" +#include "object-file.h" #include "object-store.h" #include "replace-object.h" #include "packfile.h"
submodule.c +1 -0
@@ -24,6 +24,7 @@#include "remote.h" #include "worktree.h" #include "parse-options.h" +#include "object-file.h" #include "object-name.h" #include "object-store.h" #include "commit-reach.h"
tmp-objdir.c +1 -0
@@ -4,6 +4,7 @@#include "chdir-notify.h" #include "dir.h" #include "environment.h" +#include "object-file.h" #include "sigchain.h" #include "string-list.h" #include "strbuf.h"
tree-walk.c +1 -0
@@ -4,6 +4,7 @@#include "dir.h" #include "gettext.h" #include "hex.h" +#include "object-file.h" #include "object-store.h" #include "trace2.h" #include "tree.h"
Signature · 1 line
gitgitgadget
PATCH 16/24 treewide: remove cache.h inclusion due to editor.h changes
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
This actually only affects sideband.c, but helps towards removing cache.h inclusion in conjunction with some of the upcoming patches that will be applied.
--- sideband.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sideband.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "color.h" #include "config.h" #include "editor.h"
Signature · 1 line
gitgitgadget
PATCH 20/24 strbuf: move forward declarations to beginning of file
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
--- strbuf.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
strbuf.h +2 -7
@@ -1,6 +1,8 @@#ifndef STRBUF_H #define STRBUF_H +struct object_id ; +struct repository ;struct string_list ;/**
@@ -72,12 +74,6 @@ struct strbuf {extern char strbuf_slopbuf[];#define STRBUF_INIT { .buf = strbuf_slopbuf } -/* -* Predeclare this here, since cache.h includes this file before it defines the -* struct. -*/ -struct object_id ; -/** * Life Cycle Functions * --------------------
@@ -634,7 +630,6 @@ void strbuf_list_free(struct strbuf **list);* Add the abbreviation, as generated by repo_find_unique_abbrev(), of `sha1` to * the strbuf `sb`. */ -struct repository ;void strbuf_repo_add_unique_abbrev (struct strbuf *sb,struct repository *repo,const struct object_id *oid,int abbrev_len); void strbuf_add_unique_abbrev(struct strbuf *sb, const struct object_id *oid,
Signature · 1 line
gitgitgadget
PATCH 19/24 cache.h: remove unnecessary includes
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
cache.h did not need any of these headers, and nothing that depended upon cache.h needed them either. Simply expunge these includes.
--- cache.h | 4 ---- 1 file changed, 4 deletions(-)
cache.h +0 -4
@@ -5,14 +5,10 @@#include "strbuf.h" #include "git-zlib.h" #include "hashmap.h" -#include "list.h" #include "gettext.h" #include "string-list.h" -#include "hash.h" -#include "path.h" #include "pathspec.h" #include "object.h" -#include "repository.h" #include "statinfo.h" #if defined(DT_UNKNOWN ) && !defined(NO_D_TYPE_IN_DIRENT )
Signature · 1 line
gitgitgadget
PATCH 15/24 editor: move editor-related functions and declarations into common file
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
cache.h and strbuf.[ch] had editor-related functions. Move these into editor.[ch].
--- add-patch.c | 1 + builtin/add.c | 1 + builtin/am.c | 1 + builtin/branch.c | 1 + builtin/bugreport.c | 1 + builtin/commit.c | 1 + builtin/config.c | 1 + builtin/merge.c | 1 + builtin/notes.c | 1 + builtin/replace.c | 1 + builtin/tag.c | 1 + builtin/var.c | 1 + cache.h | 3 --- color.c | 1 + editor.c | 30 ++++++++++++++++++++++++++++++ editor.h | 34 ++++++++++++++++++++++++++++++++++ pager.c | 1 + rebase-interactive.c | 1 + sideband.c | 1 + strbuf.c | 28 ---------------------------- strbuf.h | 24 ------------------------ 21 files changed, 80 insertions(+), 55 deletions(-) create mode 100644 editor.h
add-patch.c +1 -0
@@ -2,6 +2,7 @@#include "add-interactive.h" #include "advice.h" #include "alloc.h" +#include "editor.h" #include "environment.h" #include "gettext.h" #include "object-name.h"
builtin/add.c +1 -0
@@ -9,6 +9,7 @@#include "config.h" #include "builtin.h" #include "lockfile.h" +#include "editor.h" #include "dir.h" #include "gettext.h" #include "pathspec.h"
builtin/am.c +1 -0
@@ -9,6 +9,7 @@#include "advice.h" #include "config.h" #include "builtin.h" +#include "editor.h" #include "environment.h" #include "exec-cmd.h" #include "gettext.h"
builtin/branch.c +1 -0
@@ -8,6 +8,7 @@#include "cache.h" #include "config.h" #include "color.h" +#include "editor.h" #include "environment.h" #include "refs.h" #include "commit.h"
builtin/bugreport.c +1 -0
@@ -1,5 +1,6 @@#include "builtin.h" #include "abspath.h" +#include "editor.h" #include "gettext.h" #include "parse-options.h" #include "strbuf.h"
builtin/commit.c +1 -0
@@ -13,6 +13,7 @@#include "cache-tree.h" #include "color.h" #include "dir.h" +#include "editor.h" #include "environment.h" #include "builtin.h" #include "diff.h"
builtin/config.c +1 -0
@@ -3,6 +3,7 @@#include "alloc.h" #include "config.h" #include "color.h" +#include "editor.h" #include "environment.h" #include "gettext.h" #include "ident.h"
builtin/merge.c +1 -0
@@ -12,6 +12,7 @@#include "advice.h" #include "alloc.h" #include "config.h" +#include "editor.h" #include "environment.h" #include "gettext.h" #include "hex.h"
builtin/notes.c +1 -0
@@ -10,6 +10,7 @@#include "cache.h" #include "config.h" #include "builtin.h" +#include "editor.h" #include "gettext.h" #include "hex.h" #include "notes.h"
builtin/replace.c +1 -0
@@ -11,6 +11,7 @@#include "cache.h" #include "config.h" #include "builtin.h" +#include "editor.h" #include "environment.h" #include "gettext.h" #include "hex.h"
builtin/tag.c +1 -0
@@ -10,6 +10,7 @@#include "advice.h" #include "config.h" #include "builtin.h" +#include "editor.h" #include "environment.h" #include "gettext.h" #include "hex.h"
builtin/var.c +1 -0
@@ -5,6 +5,7 @@*/ #include "builtin.h" #include "config.h" +#include "editor.h" #include "ident.h" #include "refs.h"
cache.h +0 -3
@@ -665,10 +665,7 @@ int df_name_compare(const char *name1, size_t len1, int mode1,int name_compare (const char *name1,size_t len1,const char *name2,size_t len2);int cache_name_stage_compare (const char *name1,int len1,int stage1,const char *name2,int len2,int stage2); -const char *git_editor (void ); -const char *git_sequence_editor (void );const char *git_pager (int stdout_is_tty); -int is_terminal_dumb (void );struct cache_def {struct strbuf path;
color.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "config.h" #include "color.h" +#include "editor.h" #include "gettext.h" #include "hex.h"
editor.c +30 -0
@@ -2,12 +2,14 @@#include "abspath.h" #include "advice.h" #include "config.h" +#include "editor.h" #include "environment.h" #include "gettext.h" #include "strbuf.h" #include "strvec.h" #include "run-command.h" #include "sigchain.h" +#include "wrapper.h" #ifndef DEFAULT_EDITOR #define DEFAULT_EDITOR "vi"
@@ -130,3 +132,31 @@ int launch_sequence_editor(const char *path, struct strbuf *buffer, {return launch_specified_editor (git_sequence_editor (), path, buffer, env); } + +int strbuf_edit_interactively (struct strbuf *buffer,const char *path, +const char *const *env) +{ +char *path2 =NULL ; +int fd, res =0 ; + +if (!is_absolute_path (path)) + path = path2 =xstrdup (git_path ("%s" , path)); + + fd =open (path,O_WRONLY |O_CREAT |O_TRUNC ,0666 ); +if (fd <0 ) + res =error_errno (_ ("could not open '%s' for writing" ), path); +else if (write_in_full (fd, buffer->buf, buffer->len) <0 ) { + res =error_errno (_ ("could not write to '%s'" ), path); +close (fd); + }else if (close (fd) <0 ) + res =error_errno (_ ("could not close '%s'" ), path); +else { +strbuf_reset (buffer); +if (launch_editor (path, buffer, env) <0 ) + res =error_errno (_ ("could not edit '%s'" ), path); +unlink (path); + } + +free (path2); +return res; +}
editor.h new file +34 -0
@@ -0,0 +1,34 @@ +#ifndef EDITOR_H +#define EDITOR_H + +struct strbuf ; + +const char *git_editor (void ); +const char *git_sequence_editor (void ); +int is_terminal_dumb (void ); + +/** +* Launch the user preferred editor to edit a file and fill the buffer +* with the file's contents upon the user completing their editing. The +* third argument can be used to set the environment which the editor is +* run in. If the buffer is NULL the editor is launched as usual but the +* file's contents are not read into the buffer upon completion. +*/ +int launch_editor (const char *path,struct strbuf *buffer, +const char *const *env); + +int launch_sequence_editor (const char *path,struct strbuf *buffer, +const char *const *env); + +/* +* In contrast to `launch_editor()`, this function writes out the contents +* of the specified file first, then clears the `buffer`, then launches +* the editor and reads back in the file contents into the `buffer`. +* Finally, it deletes the temporary file. +* +* If `path` is relative, it refers to a file in the `.git` directory. +*/ +int strbuf_edit_interactively (struct strbuf *buffer,const char *path, +const char *const *env); + +#endif
pager.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "config.h" +#include "editor.h" #include "run-command.h" #include "sigchain.h" #include "alias.h"
rebase-interactive.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "commit.h" +#include "editor.h" #include "environment.h" #include "gettext.h" #include "sequencer.h"
sideband.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "color.h" #include "config.h" +#include "editor.h" #include "gettext.h" #include "sideband.h" #include "help.h"
strbuf.c +0 -28
@@ -1180,34 +1180,6 @@ int strbuf_normalize_path(struct strbuf *src)return 0 ; } -int strbuf_edit_interactively (struct strbuf *buffer,const char *path, -const char *const *env) -{ -char *path2 =NULL ; -int fd, res =0 ; - -if (!is_absolute_path (path)) - path = path2 =xstrdup (git_path ("%s" , path)); - - fd =open (path,O_WRONLY |O_CREAT |O_TRUNC ,0666 ); -if (fd <0 ) - res =error_errno (_ ("could not open '%s' for writing" ), path); -else if (write_in_full (fd, buffer->buf, buffer->len) <0 ) { - res =error_errno (_ ("could not write to '%s'" ), path); -close (fd); - }else if (close (fd) <0 ) - res =error_errno (_ ("could not close '%s'" ), path); -else { -strbuf_reset (buffer); -if (launch_editor (path, buffer, env) <0 ) - res =error_errno (_ ("could not edit '%s'" ), path); -unlink (path); - } - -free (path2); -return res; -} -void strbuf_strip_file_from_path (struct strbuf *sb) {char *path_sep =find_last_dir_sep (sb->buf);
strbuf.h +0 -24
@@ -640,30 +640,6 @@ void strbuf_repo_add_unique_abbrev(struct strbuf *sb, struct repository *repo,void strbuf_add_unique_abbrev (struct strbuf *sb,const struct object_id *oid,int abbrev_len); -/** -* Launch the user preferred editor to edit a file and fill the buffer -* with the file's contents upon the user completing their editing. The -* third argument can be used to set the environment which the editor is -* run in. If the buffer is NULL the editor is launched as usual but the -* file's contents are not read into the buffer upon completion. -*/ -int launch_editor (const char *path,struct strbuf *buffer, -const char *const *env); - -int launch_sequence_editor (const char *path,struct strbuf *buffer, -const char *const *env); - -/* -* In contrast to `launch_editor()`, this function writes out the contents -* of the specified file first, then clears the `buffer`, then launches -* the editor and reads back in the file contents into the `buffer`. -* Finally, it deletes the temporary file. -* -* If `path` is relative, it refers to a file in the `.git` directory. -*/ -int strbuf_edit_interactively (struct strbuf *buffer,const char *path, -const char *const *env); -/* * Remove the filename from the provided path string. If the path * contains a trailing separator, then the path is considered a directory
Signature · 1 line
gitgitgadget
PATCH 23/24 chdir-notify, quote: replace cache.h include with path.h
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
--- chdir-notify.c | 3 ++- quote.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
chdir-notify.c +2 -1
@@ -1,7 +1,8 @@ -#include "cache.h" +#include "git-compat-util.h" #include "abspath.h" #include "chdir-notify.h" #include "list.h" +#include "path.h" #include "strbuf.h" #include "trace.h"
quote.c +2 -1
@@ -1,5 +1,6 @@ -#include "cache.h" +#include "git-compat-util.h" #include "alloc.h" +#include "path.h" #include "quote.h" #include "strbuf.h" #include "strvec.h"
Signature · 1 line
gitgitgadget
PATCH 22/24 treewide: reduce includes of cache.h in other headers
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
We had a handful of headers including cache.h that didn't need to anymore. Drop those includes and replace them with includes of smaller files, or forward declarations. However, note that two .c files now need to directly include cache.h, though they should have been including it all along given they are directly using structs defined in it.
--- archive.h | 2 +- refs/ref-cache.h | 2 +- rerere.c | 2 +- resolve-undo.h | 7 ++++++- revision.c | 2 +- split-index.h | 2 +- 6 files changed, 11 insertions(+), 6 deletions(-)
archive.h +1 -1
@@ -1,9 +1,9 @@#ifndef ARCHIVE_H #define ARCHIVE_H -#include "cache.h" #include "object-name.h" #include "pathspec.h" +#include "string-list.h" struct repository ;struct pretty_print_context ;
refs/ref-cache.h +1 -1
@@ -1,7 +1,7 @@#ifndef REFS_REF_CACHE_H #define REFS_REF_CACHE_H -#include "cache.h" +#include "hash.h" struct ref_dir ;struct ref_store ;
rerere.c +1 -1
@@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "abspath.h" #include "alloc.h" #include "config.h"
resolve-undo.h +6 -1
@@ -1,7 +1,12 @@ #ifndef RESOLVE_UNDO_H #define RESOLVE_UNDO_H -#include "cache.h" +struct cache_entry; +struct index_state; +struct pathspec; +struct string_list; + +#include "hash.h" struct resolve_undo_info { unsigned int mode[3];
revision.c +1 -1
@@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "alloc.h" #include "config.h" #include "environment.h"
split-index.h +1 -1
@@ -1,7 +1,7 @@#ifndef SPLIT_INDEX_H #define SPLIT_INDEX_H -#include "cache.h" +#include "hash.h" struct index_state ;struct strbuf ;
Signature · 1 line
gitgitgadget
PATCH 21/24 treewide: remove double forward declaration of read_in_full
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
cache.h's nature of a dumping ground of includes prevented it from being included in some compat/ files, forcing us into a workaround of having a double forward declaration of the read_in_full() function (see commit 14086b0a13 ("compat/pread.c: Add a forward declaration to fix a warning", 2007-11-17)). Now that we have moved functions like read_in_full() from cache.h to wrapper.h, and wrapper.h isn't littered with unrelated and scary #defines, get rid of the extra forward declaration and just have compat/pread.c include wrapper.h.
--- builtin/clone.c | 1 + bulk-checkin.c | 1 + combine-diff.c | 1 + compat/pread.c | 1 + git-compat-util.h | 6 ------ grep.c | 1 + pack-write.c | 1 + path.c | 1 + refs/packed-backend.c | 1 + send-pack.c | 1 + setup.c | 1 + upload-pack.c | 1 + 12 files changed, 11 insertions(+), 6 deletions(-)
builtin/clone.c +1 -0
@@ -42,6 +42,7 @@#include "hook.h" #include "bundle.h" #include "bundle-uri.h" +#include "wrapper.h" /* * Overall FIXMEs:
bulk-checkin.c +1 -0
@@ -17,6 +17,7 @@#include "packfile.h" #include "object-file.h" #include "object-store.h" +#include "wrapper.h" static int odb_transaction_nesting;
combine-diff.c +1 -0
@@ -16,6 +16,7 @@#include "userdiff.h" #include "oid-array.h" #include "revision.h" +#include "wrapper.h" static int compare_paths (const struct combine_diff_path *one,const struct diff_filespec *two)
compat/pread.c +1 -0
@@ -1,4 +1,5 @@#include "../git-compat-util.h" +#include "../wrapper.h" ssize_t git_pread (int fd,void *buf,size_t count,off_t offset) {
git-compat-util.h +0 -6
@@ -859,12 +859,6 @@ int git_lstat(const char *, struct stat *);#define pread git_preadssize_t git_pread (int fd,void *buf,size_t count,off_t offset);#endif -/* -* Forward decl that will remind us if its twin in cache.h changes. -* This function is used in compat/pread.c. But we can't include -* cache.h there. -*/ -ssize_t read_in_full (int fd,void *buf,size_t count);#ifdef NO_SETENV #define setenv gitsetenv
grep.c +1 -0
@@ -11,6 +11,7 @@#include "commit.h" #include "quote.h" #include "help.h" +#include "wrapper.h" static int grep_source_load (struct grep_source *gs); static int grep_source_is_binary(struct grep_source *gs,
pack-write.c +1 -0
@@ -10,6 +10,7 @@#include "oidmap.h" #include "pack-objects.h" #include "pack-revindex.h" +#include "wrapper.h" void reset_pack_idx_option (struct pack_idx_option *opts) {
path.c +1 -0
@@ -18,6 +18,7 @@#include "object-store.h" #include "lockfile.h" #include "exec-cmd.h" +#include "wrapper.h" static int get_st_mode_bits (const char *path,int *mode) {
refs/packed-backend.c +1 -0
@@ -9,6 +9,7 @@#include "../iterator.h" #include "../lockfile.h" #include "../chdir-notify.h" +#include "../wrapper.h" #include "../write-or-die.h" enum mmap_strategy {
send-pack.c +1 -0
@@ -14,6 +14,7 @@#include "quote.h" #include "transport.h" #include "version.h" +#include "wrapper.h" #include "oid-array.h" #include "gpg-interface.h" #include "shallow.h"
setup.c +1 -0
@@ -12,6 +12,7 @@#include "promisor-remote.h" #include "quote.h" #include "trace2.h" +#include "wrapper.h" static int inside_git_dir =-1 ;static int inside_work_tree =-1 ;
upload-pack.c +1 -0
@@ -32,6 +32,7 @@#include "commit-graph.h" #include "commit-reach.h" #include "shallow.h" +#include "wrapper.h" #include "write-or-die.h" /* Remember to update object flag allocation in object.h */
Signature · 1 line
gitgitgadget
PATCH 18/24 treewide: remove cache.h inclusion due to pager.h changes
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
--- column.c | 2 +- editor.c | 2 +- pager.c | 2 +- pretty.c | 2 +- progress.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-)
column.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "config.h" #include "column.h" #include "string-list.h"
editor.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "abspath.h" #include "advice.h" #include "config.h"
pager.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "config.h" #include "editor.h" #include "pager.h"
pretty.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "alloc.h" #include "config.h" #include "commit.h"
progress.c +1 -1
@@ -9,7 +9,7 @@*/ #define GIT_TEST_PROGRESS_ONLY -#include "cache.h" +#include "git-compat-util.h" #include "pager.h" #include "progress.h" #include "strbuf.h"
Signature · 1 line
gitgitgadget
PATCH 24/24 mailmap, quote: move declarations of global vars to correct unit
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
Since earlier commits removed the inclusion of cache.h from mailmap.c and quote.c, it feels odd to have the extern declarations of global variables in cache.h rather than the actual header included by the source file. Move these global variable extern declarations from cache.h to mailmap.c and quote.c.
--- cache.h | 5 ----- config.c | 1 + mailmap.h | 3 +++ quote.h | 2 ++ 4 files changed, 6 insertions(+), 5 deletions(-)
cache.h +0 -5
@@ -622,8 +622,6 @@ void set_alternate_index_output(const char *);extern int verify_index_checksum;extern int verify_ce_order; -extern int quote_path_fully; -#define MTIME_CHANGED 0x0001#define CTIME_CHANGED 0x0002#define OWNER_CHANGED 0x0004
@@ -708,9 +706,6 @@ extern int fetch_if_missing;/* Dumb servers support */ int update_server_info (int ); -extern const char *git_mailmap_file; -extern const char *git_mailmap_blob; -#define COPY_READ_ERROR (-2)#define COPY_WRITE_ERROR (-3)int copy_fd (int ifd,int ofd);
config.c +1 -0
@@ -18,6 +18,7 @@#include "ident.h" #include "repository.h" #include "lockfile.h" +#include "mailmap.h" #include "exec-cmd.h" #include "strbuf.h" #include "quote.h"
mailmap.h +3 -0
@@ -3,6 +3,9 @@struct string_list ; +extern const char *git_mailmap_file; +extern const char *git_mailmap_blob; +int read_mailmap (struct string_list *map);void clear_mailmap (struct string_list *map);
quote.h +2 -0
@@ -3,6 +3,8 @@struct strbuf ; +extern int quote_path_fully; +/* Help to copy the thing properly quoted for the shell safety. * any single quote is replaced with '\'', any exclamation point * is replaced with '\!', and the whole thing is enclosed in a
Signature · 1 line
gitgitgadget
Quoted 1 line · Elijah Newren via GitGitGadget
[...]
Quoted 6 lines
This series builds on en/header-cleanup
(https://lore.kernel.org/git/[email protected]/)
and en/header-split-cleanup
(https://lore.kernel.org/git/[email protected]/),
and continues to focus on splitting declarations fromcache.hto separate headers.
[...]
Quoted 3 lines
There are more changes I plan to make after this series graduates (still focused around splitting up
cache.h), but this series was long enough.
While preparing some of those additional splits of cache.h, I found a few small tweaks that make more sense being squashed into this series. I'll send out a re-roll tonight.
PATCH v2 1/24 treewide: be explicit about dependence on trace.h & trace2.h
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
Dozens of files made use of trace and trace2 functions, without explicitly including trace.h or trace2.h. This made it more difficult to find which files could remove a dependence on cache.h. Make C files explicitly include trace.h or trace2.h if they are using them.
--- blame.c | 1 + builtin/checkout.c | 1 + builtin/commit-graph.c | 1 + builtin/fetch.c | 2 ++ builtin/fsmonitor--daemon.c | 1 + builtin/gc.c | 1 + builtin/push.c | 1 + builtin/rebase.c | 1 + builtin/receive-pack.c | 2 ++ builtin/reset.c | 2 ++ cache-tree.c | 2 ++ cache.h | 2 -- chdir-notify.c | 1 + common-main.c | 1 + compat/fsmonitor/fsm-listen-win32.c | 1 + compat/mingw.c | 1 + compat/simple-ipc/ipc-unix-socket.c | 1 + compat/simple-ipc/ipc-win32.c | 2 ++ compat/win32/trace2_win32_process_info.c | 1 + config.c | 1 + connect.c | 1 + convert.c | 1 + diff-lib.c | 1 + dir.c | 1 + environment.c | 1 + exec-cmd.c | 2 ++ fetch-pack.c | 1 + fsmonitor.c | 1 + fsmonitor.h | 1 + git.c | 2 ++ http.c | 1 + merge-ort.c | 1 + name-hash.c | 1 + notes-merge.c | 1 + pack-bitmap.c | 1 + pack-revindex.c | 1 + packfile.c | 1 + pkt-line.c | 1 + preload-index.c | 1 + progress.c | 1 + promisor-remote.c | 1 + protocol.c | 1 + read-cache.c | 1 + remote-curl.c | 1 + repository.c | 1 + revision.c | 1 + run-command.c | 2 ++ scalar.c | 1 + setup.c | 1 + shallow.c | 1 + submodule.c | 1 + t/helper/test-date.c | 1 + t/helper/test-lazy-init-name-hash.c | 1 + t/helper/test-path-utils.c | 1 + trace.c | 1 + trace2.c | 1 + transport.c | 1 + tree-walk.c | 1 + unpack-trees.c | 1 + upload-pack.c | 1 + wrapper.c | 1 + wt-status.c | 2 ++ 62 files changed, 70 insertions(+), 2 deletions(-)
blame.c +1 -0
@@ -9,6 +9,7 @@#include "hex.h" #include "setup.h" #include "tag.h" +#include "trace2.h" #include "blame.h" #include "alloc.h" #include "commit-slab.h"
builtin/checkout.c +1 -0
@@ -26,6 +26,7 @@#include "setup.h" #include "submodule.h" #include "submodule-config.h" +#include "trace2.h" #include "tree.h" #include "tree-walk.h" #include "unpack-trees.h"
builtin/commit-graph.c +1 -0
@@ -12,6 +12,7 @@#include "progress.h" #include "replace-object.h" #include "tag.h" +#include "trace2.h" #define BUILTIN_COMMIT_GRAPH_VERIFY_USAGE \ N_("git commit-graph verify [--object-dir <dir>] [--shallow] [--[no-]progress]")
builtin/fetch.c +2 -0
@@ -31,6 +31,8 @@#include "promisor-remote.h" #include "commit-graph.h" #include "shallow.h" +#include "trace.h" +#include "trace2.h" #include "worktree.h" #include "bundle-uri.h"
builtin/fsmonitor--daemon.c +1 -0
@@ -14,6 +14,7 @@#include "simple-ipc.h" #include "khash.h" #include "pkt-line.h" +#include "trace2.h" static const char *const builtin_fsmonitor__daemon_usage[] = {N_ ("git fsmonitor--daemon start [<options>]" ),
builtin/gc.c +1 -0
@@ -37,6 +37,7 @@#include "gettext.h" #include "hook.h" #include "setup.h" +#include "trace2.h" #include "wrapper.h" #define FAILED_RUN "failed to run %s"
builtin/push.c +1 -0
@@ -16,6 +16,7 @@#include "submodule.h" #include "submodule-config.h" #include "send-pack.h" +#include "trace2.h" #include "color.h" static const char *const push_usage[] = {
builtin/rebase.c +1 -0
@@ -32,6 +32,7 @@#include "sequencer.h" #include "rebase-interactive.h" #include "reset.h" +#include "trace2.h" #include "hook.h" #include "wrapper.h"
builtin/receive-pack.c +2 -0
@@ -32,6 +32,8 @@#include "object-store.h" #include "protocol.h" #include "commit-reach.h" +#include "trace.h" +#include "trace2.h" #include "worktree.h" #include "shallow.h" #include "wrapper.h"
builtin/reset.c +2 -0
@@ -29,6 +29,8 @@#include "setup.h" #include "submodule.h" #include "submodule-config.h" +#include "trace.h" +#include "trace2.h" #include "dir.h" #include "add-interactive.h"
cache-tree.c +2 -0
@@ -11,6 +11,8 @@#include "replace-object.h" #include "promisor-remote.h" #include "sparse-index.h" +#include "trace.h" +#include "trace2.h" #ifndef DEBUG_CACHE_TREE #define DEBUG_CACHE_TREE 0
cache.h +0 -2
@@ -8,8 +8,6 @@#include "advice.h" #include "gettext.h" #include "convert.h" -#include "trace.h" -#include "trace2.h" #include "string-list.h" #include "pack-revindex.h" #include "hash.h"
chdir-notify.c +1 -0
@@ -3,6 +3,7 @@#include "chdir-notify.h" #include "list.h" #include "strbuf.h" +#include "trace.h" struct chdir_notify_entry {const char *name;
common-main.c +1 -0
@@ -3,6 +3,7 @@#include "gettext.h" #include "attr.h" #include "setup.h" +#include "trace2.h" /* * Many parts of Git have subprograms communicate via pipe, expect the
compat/fsmonitor/fsm-listen-win32.c +1 -0
@@ -4,6 +4,7 @@#include "fsm-listen.h" #include "fsmonitor--daemon.h" #include "gettext.h" +#include "trace2.h" /* * The documentation of ReadDirectoryChangesW() states that the maximum
compat/mingw.c +1 -0
@@ -12,6 +12,7 @@#include "win32/lazyload.h" #include "../config.h" #include "../environment.h" +#include "../trace2.h" #include "../wrapper.h" #include "dir.h" #include "gettext.h"
compat/simple-ipc/ipc-unix-socket.c +1 -0
@@ -4,6 +4,7 @@#include "strbuf.h" #include "pkt-line.h" #include "thread-utils.h" +#include "trace2.h" #include "unix-socket.h" #include "unix-stream-server.h"
compat/simple-ipc/ipc-win32.c +2 -0
@@ -5,6 +5,8 @@#include "strbuf.h" #include "pkt-line.h" #include "thread-utils.h" +#include "trace.h" +#include "trace2.h" #include "accctrl.h" #include "aclapi.h"
compat/win32/trace2_win32_process_info.c +1 -0
@@ -1,5 +1,6 @@#include "../../cache.h" #include "../../json-writer.h" +#include "../../trace2.h" #include "lazyload.h" #include <Psapi.h> #include <tlHelp32.h>
config.c +1 -0
@@ -28,6 +28,7 @@#include "replace-object.h" #include "refs.h" #include "setup.h" +#include "trace2.h" #include "worktree.h" #include "wrapper.h" #include "write-or-die.h"
connect.c +1 -0
@@ -14,6 +14,7 @@#include "string-list.h" #include "oid-array.h" #include "transport.h" +#include "trace2.h" #include "strbuf.h" #include "version.h" #include "protocol.h"
convert.c +1 -0
@@ -9,6 +9,7 @@#include "sigchain.h" #include "pkt-line.h" #include "sub-process.h" +#include "trace.h" #include "utf8.h" #include "ll-merge.h" #include "wrapper.h"
diff-lib.c +1 -0
@@ -13,6 +13,7 @@#include "unpack-trees.h" #include "refs.h" #include "submodule.h" +#include "trace.h" #include "dir.h" #include "fsmonitor.h" #include "commit-reach.h"
dir.c +1 -0
@@ -23,6 +23,7 @@#include "fsmonitor.h" #include "setup.h" #include "submodule-config.h" +#include "trace2.h" #include "wrapper.h" /*
environment.c +1 -0
@@ -24,6 +24,7 @@#include "chdir-notify.h" #include "setup.h" #include "shallow.h" +#include "trace.h" #include "wrapper.h" #include "write-or-die.h"
exec-cmd.c +2 -0
@@ -5,6 +5,8 @@#include "gettext.h" #include "quote.h" #include "strvec.h" +#include "trace.h" +#include "trace2.h" #if defined(RUNTIME_PREFIX )
fetch-pack.c +1 -0
@@ -17,6 +17,7 @@#include "remote.h" #include "run-command.h" #include "connect.h" +#include "trace2.h" #include "transport.h" #include "version.h" #include "oid-array.h"
fsmonitor.c +1 -0
@@ -7,6 +7,7 @@#include "fsmonitor-ipc.h" #include "run-command.h" #include "strbuf.h" +#include "trace2.h" #define INDEX_EXTENSION_VERSION1 (1)#define INDEX_EXTENSION_VERSION2 (2)
fsmonitor.h +1 -0
@@ -4,6 +4,7 @@#include "cache.h" #include "dir.h" #include "fsmonitor-settings.h" +#include "trace.h" extern struct trace_key trace_fsmonitor;
git.c +2 -0
@@ -9,6 +9,8 @@#include "replace-object.h" #include "setup.h" #include "shallow.h" +#include "trace.h" +#include "trace2.h" #define RUN_SETUP (1<<0)#define RUN_SETUP_GENTLY (1<<1)
http.c +1 -0
@@ -12,6 +12,7 @@#include "version.h" #include "pkt-line.h" #include "gettext.h" +#include "trace.h" #include "transport.h" #include "packfile.h" #include "protocol.h"
merge-ort.c +1 -0
@@ -37,6 +37,7 @@#include "strmap.h" #include "submodule-config.h" #include "submodule.h" +#include "trace2.h" #include "tree.h" #include "unpack-trees.h" #include "xdiff-interface.h"
name-hash.c +1 -0
@@ -9,6 +9,7 @@#include "environment.h" #include "gettext.h" #include "thread-utils.h" +#include "trace.h" #include "trace2.h" #include "sparse-index.h"
notes-merge.c +1 -0
@@ -13,6 +13,7 @@#include "notes.h" #include "notes-merge.h" #include "strbuf.h" +#include "trace.h" #include "notes-utils.h" #include "commit-reach.h" #include "wrapper.h"
pack-bitmap.c +1 -0
@@ -15,6 +15,7 @@#include "pack-objects.h" #include "packfile.h" #include "repository.h" +#include "trace2.h" #include "object-store.h" #include "list-objects-filter-options.h" #include "midx.h"
pack-revindex.c +1 -0
@@ -3,6 +3,7 @@#include "pack-revindex.h" #include "object-store.h" #include "packfile.h" +#include "trace2.h" #include "config.h" #include "midx.h"
packfile.c +1 -0
@@ -15,6 +15,7 @@#include "commit.h" #include "object.h" #include "tag.h" +#include "trace.h" #include "tree-walk.h" #include "tree.h" #include "object-store.h"
pkt-line.c +1 -0
@@ -3,6 +3,7 @@#include "gettext.h" #include "hex.h" #include "run-command.h" +#include "trace.h" #include "wrapper.h" #include "write-or-die.h"
preload-index.c +1 -0
@@ -11,6 +11,7 @@#include "progress.h" #include "thread-utils.h" #include "repository.h" +#include "trace2.h" /* * Mostly randomly chosen maximum thread counts: we
progress.c +1 -0
@@ -13,6 +13,7 @@#include "progress.h" #include "strbuf.h" #include "trace.h" +#include "trace2.h" #include "utf8.h" #include "config.h"
promisor-remote.c +1 -0
@@ -4,6 +4,7 @@#include "object-store.h" #include "promisor-remote.h" #include "config.h" +#include "trace2.h" #include "transport.h" #include "strvec.h" #include "packfile.h"
protocol.c +1 -0
@@ -2,6 +2,7 @@#include "config.h" #include "environment.h" #include "protocol.h" +#include "trace2.h" static enum protocol_version parse_protocol_version (const char *value) {
read-cache.c +1 -0
@@ -23,6 +23,7 @@#include "resolve-undo.h" #include "run-command.h" #include "strbuf.h" +#include "trace2.h" #include "varint.h" #include "split-index.h" #include "utf8.h"
remote-curl.c +1 -0
@@ -21,6 +21,7 @@#include "setup.h" #include "protocol.h" #include "quote.h" +#include "trace2.h" #include "transport.h" #include "write-or-die.h"
repository.c +1 -0
@@ -14,6 +14,7 @@#include "setup.h" #include "submodule-config.h" #include "sparse-index.h" +#include "trace2.h" #include "promisor-remote.h" /* The main repository */
revision.c +1 -0
@@ -31,6 +31,7 @@#include "worktree.h" #include "setup.h" #include "strvec.h" +#include "trace2.h" #include "commit-reach.h" #include "commit-graph.h" #include "prio-queue.h"
run-command.c +2 -0
@@ -8,6 +8,8 @@#include "thread-utils.h" #include "strbuf.h" #include "string-list.h" +#include "trace.h" +#include "trace2.h" #include "quote.h" #include "config.h" #include "packfile.h"
scalar.c +1 -0
@@ -16,6 +16,7 @@#include "packfile.h" #include "help.h" #include "setup.h" +#include "trace2.h" static void setup_enlistment_directory(int argc, const char **argv, const char * const *usagestr,
setup.c +1 -0
@@ -10,6 +10,7 @@#include "chdir-notify.h" #include "promisor-remote.h" #include "quote.h" +#include "trace2.h" static int inside_git_dir =-1 ;static int inside_work_tree =-1 ;
shallow.c +1 -0
@@ -17,6 +17,7 @@#include "list-objects.h" #include "commit-reach.h" #include "shallow.h" +#include "trace.h" #include "wrapper.h" void set_alternate_shallow_file (struct repository *r,const char *path,int override)
submodule.c +1 -0
@@ -28,6 +28,7 @@#include "commit-reach.h" #include "setup.h" #include "shallow.h" +#include "trace2.h" static int config_update_recurse_submodules =RECURSE_SUBMODULES_OFF ;static int initialized_fetch_ref_tips;
t/helper/test-date.c +1 -0
@@ -1,6 +1,7 @@#include "test-tool.h" #include "cache.h" #include "date.h" +#include "trace.h" static const char *usage_msg ="\n" " test-tool date relative [time_t]...\n"
t/helper/test-lazy-init-name-hash.c +1 -0
@@ -4,6 +4,7 @@#include "environment.h" #include "parse-options.h" #include "setup.h" +#include "trace.h" static int single;static int multi;
t/helper/test-path-utils.c +1 -0
@@ -4,6 +4,7 @@#include "environment.h" #include "setup.h" #include "string-list.h" +#include "trace.h" #include "utf8.h" /*
trace.c +1 -0
@@ -26,6 +26,7 @@#include "environment.h" #include "quote.h" #include "setup.h" +#include "trace.h" #include "wrapper.h" struct trace_key trace_default_key = {"GIT_TRACE" ,0 ,0 ,0 };
trace2.c +1 -0
@@ -7,6 +7,7 @@#include "thread-utils.h" #include "version.h" #include "trace.h" +#include "trace2.h" #include "trace2/tr2_cfg.h" #include "trace2/tr2_cmd_name.h" #include "trace2/tr2_ctr.h"
transport.c +1 -0
@@ -22,6 +22,7 @@#include "string-list.h" #include "oid-array.h" #include "sigchain.h" +#include "trace2.h" #include "transport-internal.h" #include "protocol.h" #include "object-store.h"
tree-walk.c +1 -0
@@ -5,6 +5,7 @@#include "gettext.h" #include "hex.h" #include "object-store.h" +#include "trace2.h" #include "tree.h" #include "pathspec.h" #include "json-writer.h"
unpack-trees.c +1 -0
@@ -17,6 +17,7 @@#include "sparse-index.h" #include "submodule.h" #include "submodule-config.h" +#include "trace2.h" #include "fsmonitor.h" #include "object-store.h" #include "promisor-remote.h"
upload-pack.c +1 -0
@@ -22,6 +22,7 @@#include "version.h" #include "string-list.h" #include "strvec.h" +#include "trace2.h" #include "prio-queue.h" #include "protocol.h" #include "quote.h"
wrapper.c +1 -0
@@ -5,6 +5,7 @@#include "abspath.h" #include "config.h" #include "gettext.h" +#include "trace2.h" #include "wrapper.h" static intmax_t count_fsync_writeout_only;
wt-status.c +2 -0
@@ -18,6 +18,8 @@#include "column.h" #include "setup.h" #include "strbuf.h" +#include "trace.h" +#include "trace2.h" #include "utf8.h" #include "worktree.h" #include "lockfile.h"
Signature · 1 line
gitgitgadget
v2 cover Header cleanups (splitting up cache.h)
In reply to Elijah Newren via GitGitGadgetMaintainer notes: (1) This series is based on a merge of en/header-split-cleanup and ab/remove-implicit-use-of-the-repository (both in next). (2) Although I've tweaked the series to minimize conflicts (and this series merges syntactically cleanly with next and seen), there is a semantic conflict with each of ja/worktree-orphan and ab/tag-object-type-errors in seen; to correct, simply add an include of advice.h in builtin/worktree.c and an include of gettext.h in tag.c, respectively.
This series builds on en/header-cleanup
(https://lore.kernel.org/git/[email protected]/)
and en/header-split-cleanup
(https://lore.kernel.org/git/[email protected]/),
and continues to focus on splitting declarations from cache.h to separate headers. This series continues dropping the number of cache.h includes; in this series we go from 254 such includes to 190.
The series may appear to be long at first glance, but is repetitive and simple. It should be relatively easy to review, and falls into roughly 3 categories. An overview:
* Patches 1-6, 7: Being more explicit about dependencies. This was motivated by the fact that trying to find unnecessary dependencies on cache.h were being made harder by implicit dependencies on trace.h, trace2.h, and advice.h that were included via cache.h. (Similar to gettext.h handling in the previous series.) So I simply try to make dependencies more explicit, for both these headers and a few others. To make review easy, I split it into half a dozen patches, one header per patch (well, except that I handle trace.h and trace2.h together). Patch 7 then removes several includes of cache.h that are no longer needed due to patches 1-6.
* Patches 8-19: For several choices of FOO, move declarations of functions for FOO.c from cache.h to FOO.h. To simplify reviewing, each case is split into two patches, with the second patch cleaning up unnecessary includes of cache.h in other source files.
* Patches 20-24: Other small manual cleanups noticed while doing above work
Since patches 1-15 & 17-19 are just more of the same types of patches already reviewed in the last two series, it probably makes more sense for reviewers to focus on the other patches: 16 + 20-24 (which also happen to be smaller). I would particularly most like review of patches 16, 22, & 24 since they are the least like any previously reviewed patches.
Changes since v1:
* Moved a few more things from cache.h to object.h, object-file.h, and object-name.h
* Split the object.h changes into two patches to be more like all the other patches in 8-19
* Squashed patches 22 & 23, since both were just manual replacements of cache.h inclusion with some other header
* Removed a couple cases of duplicate inclusions of git-compat-util.h
There are more changes I plan to make after this series graduates (still focused around splitting up cache.h), but this series was long enough.
And thanks once again to Dscho for gitgitgadget. Getting multiple platform testing + all the special tests (sparse, cocci, hdr-check, etc.) really helps clean out all the issues that would otherwise hit a series like this.
Elijah Newren (24):
treewide: be explicit about dependence on trace.h & trace2.h
treewide: be explicit about dependence on advice.h
treewide: be explicit about dependence on convert.h
treewide: be explicit about dependence on pack-revindex.h
treewide: be explicit about dependence on oid-array.h
treewide: be explicit about dependence on mem-pool.h
treewide: remove unnecessary cache.h inclusion object-name.h: move declarations for object-name.c functions from
cache.h
treewide: remove cache.h inclusion due to object-name.h changes
git-zlib: move declarations for git-zlib functions from cache.h
treewide: remove cache.h inclusion due to git-zlib changes object-file.h: move declarations for object-file.c functions from
cache.h
treewide: remove cache.h inclusion due to object-file.h changes object.h: move some inline functions and defines from cache.h
treewide: remove cache.h inclusion due to object.h changes
editor: move editor-related functions and declarations into common
file
treewide: remove cache.h inclusion due to editor.h changes pager.h: move declarations for pager.c functions from cache.h
treewide: remove cache.h inclusion due to pager.h changes cache.h: remove unnecessary includes
strbuf: move forward declarations to beginning of file
treewide: remove double forward declaration of read_in_full
treewide: reduce includes of cache.h in other headers mailmap, quote: move declarations of global vars to correct unit
Makefile | 2 +- add-patch.c | 3 + apply.c | 2 + archive-tar.c | 1 + archive-zip.c | 1 + archive.c | 1 + archive.h | 3 +- bisect.c | 3 +- blame.c | 2 + branch.c | 3 +- builtin/add.c | 2 + builtin/am.c | 4 + builtin/bisect.c | 2 + builtin/blame.c | 2 + builtin/branch.c | 2 + builtin/bugreport.c | 2 + builtin/cat-file.c | 3 + builtin/check-attr.c | 1 + builtin/checkout.c | 3 + builtin/clone.c | 3 + builtin/commit-graph.c | 1 + builtin/commit-tree.c | 1 + builtin/commit.c | 3 + builtin/config.c | 1 + builtin/credential-cache--daemon.c | 1 + builtin/describe.c | 1 + builtin/diagnose.c | 1 + builtin/difftool.c | 1 + builtin/fast-export.c | 1 + builtin/fast-import.c | 2 + builtin/fetch-pack.c | 1 + builtin/fetch.c | 6 + builtin/fsck.c | 2 + builtin/fsmonitor--daemon.c | 1 + builtin/gc.c | 2 + builtin/grep.c | 3 + builtin/hash-object.c | 1 + builtin/help.c | 1 + builtin/index-pack.c | 3 + builtin/init-db.c | 1 + builtin/log.c | 4 + builtin/ls-files.c | 2 + builtin/ls-tree.c | 1 + builtin/merge-base.c | 1 + builtin/merge-recursive.c | 2 + builtin/merge-tree.c | 1 + builtin/merge.c | 3 + builtin/mktag.c | 1 + builtin/mv.c | 2 + builtin/name-rev.c | 2 + builtin/notes.c | 2 + builtin/pack-objects.c | 1 + builtin/prune.c | 2 + builtin/pull.c | 2 + builtin/push.c | 2 + builtin/range-diff.c | 1 + builtin/read-tree.c | 1 + builtin/rebase.c | 3 + builtin/receive-pack.c | 3 + builtin/replace.c | 3 + builtin/reset.c | 4 + builtin/rev-list.c | 2 + builtin/rev-parse.c | 1 + builtin/rm.c | 1 + builtin/show-branch.c | 1 + builtin/show-ref.c | 1 + builtin/sparse-checkout.c | 2 + builtin/stash.c | 1 + builtin/submodule--helper.c | 2 + builtin/tag.c | 3 + builtin/unpack-file.c | 1 + builtin/unpack-objects.c | 1 + builtin/update-index.c | 1 + builtin/update-ref.c | 1 + builtin/var.c | 2 + builtin/verify-commit.c | 1 + builtin/verify-tag.c | 1 + builtin/worktree.c | 2 + bulk-checkin.c | 4 +- bundle.c | 2 +- cache-tree.c | 3 + cache.h | 330 ----------------------- chdir-notify.c | 4 +- checkout.c | 4 +- color.c | 2 + column.c | 3 +- combine-diff.c | 3 + commit-graph.c | 4 +- commit.c | 3 +- common-main.c | 1 + compat/fsmonitor/fsm-listen-win32.c | 1 + compat/mingw.c | 1 + compat/pread.c | 1 + compat/simple-ipc/ipc-unix-socket.c | 3 +- compat/simple-ipc/ipc-win32.c | 2 + compat/win32/trace2_win32_process_info.c | 1 + config.c | 6 + connect.c | 2 +- convert.c | 3 + date.c | 1 + delta-islands.c | 2 +- diff-lib.c | 2 + diff-no-index.c | 2 +- diff.c | 5 + dir.c | 3 + editor.c | 34 ++- editor.h | 34 +++ environment.c | 4 +- exec-cmd.c | 2 + fetch-pack.c | 3 +- fmt-merge-msg.c | 3 +- fsck.c | 2 +- fsmonitor.c | 1 + fsmonitor.h | 1 + git-compat-util.h | 6 - zlib.c => git-zlib.c | 3 +- git-zlib.h | 28 ++ git.c | 3 + grep.c | 1 + http-backend.c | 3 +- http-fetch.c | 2 +- http-push.c | 2 +- http-walker.c | 2 +- http.c | 2 + http.h | 4 +- list-objects-filter.c | 3 +- list-objects.c | 2 +- ll-merge.c | 1 + log-tree.c | 3 +- mailmap.c | 3 +- mailmap.h | 3 + merge-ort.c | 4 + merge-recursive.c | 2 + midx.c | 1 + name-hash.c | 1 + notes-merge.c | 6 +- notes.c | 3 +- object-file.c | 2 + object-file.h | 129 +++++++++ object-name.c | 2 + object-name.h | 121 +++++++++ object.c | 1 + object.h | 44 +++ pack-bitmap-write.c | 2 +- pack-bitmap.c | 4 +- pack-check.c | 3 +- pack-mtimes.c | 3 +- pack-revindex.c | 4 +- pack-write.c | 4 +- packfile.c | 3 + pager.c | 6 +- pager.h | 17 ++ parse-options-cb.c | 2 +- path.c | 1 + pkt-line.c | 1 + preload-index.c | 1 + pretty.c | 3 +- progress.c | 4 +- promisor-remote.c | 3 +- protocol.c | 3 +- quote.c | 3 +- quote.h | 2 + range-diff.c | 2 + read-cache.c | 5 + rebase-interactive.c | 4 +- ref-filter.c | 2 + refs.c | 4 +- refs/files-backend.c | 1 + refs/packed-backend.c | 1 + refs/ref-cache.h | 2 +- remote-curl.c | 1 + remote.c | 3 +- repository.c | 1 + rerere.c | 3 +- reset.c | 1 + resolve-undo.h | 7 +- revision.c | 5 +- run-command.c | 2 + scalar.c | 3 +- send-pack.c | 1 + sequencer.c | 4 + server-info.c | 1 + setup.c | 5 +- shallow.c | 1 + sideband.c | 3 +- split-index.c | 1 + split-index.h | 2 +- strbuf.c | 31 +-- strbuf.h | 33 +-- streaming.c | 4 +- submodule-config.c | 3 +- submodule.c | 3 + t/helper/test-date.c | 2 +- t/helper/test-fast-rebase.c | 1 + t/helper/test-lazy-init-name-hash.c | 1 + t/helper/test-match-trees.c | 1 + t/helper/test-mergesort.c | 1 + t/helper/test-oidmap.c | 2 +- t/helper/test-path-utils.c | 1 + t/helper/test-reach.c | 2 +- t/helper/test-submodule-config.c | 2 +- tag.c | 3 +- tmp-objdir.c | 3 +- trace.c | 3 +- trace2.c | 1 + transport-helper.c | 3 +- transport.c | 5 +- tree-walk.c | 2 + tree.c | 1 + unpack-trees.c | 2 + unpack-trees.h | 1 + upload-pack.c | 5 +- walker.c | 2 +- wrapper.c | 1 + wt-status.c | 4 + 215 files changed, 807 insertions(+), 465 deletions(-) create mode 100644 editor.h rename zlib.c => git-zlib.c (99%) create mode 100644 git-zlib.h create mode 100644 object-file.h create mode 100644 object-name.h create mode 100644 pager.h
base-commit: dc1c48a4a2bce29542f330137106c01daa728f9e
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1509%2Fnewren%2Fheader-cleanup-3-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1509/newren/header-cleanup-3-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/1509
Range-diff vs v1:
1: 6acf4eb2c77 = 1: 6acf4eb2c77 treewide: be explicit about dependence on trace.h & trace2.h
2: e163bed61ff = 2: e163bed61ff treewide: be explicit about dependence on advice.h
3: 4ef4ee9daf3 = 3: 4ef4ee9daf3 treewide: be explicit about dependence on convert.h
4: 86b47be1776 = 4: 86b47be1776 treewide: be explicit about dependence on pack-revindex.h
5: 81a9378be43 = 5: 81a9378be43 treewide: be explicit about dependence on oid-array.h
6: c6a561cf433 = 6: c6a561cf433 treewide: be explicit about dependence on mem-pool.h
7: 22709819107 ! 7: 3c12d5ba6c3 treewide: remove unnecessary cache.h inclusion
@@ connect.c
@@
#include "git-compat-util.h"
-#include "cache.h"
-+#include "git-compat-util.h"
#include "config.h"
#include "environment.h"
#include "gettext.h"
8: b513a6711ff ! 8: 1e2e60bffc7 object-name.h: move declarations for object-name.c functions from cache.h
@@ archive.h
struct repository;
+ ## bisect.c ##
+@@
+ #include "strvec.h"
+ #include "commit-slab.h"
+ #include "commit-reach.h"
++#include "object-name.h"
+ #include "object-store.h"
+ #include "dir.h"
+
+
## branch.c ##
@@
#include "environment.h"
@@ cache.h: extern int quote_path_fully;
/*
* Create the directory containing the named path, using care to be
* somewhat safe against races. Return one of the scld_error values to
-@@ cache.h: struct object_context {
- char *path;
- };
+@@ cache.h: int finalize_object_file(const char *tmpfile, const char *filename);
+ /* Helper to check and "touch" a file */
+ int check_and_freshen_file(const char *fn, int freshen);
+-/* Convert to/from hex/sha1 representation */
+-#define MINIMUM_ABBREV minimum_abbrev
+-#define DEFAULT_ABBREV default_abbrev
+-
+-/* used when the code does not know or care what the default abbrev is */
+-#define FALLBACK_DEFAULT_ABBREV 7
+-
+-struct object_context {
+- unsigned short mode;
+- /*
+- * symlink_path is only used by get_tree_entry_follow_symlinks,
+- * and only for symlinks that point outside the repository.
+- */
+- struct strbuf symlink_path;
+- /*
+- * If GET_OID_RECORD_PATH is set, this will record path (if any)
+- * found when resolving the name. The caller is responsible for
+- * releasing the memory.
+- */
+- char *path;
+-};
+-
-int repo_get_oid(struct repository *r, const char *str, struct object_id *oid);
-__attribute__((format (printf, 2, 3)))
-int get_oidf(struct object_id *oid, const char *fmt, ...);
@@ merge-ort.c
#include "oid-array.h"
#include "promisor-remote.h"
+ ## merge-recursive.c ##
+@@
+ #include "hex.h"
+ #include "ll-merge.h"
+ #include "lockfile.h"
++#include "object-name.h"
+ #include "object-store.h"
+ #include "repository.h"
+ #include "revision.h"
+
## notes-merge.c ##
@@
#include "commit.h"
@@ object-name.h (new)
+#define OBJECT_NAME_H
+
+#include "object.h"
++#include "strbuf.h"
+
-+struct object_context;
+struct object_id;
+struct repository;
-+struct strbuf;
++
++struct object_context {
++ unsigned short mode;
++ /*
++ * symlink_path is only used by get_tree_entry_follow_symlinks,
++ * and only for symlinks that point outside the repository.
++ */
++ struct strbuf symlink_path;
++ /*
++ * If GET_OID_RECORD_PATH is set, this will record path (if any)
++ * found when resolving the name. The caller is responsible for
++ * releasing the memory.
++ */
++ char *path;
++};
+
+/*
+ * Return an abbreviated sha1 unique within this repository's object database.
@@ object-name.h (new)
+struct object *repo_peel_to_type(struct repository *r,
+ const char *name, int namelen,
+ struct object *o, enum object_type);
++
++/* Convert to/from hex/sha1 representation */
++#define MINIMUM_ABBREV minimum_abbrev
++#define DEFAULT_ABBREV default_abbrev
++
++/* used when the code does not know or care what the default abbrev is */
++#define FALLBACK_DEFAULT_ABBREV 7
++
+#endif /* OBJECT_NAME_H */
## parse-options-cb.c ##
9: e3ec14f90a5 ! 9: 62f61514e2f treewide: remove cache.h inclusion due to object-name.h changes
@@ branch.c
@@
#include "git-compat-util.h"
-#include "cache.h"
-+#include "git-compat-util.h"
#include "advice.h"
#include "config.h"
#include "branch.h"
10: 2f240f07551 = 10: 54545bbb02c git-zlib: move declarations for git-zlib functions from cache.h
11: 7c969dc801d = 11: dbfe03129e3 treewide: remove cache.h inclusion due to git-zlib changes
12: 7cd3acfdb86 ! 12: 5efd49df148 object-file.h: move declarations for object-file.c functions from cache.h
@@ builtin/fast-import.c
#include "object-store.h"
#include "mem-pool.h"
+ ## builtin/fetch-pack.c ##
+@@
+ #include "alloc.h"
+ #include "gettext.h"
+ #include "hex.h"
++#include "object-file.h"
+ #include "pkt-line.h"
+ #include "fetch-pack.h"
+ #include "remote.h"
+
## builtin/fsck.c ##
@@
#include "streaming.h"
@@ builtin/pack-objects.c
#include "replace-object.h"
#include "dir.h"
+ ## builtin/prune.c ##
+@@
+ #include "progress.h"
+ #include "prune-packed.h"
+ #include "replace-object.h"
++#include "object-file.h"
+ #include "object-name.h"
+ #include "object-store.h"
+ #include "shallow.h"
+
## builtin/rebase.c ##
@@
#include "cache-tree.h"
@@ builtin/replace.c
#include "object-store.h"
#include "replace-object.h"
+ ## builtin/rev-list.c ##
+@@
+ #include "list-objects-filter-options.h"
+ #include "object.h"
+ #include "object-name.h"
++#include "object-file.h"
+ #include "object-store.h"
+ #include "pack.h"
+ #include "pack-bitmap.h"
+
## builtin/sparse-checkout.c ##
@@
#include "dir.h"
@@ cache-tree.c
#include "promisor-remote.h"
## cache.h ##
+@@
+
+ #include "git-compat-util.h"
+ #include "strbuf.h"
+-#include "git-zlib.h"
+ #include "hashmap.h"
+ #include "list.h"
+ #include "gettext.h"
@@ cache.h: int has_racy_timestamp(struct index_state *istate);
int ie_match_stat(struct index_state *, const struct cache_entry *, struct stat *, unsigned int);
int ie_modified(struct index_state *, const struct cache_entry *, struct stat *, unsigned int);
@@ cache.h: extern int quote_path_fully;
-/* Helper to check and "touch" a file */
-int check_and_freshen_file(const char *fn, int freshen);
-
- /* Convert to/from hex/sha1 representation */
- #define MINIMUM_ABBREV minimum_abbrev
- #define DEFAULT_ABBREV default_abbrev
+ int base_name_compare(const char *name1, size_t len1, int mode1,
+ const char *name2, size_t len2, int mode2);
+ int df_name_compare(const char *name1, size_t len1, int mode1,
@@ cache.h: int df_name_compare(const char *name1, size_t len1, int mode1,
int name_compare(const char *name1, size_t len1, const char *name2, size_t len2);
int cache_name_stage_compare(const char *name1, int len1, int stage1, const char *name2, int len2, int stage2);
@@ cache.h: int df_name_compare(const char *name1, size_t len1, int mode1,
const char *git_editor(void);
const char *git_sequence_editor(void);
const char *git_pager(int stdout_is_tty);
+@@ cache.h: struct pack_entry {
+ struct packed_git *p;
+ };
+
+-/*
+- * Set this to 0 to prevent oid_object_info_extended() from fetching missing
+- * blobs. This has a difference only if extensions.partialClone is set.
+- *
+- * Its default value is 1.
+- */
+-extern int fetch_if_missing;
+-
+ /* Dumb servers support */
+ int update_server_info(int);
+
## commit-graph.c ##
@@
@@ merge-recursive.c
#include "ll-merge.h"
#include "lockfile.h"
+#include "object-file.h"
+ #include "object-name.h"
#include "object-store.h"
#include "repository.h"
- #include "revision.h"
## midx.c ##
@@
@@ object-file.h (new)
+#include "git-zlib.h"
+#include "object.h"
+
++/*
++ * Set this to 0 to prevent oid_object_info_extended() from fetching missing
++ * blobs. This has a difference only if extensions.partialClone is set.
++ *
++ * Its default value is 1.
++ */
++extern int fetch_if_missing;
++
+#define HASH_WRITE_OBJECT 1
+#define HASH_FORMAT_CHECK 2
+#define HASH_RENORMALIZE 4
@@ rerere.c
#include "hash-lookup.h"
#include "strmap.h"
+ ## revision.c ##
+@@
+ #include "gettext.h"
+ #include "hex.h"
+ #include "object-name.h"
++#include "object-file.h"
+ #include "object-store.h"
+ #include "tag.h"
+ #include "blob.h"
+
## sequencer.c ##
@@
#include "hex.h"
13: c103d486b2a = 13: 1827ecb4d1d treewide: remove cache.h inclusion due to object-file.h changes
14: fa58cf82c66 ! 14: 8937f6d5ac5 object.h: move an inline function and some defines from cache.h
@@ Metadata
Author: Elijah Newren <[email protected]>
## Commit message ##
- object.h: move an inline function and some defines from cache.h
+ object.h: move some inline functions and defines from cache.h
The object_type() inline function is very tied to the enum object_type
declaration within object.h, and just seemed to make more sense to live
- there. Move it, and as a side-effect, remove a bunch of dependencies
- on cache.h that are no longer needed.
+ there. That makes S_ISGITLINK and some other defines make sense to go
+ with it, as well as the create_ce_mode() and canon_mode() inline
+ functions. Move all these inline functions and defines from cache.h to
+ object.h.
Signed-off-by: Elijah Newren <[email protected]>
- ## bundle.c ##
-@@
--#include "cache.h"
-+#include "git-compat-util.h"
- #include "lockfile.h"
- #include "bundle.h"
- #include "environment.h"
-
## cache.h ##
@@
#define DTYPE(de) DT_UNKNOWN
@@ cache.h: struct cache_entry {
/* Forward structure decls */
struct pathspec;
struct child_process;
+@@ cache.h: static inline unsigned create_ce_flags(unsigned stage)
+ #define ce_mark_uptodate(ce) ((ce)->ce_flags |= CE_UPTODATE)
+ #define ce_intent_to_add(ce) ((ce)->ce_flags & CE_INTENT_TO_ADD)
+
+-#define ce_permissions(mode) (((mode) & 0100) ? 0755 : 0644)
+-static inline unsigned int create_ce_mode(unsigned int mode)
+-{
+- if (S_ISLNK(mode))
+- return S_IFLNK;
+- if (S_ISSPARSEDIR(mode))
+- return S_IFDIR;
+- if (S_ISDIR(mode) || S_ISGITLINK(mode))
+- return S_IFGITLINK;
+- return S_IFREG | ce_permissions(mode);
+-}
+ static inline unsigned int ce_mode_from_stat(const struct cache_entry *ce,
+ unsigned int mode)
+ {
+@@ cache.h: static inline int ce_to_dtype(const struct cache_entry *ce)
+ else
+ return DT_UNKNOWN;
+ }
+-static inline unsigned int canon_mode(unsigned int mode)
+-{
+- if (S_ISREG(mode))
+- return S_IFREG | ce_permissions(mode);
+- if (S_ISLNK(mode))
+- return S_IFLNK;
+- if (S_ISDIR(mode))
+- return S_IFDIR;
+- return S_IFGITLINK;
+-}
+
+ static inline int ce_path_match(struct index_state *istate,
+ const struct cache_entry *ce,
@@ cache.h: void prefetch_cache_entries(const struct index_state *istate,
extern struct index_state the_index;
#endif
@@ cache.h: void prefetch_cache_entries(const struct index_state *istate,
#define INIT_DB_EXIST_OK 0x0002
- ## delta-islands.c ##
-@@
--#include "cache.h"
-+#include "git-compat-util.h"
- #include "alloc.h"
- #include "attr.h"
- #include "object.h"
-
- ## fsck.c ##
-@@
--#include "cache.h"
-+#include "git-compat-util.h"
- #include "alloc.h"
- #include "hex.h"
- #include "object-store.h"
-
- ## http-push.c ##
-@@
--#include "cache.h"
-+#include "git-compat-util.h"
- #include "environment.h"
- #include "hex.h"
- #include "repository.h"
-
- ## list-objects.c ##
-@@
--#include "cache.h"
-+#include "git-compat-util.h"
- #include "tag.h"
- #include "commit.h"
- #include "gettext.h"
-
## object.h ##
@@ object.h: enum object_type {
OBJ_MAX
@@ object.h: enum object_type {
+ S_ISGITLINK(mode) ? OBJ_COMMIT :
+ OBJ_BLOB;
+}
++
++#define ce_permissions(mode) (((mode) & 0100) ? 0755 : 0644)
++static inline unsigned int create_ce_mode(unsigned int mode)
++{
++ if (S_ISLNK(mode))
++ return S_IFLNK;
++ if (S_ISSPARSEDIR(mode))
++ return S_IFDIR;
++ if (S_ISDIR(mode) || S_ISGITLINK(mode))
++ return S_IFGITLINK;
++ return S_IFREG | ce_permissions(mode);
++}
++
++static inline unsigned int canon_mode(unsigned int mode)
++{
++ if (S_ISREG(mode))
++ return S_IFREG | ce_permissions(mode);
++ if (S_ISLNK(mode))
++ return S_IFLNK;
++ if (S_ISDIR(mode))
++ return S_IFDIR;
++ return S_IFGITLINK;
++}
+
/*
* The object type is stored in 3 bits.
*/
-
- ## pack-bitmap-write.c ##
-@@
--#include "cache.h"
-+#include "git-compat-util.h"
- #include "alloc.h"
- #include "environment.h"
- #include "gettext.h"
-
- ## submodule-config.c ##
-@@
--#include "cache.h"
-+#include "git-compat-util.h"
- #include "alloc.h"
- #include "dir.h"
- #include "environment.h"
-
- ## walker.c ##
-@@
--#include "cache.h"
-+#include "git-compat-util.h"
- #include "gettext.h"
- #include "hex.h"
- #include "walker.h"
-: ----------- > 15: c85f9baed8c treewide: remove cache.h inclusion due to object.h changes
15: 1e0a9441e73 ! 16: 0ac095731a7 editor: move editor-related functions and declarations into common file
@@ pager.c
## rebase-interactive.c ##
@@
- #include "cache.h"
+ #include "git-compat-util.h"
#include "commit.h"
+#include "editor.h"
#include "environment.h"
16: 4b41942a24e = 17: 9550d976141 treewide: remove cache.h inclusion due to editor.h changes
17: be8c5229baa ! 18: d658ee210d9 pager.h: move declarations for pager.c functions from cache.h
@@ builtin/var.c
static const char var_usage[] = "git var (-l | <variable>)";
## cache.h ##
+@@ cache.h: struct cache_entry {
+
+ /* Forward structure decls */
+ struct pathspec;
+-struct child_process;
+ struct tree;
+
+ /*
@@ cache.h: int df_name_compare(const char *name1, size_t len1, int mode1,
int name_compare(const char *name1, size_t len1, const char *name2, size_t len2);
int cache_name_stage_compare(const char *name1, int len1, int stage1, const char *name2, int len2, int stage2);
18: ec79da0235e = 19: 07d1a65a0ec treewide: remove cache.h inclusion due to pager.h changes
19: c8f7559553f ! 20: 23e0a81e788 cache.h: remove unnecessary includes
@@ Commit message
## cache.h ##
@@
+ #include "git-compat-util.h"
#include "strbuf.h"
- #include "git-zlib.h"
#include "hashmap.h"
-#include "list.h"
#include "gettext.h"
20: 7c3235c7943 = 21: 47afc6a6c87 strbuf: move forward declarations to beginning of file
21: 3a0d78e2f93 = 22: 6079c470cd1 treewide: remove double forward declaration of read_in_full
22: c4808cf9578 ! 23: 538d95833a2 treewide: reduce includes of cache.h in other headers
@@ archive.h
struct repository;
struct pretty_print_context;
+ ## chdir-notify.c ##
+@@
+-#include "cache.h"
++#include "git-compat-util.h"
+ #include "abspath.h"
+ #include "chdir-notify.h"
+ #include "list.h"
++#include "path.h"
+ #include "strbuf.h"
+ #include "trace.h"
+
+
+ ## quote.c ##
+@@
+-#include "cache.h"
++#include "git-compat-util.h"
+ #include "alloc.h"
++#include "path.h"
+ #include "quote.h"
+ #include "strbuf.h"
+ #include "strvec.h"
+
## refs/ref-cache.h ##
@@
#ifndef REFS_REF_CACHE_H
23: 50cbcacaad1 < -: ----------- chdir-notify, quote: replace cache.h include with path.h
24: 2421bb380b1 ! 24: 30e37a37c12 mailmap, quote: move declarations of global vars to correct unit
@@ cache.h: void set_alternate_index_output(const char *);
#define MTIME_CHANGED 0x0001
#define CTIME_CHANGED 0x0002
#define OWNER_CHANGED 0x0004
-@@ cache.h: extern int fetch_if_missing;
+@@ cache.h: struct pack_entry {
/* Dumb servers support */
int update_server_info(int);Signature · 1 line
gitgitgadget
PATCH v2 4/24 treewide: be explicit about dependence on pack-revindex.h
From: Elijah Newren <[email protected]>
--- builtin/index-pack.c | 1 + cache.h | 1 - pack-write.c | 1 + packfile.c | 1 + 4 files changed, 3 insertions(+), 1 deletion(-)
builtin/index-pack.c +1 -0
@@ -17,6 +17,7 @@#include "streaming.h" #include "thread-utils.h" #include "packfile.h" +#include "pack-revindex.h" #include "object-store.h" #include "replace-object.h" #include "promisor-remote.h"
cache.h +0 -1
@@ -7,7 +7,6 @@#include "list.h" #include "gettext.h" #include "string-list.h" -#include "pack-revindex.h" #include "hash.h" #include "path.h" #include "pathspec.h"
pack-write.c +1 -0
@@ -9,6 +9,7 @@#include "pack-mtimes.h" #include "oidmap.h" #include "pack-objects.h" +#include "pack-revindex.h" void reset_pack_idx_option (struct pack_idx_option *opts) {
packfile.c +1 -0
@@ -21,6 +21,7 @@#include "object-store.h" #include "midx.h" #include "commit-graph.h" +#include "pack-revindex.h" #include "promisor-remote.h" #include "wrapper.h"
Signature · 1 line
gitgitgadget
PATCH v2 3/24 treewide: be explicit about dependence on convert.h
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
--- archive.c | 1 + blame.c | 1 + builtin/cat-file.c | 1 + builtin/ls-files.c | 1 + cache.h | 1 - combine-diff.c | 1 + config.c | 1 + convert.c | 1 + diff.c | 1 + dir.c | 1 + environment.c | 1 + ll-merge.c | 1 + object-file.c | 1 + streaming.c | 1 + unpack-trees.h | 1 + 15 files changed, 14 insertions(+), 1 deletion(-)
archive.c +1 -0
@@ -2,6 +2,7 @@#include "abspath.h" #include "alloc.h" #include "config.h" +#include "convert.h" #include "environment.h" #include "gettext.h" #include "hex.h"
blame.c +1 -0
@@ -3,6 +3,7 @@#include "object-store.h" #include "cache-tree.h" #include "mergesort.h" +#include "convert.h" #include "diff.h" #include "diffcore.h" #include "gettext.h"
builtin/cat-file.c +1 -0
@@ -7,6 +7,7 @@#include "cache.h" #include "alloc.h" #include "config.h" +#include "convert.h" #include "builtin.h" #include "diff.h" #include "environment.h"
builtin/ls-files.c +1 -0
@@ -8,6 +8,7 @@#include "cache.h" #include "repository.h" #include "config.h" +#include "convert.h" #include "quote.h" #include "dir.h" #include "builtin.h"
cache.h +0 -1
@@ -6,7 +6,6 @@#include "hashmap.h" #include "list.h" #include "gettext.h" -#include "convert.h" #include "string-list.h" #include "pack-revindex.h" #include "hash.h"
combine-diff.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "object-store.h" #include "commit.h" +#include "convert.h" #include "blob.h" #include "diff.h" #include "diffcore.h"
config.c +1 -0
@@ -12,6 +12,7 @@#include "date.h" #include "branch.h" #include "config.h" +#include "convert.h" #include "environment.h" #include "gettext.h" #include "ident.h"
convert.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "advice.h" #include "config.h" +#include "convert.h" #include "gettext.h" #include "hex.h" #include "object-store.h"
diff.c +1 -0
@@ -5,6 +5,7 @@#include "abspath.h" #include "alloc.h" #include "config.h" +#include "convert.h" #include "environment.h" #include "gettext.h" #include "tempfile.h"
dir.c +1 -0
@@ -9,6 +9,7 @@#include "abspath.h" #include "alloc.h" #include "config.h" +#include "convert.h" #include "dir.h" #include "environment.h" #include "gettext.h"
environment.c +1 -0
@@ -10,6 +10,7 @@#include "cache.h" #include "abspath.h" #include "branch.h" +#include "convert.h" #include "environment.h" #include "gettext.h" #include "repository.h"
ll-merge.c +1 -0
@@ -6,6 +6,7 @@#include "cache.h" #include "config.h" +#include "convert.h" #include "attr.h" #include "xdiff-interface.h" #include "run-command.h"
object-file.c +1 -0
@@ -10,6 +10,7 @@#include "abspath.h" #include "alloc.h" #include "config.h" +#include "convert.h" #include "environment.h" #include "gettext.h" #include "hex.h"
streaming.c +1 -0
@@ -2,6 +2,7 @@* Copyright (c) 2011, Google Inc. */ #include "cache.h" +#include "convert.h" #include "environment.h" #include "streaming.h" #include "repository.h"
unpack-trees.h +1 -0
@@ -2,6 +2,7 @@#define UNPACK_TREES_H #include "cache.h" +#include "convert.h" #include "strvec.h" #include "string-list.h" #include "tree-walk.h"
Signature · 1 line
gitgitgadget
PATCH v2 5/24 treewide: be explicit about dependence on oid-array.h
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
--- builtin/bisect.c | 1 + builtin/fetch.c | 1 + builtin/index-pack.c | 1 + builtin/log.c | 1 + cache.h | 1 - commit-graph.c | 1 + diff.c | 1 + merge-ort.c | 1 + read-cache.c | 1 + ref-filter.c | 1 + upload-pack.c | 1 + 11 files changed, 10 insertions(+), 1 deletion(-)
builtin/bisect.c +1 -0
@@ -9,6 +9,7 @@#include "dir.h" #include "strvec.h" #include "run-command.h" +#include "oid-array.h" #include "prompt.h" #include "quote.h" #include "revision.h"
builtin/fetch.c +1 -0
@@ -12,6 +12,7 @@#include "refspec.h" #include "object-store.h" #include "oidset.h" +#include "oid-array.h" #include "commit.h" #include "builtin.h" #include "string-list.h"
builtin/index-pack.c +1 -0
@@ -19,6 +19,7 @@#include "packfile.h" #include "pack-revindex.h" #include "object-store.h" +#include "oid-array.h" #include "replace-object.h" #include "promisor-remote.h" #include "setup.h"
builtin/log.c +1 -0
@@ -20,6 +20,7 @@#include "revision.h" #include "log-tree.h" #include "builtin.h" +#include "oid-array.h" #include "tag.h" #include "reflog-walk.h" #include "patch-ids.h"
cache.h +0 -1
@@ -11,7 +11,6 @@#include "path.h" #include "pathspec.h" #include "object.h" -#include "oid-array.h" #include "repository.h" #include "statinfo.h" #include "mem-pool.h"
commit-graph.c +1 -0
@@ -12,6 +12,7 @@#include "hash-lookup.h" #include "commit-graph.h" #include "object-store.h" +#include "oid-array.h" #include "alloc.h" #include "hashmap.h" #include "replace-object.h"
diff.c +1 -0
@@ -29,6 +29,7 @@#include "string-list.h" #include "strvec.h" #include "graph.h" +#include "oid-array.h" #include "packfile.h" #include "parse-options.h" #include "help.h"
merge-ort.c +1 -0
@@ -32,6 +32,7 @@#include "entry.h" #include "ll-merge.h" #include "object-store.h" +#include "oid-array.h" #include "promisor-remote.h" #include "revision.h" #include "strmap.h"
read-cache.c +1 -0
@@ -15,6 +15,7 @@#include "refs.h" #include "dir.h" #include "object-store.h" +#include "oid-array.h" #include "tree.h" #include "commit.h" #include "blob.h"
ref-filter.c +1 -0
@@ -7,6 +7,7 @@#include "refs.h" #include "wildmatch.h" #include "object-store.h" +#include "oid-array.h" #include "repository.h" #include "commit.h" #include "remote.h"
upload-pack.c +1 -0
@@ -8,6 +8,7 @@#include "sideband.h" #include "repository.h" #include "object-store.h" +#include "oid-array.h" #include "tag.h" #include "object.h" #include "commit.h"
Signature · 1 line
gitgitgadget
PATCH v2 6/24 treewide: be explicit about dependence on mem-pool.h
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
--- builtin/checkout.c | 1 + cache.h | 1 - merge-ort.c | 1 + read-cache.c | 1 + split-index.c | 1 + t/helper/test-mergesort.c | 1 + 6 files changed, 5 insertions(+), 1 deletion(-)
builtin/checkout.c +1 -0
@@ -15,6 +15,7 @@#include "hook.h" #include "ll-merge.h" #include "lockfile.h" +#include "mem-pool.h" #include "merge-recursive.h" #include "object-store.h" #include "parse-options.h"
cache.h +0 -1
@@ -13,7 +13,6 @@#include "object.h" #include "repository.h" #include "statinfo.h" -#include "mem-pool.h" typedef struct git_zstream { z_stream z;
merge-ort.c +1 -0
@@ -31,6 +31,7 @@#include "hex.h" #include "entry.h" #include "ll-merge.h" +#include "mem-pool.h" #include "object-store.h" #include "oid-array.h" #include "promisor-remote.h"
read-cache.c +1 -0
@@ -21,6 +21,7 @@#include "blob.h" #include "environment.h" #include "gettext.h" +#include "mem-pool.h" #include "resolve-undo.h" #include "run-command.h" #include "strbuf.h"
split-index.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "alloc.h" #include "gettext.h" +#include "mem-pool.h" #include "split-index.h" #include "ewah/ewok.h"
t/helper/test-mergesort.c +1 -0
@@ -1,5 +1,6 @@#include "test-tool.h" #include "cache.h" +#include "mem-pool.h" #include "mergesort.h" static uint32_t minstd_rand (uint32_t *state)
Signature · 1 line
gitgitgadget
PATCH v2 2/24 treewide: be explicit about dependence on advice.h
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
Dozens of files made use of advice functions, without explicitly including advice.h. This made it more difficult to find which files could remove a dependence on cache.h. Make C files explicitly include advice.h if they are using it.
--- add-patch.c | 1 + branch.c | 1 + builtin/add.c | 1 + builtin/am.c | 1 + builtin/clone.c | 1 + builtin/commit.c | 1 + builtin/fetch.c | 1 + builtin/merge-recursive.c | 1 + builtin/merge.c | 1 + builtin/mv.c | 1 + builtin/pull.c | 1 + builtin/push.c | 1 + builtin/reset.c | 1 + builtin/tag.c | 1 + cache.h | 1 - config.c | 1 + convert.c | 1 + editor.c | 1 + notes-merge.c | 1 + object-name.c | 1 + refs.c | 1 + sequencer.c | 1 + transport.c | 1 + unpack-trees.c | 1 + wt-status.c | 1 + 25 files changed, 24 insertions(+), 1 deletion(-)
add-patch.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "add-interactive.h" +#include "advice.h" #include "alloc.h" #include "environment.h" #include "gettext.h"
branch.c +1 -0
@@ -1,5 +1,6 @@#include "git-compat-util.h" #include "cache.h" +#include "advice.h" #include "config.h" #include "branch.h" #include "environment.h"
builtin/add.c +1 -0
@@ -5,6 +5,7 @@*/ #define USE_THE_INDEX_VARIABLE #include "cache.h" +#include "advice.h" #include "config.h" #include "builtin.h" #include "lockfile.h"
builtin/am.c +1 -0
@@ -6,6 +6,7 @@#define USE_THE_INDEX_VARIABLE #include "cache.h" #include "abspath.h" +#include "advice.h" #include "config.h" #include "builtin.h" #include "environment.h"
builtin/clone.c +1 -0
@@ -11,6 +11,7 @@#define USE_THE_INDEX_VARIABLE #include "builtin.h" #include "abspath.h" +#include "advice.h" #include "config.h" #include "environment.h" #include "gettext.h"
builtin/commit.c +1 -0
@@ -7,6 +7,7 @@#define USE_THE_INDEX_VARIABLE #include "cache.h" +#include "advice.h" #include "config.h" #include "lockfile.h" #include "cache-tree.h"
builtin/fetch.c +1 -0
@@ -2,6 +2,7 @@* "git fetch" */ #include "cache.h" +#include "advice.h" #include "config.h" #include "gettext.h" #include "environment.h"
builtin/merge-recursive.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "builtin.h" +#include "advice.h" #include "commit.h" #include "gettext.h" #include "tag.h"
builtin/merge.c +1 -0
@@ -9,6 +9,7 @@#define USE_THE_INDEX_VARIABLE #include "cache.h" #include "abspath.h" +#include "advice.h" #include "alloc.h" #include "config.h" #include "environment.h"
builtin/mv.c +1 -0
@@ -6,6 +6,7 @@#define USE_THE_INDEX_VARIABLE #include "builtin.h" #include "abspath.h" +#include "advice.h" #include "alloc.h" #include "config.h" #include "environment.h"
builtin/pull.c +1 -0
@@ -7,6 +7,7 @@*/ #define USE_THE_INDEX_VARIABLE #include "cache.h" +#include "advice.h" #include "config.h" #include "builtin.h" #include "gettext.h"
builtin/push.c +1 -0
@@ -2,6 +2,7 @@* "git push" */ #include "cache.h" +#include "advice.h" #include "branch.h" #include "config.h" #include "environment.h"
builtin/reset.c +1 -0
@@ -9,6 +9,7 @@*/ #define USE_THE_INDEX_VARIABLE #include "builtin.h" +#include "advice.h" #include "config.h" #include "environment.h" #include "gettext.h"
builtin/tag.c +1 -0
@@ -7,6 +7,7 @@*/ #include "cache.h" +#include "advice.h" #include "config.h" #include "builtin.h" #include "environment.h"
cache.h +0 -1
@@ -5,7 +5,6 @@#include "strbuf.h" #include "hashmap.h" #include "list.h" -#include "advice.h" #include "gettext.h" #include "convert.h" #include "string-list.h"
config.c +1 -0
@@ -7,6 +7,7 @@*/ #include "cache.h" #include "abspath.h" +#include "advice.h" #include "alloc.h" #include "date.h" #include "branch.h"
convert.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "advice.h" #include "config.h" #include "gettext.h" #include "hex.h"
editor.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "abspath.h" +#include "advice.h" #include "config.h" #include "environment.h" #include "gettext.h"
notes-merge.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "advice.h" #include "commit.h" #include "gettext.h" #include "refs.h"
object-name.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "advice.h" #include "config.h" #include "environment.h" #include "gettext.h"
refs.c +1 -0
@@ -3,6 +3,7 @@*/ #include "cache.h" +#include "advice.h" #include "alloc.h" #include "config.h" #include "environment.h"
sequencer.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "abspath.h" +#include "advice.h" #include "alloc.h" #include "config.h" #include "environment.h"
transport.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "advice.h" #include "alloc.h" #include "config.h" #include "environment.h"
unpack-trees.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "advice.h" #include "strvec.h" #include "repository.h" #include "config.h"
wt-status.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "advice.h" #include "wt-status.h" #include "object.h" #include "dir.h"
Signature · 1 line
gitgitgadget
PATCH v2 7/24 treewide: remove unnecessary cache.h inclusion
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
Several files were including cache.h solely to get other headers, such as trace.h and trace2.h. Since the last few commits have modified files to make these dependencies more explicit, the inclusion of cache.h is no longer needed in several cases. Remove it.
--- compat/simple-ipc/ipc-unix-socket.c | 2 +- connect.c | 1 - fetch-pack.c | 2 +- pack-write.c | 2 +- promisor-remote.c | 2 +- protocol.c | 2 +- scalar.c | 2 +- t/helper/test-date.c | 1 - trace.c | 2 +- upload-pack.c | 2 +- 10 files changed, 8 insertions(+), 10 deletions(-)
compat/simple-ipc/ipc-unix-socket.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "gettext.h" #include "simple-ipc.h" #include "strbuf.h"
connect.c +0 -1
@@ -1,5 +1,4 @@#include "git-compat-util.h" -#include "cache.h" #include "config.h" #include "environment.h" #include "gettext.h"
fetch-pack.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "alloc.h" #include "repository.h" #include "config.h"
pack-write.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "environment.h" #include "gettext.h" #include "hex.h"
promisor-remote.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "gettext.h" #include "hex.h" #include "object-store.h"
protocol.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "config.h" #include "environment.h" #include "protocol.h"
scalar.c +1 -1
@@ -2,7 +2,7 @@* The Scalar command-line interface. */ -#include "cache.h" +#include "git-compat-util.h" #include "abspath.h" #include "gettext.h" #include "parse-options.h"
t/helper/test-date.c +0 -1
@@ -1,5 +1,4 @@#include "test-tool.h" -#include "cache.h" #include "date.h" #include "trace.h"
trace.c +1 -1
@@ -21,7 +21,7 @@* along with this program; if not, see <http://www.gnu.org/licenses/>. */ -#include "cache.h" +#include "git-compat-util.h" #include "abspath.h" #include "environment.h" #include "quote.h"
upload-pack.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "config.h" #include "environment.h" #include "gettext.h"
Signature · 1 line
gitgitgadget
PATCH v2 11/24 treewide: remove cache.h inclusion due to git-zlib changes
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
This actually only affects http-backend.c, but the git-zlib changes are going to be instrumental in pulling out an object-file.h which will help with several more files.
--- http-backend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
http-backend.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "alloc.h" #include "config.h" #include "environment.h"
Signature · 1 line
gitgitgadget
PATCH v2 10/24 git-zlib: move declarations for git-zlib functions from cache.h
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
Move functions from cache.h for zlib.c into a new header file. Since adding a "zlib.h" would cause issues with the real zlib, rename zlib.c to git-zlib.c while we are at it.
--- Makefile | 2 +- archive-tar.c | 1 + archive-zip.c | 1 + builtin/unpack-objects.c | 1 + cache.h | 25 +------------------------ zlib.c => git-zlib.c | 3 ++- git-zlib.h | 28 ++++++++++++++++++++++++++++ http-backend.c | 1 + http.h | 3 +++ 9 files changed, 39 insertions(+), 26 deletions(-) rename zlib.c => git-zlib.c (99%) create mode 100644 git-zlib.h
Makefile +1 -1
@@ -1036,6 +1036,7 @@ LIB_OBJS += fsmonitor.o LIB_OBJS += fsmonitor-ipc.o LIB_OBJS += fsmonitor-settings.o LIB_OBJS += gettext.o +LIB_OBJS += git-zlib.o LIB_OBJS += gpg-interface.o LIB_OBJS += graph.o LIB_OBJS += grep.o
@@ -1196,7 +1197,6 @@ LIB_OBJS += write-or-die.o LIB_OBJS += ws.o LIB_OBJS += wt-status.o LIB_OBJS += xdiff-interface.o -LIB_OBJS += zlib.o BUILTIN_OBJS += builtin/add.o BUILTIN_OBJS += builtin/am.o
archive-tar.c +1 -0
@@ -5,6 +5,7 @@#include "alloc.h" #include "config.h" #include "gettext.h" +#include "git-zlib.h" #include "hex.h" #include "tar.h" #include "archive.h"
archive-zip.c +1 -0
@@ -5,6 +5,7 @@#include "config.h" #include "archive.h" #include "gettext.h" +#include "git-zlib.h" #include "hex.h" #include "streaming.h" #include "utf8.h"
builtin/unpack-objects.c +1 -0
@@ -4,6 +4,7 @@#include "config.h" #include "environment.h" #include "gettext.h" +#include "git-zlib.h" #include "hex.h" #include "object-store.h" #include "object.h"
cache.h +1 -24
@@ -3,6 +3,7 @@#include "git-compat-util.h" #include "strbuf.h" +#include "git-zlib.h" #include "hashmap.h" #include "list.h" #include "gettext.h"
@@ -14,30 +15,6 @@#include "repository.h" #include "statinfo.h" -typedef struct git_zstream { -z_stream z; -unsigned long avail_in; -unsigned long avail_out; -unsigned long total_in; -unsigned long total_out; -unsigned char *next_in; -unsigned char *next_out; -}git_zstream ; - -void git_inflate_init (git_zstream *); -void git_inflate_init_gzip_only (git_zstream *); -void git_inflate_end (git_zstream *); -int git_inflate (git_zstream *,int flush); - -void git_deflate_init (git_zstream *,int level); -void git_deflate_init_gzip (git_zstream *,int level); -void git_deflate_init_raw (git_zstream *,int level); -void git_deflate_end (git_zstream *); -int git_deflate_abort (git_zstream *); -int git_deflate_end_gently (git_zstream *); -int git_deflate (git_zstream *,int flush); -unsigned long git_deflate_bound (git_zstream *,unsigned long ); -#if defined(DT_UNKNOWN ) && !defined(NO_D_TYPE_IN_DIRENT )#define DTYPE (de) ((de)->d_type)#else
git-zlib.c renamed from zlib.c +2 -1
@@ -2,7 +2,8 @@* zlib wrappers to make sure we don't silently miss errors * at init time. */ -#include "cache.h" +#include "git-compat-util.h" +#include "git-zlib.h" static const char *zerr_to_string (int status) {
git-zlib.h new file +28 -0
@@ -0,0 +1,28 @@ +#ifndef GIT_ZLIB_H +#define GIT_ZLIB_H + +typedef struct git_zstream { +z_stream z; +unsigned long avail_in; +unsigned long avail_out; +unsigned long total_in; +unsigned long total_out; +unsigned char *next_in; +unsigned char *next_out; +}git_zstream ; + +void git_inflate_init (git_zstream *); +void git_inflate_init_gzip_only (git_zstream *); +void git_inflate_end (git_zstream *); +int git_inflate (git_zstream *,int flush); + +void git_deflate_init (git_zstream *,int level); +void git_deflate_init_gzip (git_zstream *,int level); +void git_deflate_init_raw (git_zstream *,int level); +void git_deflate_end (git_zstream *); +int git_deflate_abort (git_zstream *); +int git_deflate_end_gently (git_zstream *); +int git_deflate (git_zstream *,int flush); +unsigned long git_deflate_bound (git_zstream *,unsigned long ); + +#endif /* GIT_ZLIB_H */
http-backend.c +1 -0
@@ -2,6 +2,7 @@#include "alloc.h" #include "config.h" #include "environment.h" +#include "git-zlib.h" #include "hex.h" #include "repository.h" #include "refs.h"
http.h +3 -0
@@ -1,7 +1,10 @@#ifndef HTTP_H #define HTTP_H +struct packed_git ; +#include "cache.h" +#include "git-zlib.h" #include <curl/curl.h> #include <curl/easy.h>
Signature · 1 line
gitgitgadget
PATCH v2 9/24 treewide: remove cache.h inclusion due to object-name.h changes
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
--- branch.c | 1 - checkout.c | 3 ++- fmt-merge-msg.c | 2 +- mailmap.c | 2 +- notes.c | 2 +- refs.c | 2 +- remote.c | 2 +- setup.c | 2 +- strbuf.c | 2 +- t/helper/test-oidmap.c | 1 - t/helper/test-reach.c | 1 - t/helper/test-submodule-config.c | 1 - transport-helper.c | 2 +- 13 files changed, 10 insertions(+), 13 deletions(-)
branch.c +0 -1
@@ -1,5 +1,4 @@#include "git-compat-util.h" -#include "cache.h" #include "advice.h" #include "config.h" #include "branch.h"
checkout.c +2 -1
@@ -1,9 +1,10 @@ -#include "cache.h" +#include "git-compat-util.h" #include "object-name.h" #include "remote.h" #include "refspec.h" #include "checkout.h" #include "config.h" +#include "strbuf.h" struct tracking_name_data {/* const */ char *src_ref;
fmt-merge-msg.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "alloc.h" #include "config.h" #include "environment.h"
mailmap.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "environment.h" #include "string-list.h" #include "mailmap.h"
notes.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "config.h" #include "environment.h" #include "hex.h"
refs.c +1 -1
@@ -2,7 +2,7 @@* The backend-independent part of the reference module. */ -#include "cache.h" +#include "git-compat-util.h" #include "advice.h" #include "alloc.h" #include "config.h"
remote.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "abspath.h" #include "alloc.h" #include "config.h"
setup.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "abspath.h" #include "environment.h" #include "gettext.h"
strbuf.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "abspath.h" #include "alloc.h" #include "environment.h"
t/helper/test-oidmap.c +0 -1
@@ -1,5 +1,4 @@#include "test-tool.h" -#include "cache.h" #include "hex.h" #include "object-name.h" #include "oidmap.h"
t/helper/test-reach.c +0 -1
@@ -1,5 +1,4 @@#include "test-tool.h" -#include "cache.h" #include "alloc.h" #include "commit.h" #include "commit-reach.h"
t/helper/test-submodule-config.c +0 -1
@@ -1,5 +1,4 @@#include "test-tool.h" -#include "cache.h" #include "config.h" #include "object-name.h" #include "setup.h"
transport-helper.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "transport.h" #include "quote.h" #include "run-command.h"
Signature · 1 line
gitgitgadget
PATCH v2 8/24 object-name.h: move declarations for object-name.c functions from cache.h
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
--- add-patch.c | 1 + apply.c | 1 + archive.h | 1 + bisect.c | 1 + branch.c | 1 + builtin/am.c | 1 + builtin/bisect.c | 1 + builtin/blame.c | 1 + builtin/branch.c | 1 + builtin/cat-file.c | 1 + builtin/check-attr.c | 1 + builtin/checkout.c | 1 + builtin/commit-tree.c | 1 + builtin/commit.c | 1 + builtin/describe.c | 1 + builtin/fast-import.c | 1 + builtin/fetch.c | 1 + builtin/fsck.c | 1 + builtin/grep.c | 1 + builtin/log.c | 1 + builtin/ls-files.c | 1 + builtin/ls-tree.c | 1 + builtin/merge-base.c | 1 + builtin/merge-recursive.c | 1 + builtin/merge-tree.c | 1 + builtin/merge.c | 1 + builtin/name-rev.c | 1 + builtin/notes.c | 1 + builtin/prune.c | 1 + builtin/pull.c | 1 + builtin/range-diff.c | 1 + builtin/read-tree.c | 1 + builtin/rebase.c | 1 + builtin/receive-pack.c | 1 + builtin/replace.c | 1 + builtin/reset.c | 1 + builtin/rev-list.c | 1 + builtin/rev-parse.c | 1 + builtin/rm.c | 1 + builtin/show-branch.c | 1 + builtin/show-ref.c | 1 + builtin/sparse-checkout.c | 1 + builtin/stash.c | 1 + builtin/submodule--helper.c | 1 + builtin/tag.c | 1 + builtin/unpack-file.c | 1 + builtin/update-ref.c | 1 + builtin/verify-commit.c | 1 + builtin/verify-tag.c | 1 + builtin/worktree.c | 1 + cache.h | 110 ---------------------------- checkout.c | 1 + combine-diff.c | 1 + commit.c | 1 + config.c | 1 + diff-lib.c | 1 + diff.c | 1 + fmt-merge-msg.c | 1 + list-objects-filter.c | 1 + log-tree.c | 1 + mailmap.c | 1 + merge-ort.c | 1 + merge-recursive.c | 1 + notes-merge.c | 1 + notes.c | 1 + object-name.c | 1 + object-name.h | 121 +++++++++++++++++++++++++++++++ parse-options-cb.c | 1 + range-diff.c | 1 + read-cache.c | 1 + rebase-interactive.c | 1 + ref-filter.c | 1 + refs.c | 1 + remote.c | 1 + reset.c | 1 + revision.c | 1 + sequencer.c | 1 + setup.c | 1 + strbuf.c | 1 + submodule-config.c | 1 + submodule.c | 1 + t/helper/test-fast-rebase.c | 1 + t/helper/test-match-trees.c | 1 + t/helper/test-oidmap.c | 1 + t/helper/test-reach.c | 1 + t/helper/test-submodule-config.c | 1 + tag.c | 1 + transport-helper.c | 1 + transport.c | 1 + tree.c | 1 + wt-status.c | 1 + 91 files changed, 210 insertions(+), 110 deletions(-) create mode 100644 object-name.h
add-patch.c +1 -0
@@ -4,6 +4,7 @@#include "alloc.h" #include "environment.h" #include "gettext.h" +#include "object-name.h" #include "strbuf.h" #include "run-command.h" #include "strvec.h"
apply.c +1 -0
@@ -22,6 +22,7 @@#include "xdiff-interface.h" #include "ll-merge.h" #include "lockfile.h" +#include "object-name.h" #include "parse-options.h" #include "quote.h" #include "rerere.h"
archive.h +1 -0
@@ -2,6 +2,7 @@#define ARCHIVE_H #include "cache.h" +#include "object-name.h" #include "pathspec.h" struct repository ;
bisect.c +1 -0
@@ -17,6 +17,7 @@#include "strvec.h" #include "commit-slab.h" #include "commit-reach.h" +#include "object-name.h" #include "object-store.h" #include "dir.h"
branch.c +1 -0
@@ -6,6 +6,7 @@#include "environment.h" #include "gettext.h" #include "hex.h" +#include "object-name.h" #include "refs.h" #include "refspec.h" #include "remote.h"
builtin/am.c +1 -0
@@ -27,6 +27,7 @@#include "diffcore.h" #include "unpack-trees.h" #include "branch.h" +#include "object-name.h" #include "sequencer.h" #include "revision.h" #include "merge-recursive.h"
builtin/bisect.c +1 -0
@@ -3,6 +3,7 @@#include "environment.h" #include "gettext.h" #include "hex.h" +#include "object-name.h" #include "parse-options.h" #include "bisect.h" #include "refs.h"
builtin/blame.c +1 -0
@@ -28,6 +28,7 @@#include "line-log.h" #include "dir.h" #include "progress.h" +#include "object-name.h" #include "object-store.h" #include "blame.h" #include "refs.h"
builtin/branch.c +1 -0
@@ -13,6 +13,7 @@#include "commit.h" #include "builtin.h" #include "gettext.h" +#include "object-name.h" #include "remote.h" #include "parse-options.h" #include "branch.h"
builtin/cat-file.c +1 -0
@@ -20,6 +20,7 @@#include "tree-walk.h" #include "oid-array.h" #include "packfile.h" +#include "object-name.h" #include "object-store.h" #include "replace-object.h" #include "promisor-remote.h"
builtin/check-attr.c +1 -0
@@ -5,6 +5,7 @@#include "attr.h" #include "environment.h" #include "gettext.h" +#include "object-name.h" #include "quote.h" #include "setup.h" #include "parse-options.h"
builtin/checkout.c +1 -0
@@ -17,6 +17,7 @@#include "lockfile.h" #include "mem-pool.h" #include "merge-recursive.h" +#include "object-name.h" #include "object-store.h" #include "parse-options.h" #include "refs.h"
builtin/commit-tree.c +1 -0
@@ -7,6 +7,7 @@#include "config.h" #include "gettext.h" #include "hex.h" +#include "object-name.h" #include "object-store.h" #include "repository.h" #include "commit.h"
builtin/commit.c +1 -0
@@ -27,6 +27,7 @@#include "log-tree.h" #include "strbuf.h" #include "utf8.h" +#include "object-name.h" #include "parse-options.h" #include "string-list.h" #include "rerere.h"
builtin/describe.c +1 -0
@@ -11,6 +11,7 @@#include "refs.h" #include "builtin.h" #include "exec-cmd.h" +#include "object-name.h" #include "parse-options.h" #include "revision.h" #include "diff.h"
builtin/fast-import.c +1 -0
@@ -19,6 +19,7 @@#include "dir.h" #include "run-command.h" #include "packfile.h" +#include "object-name.h" #include "object-store.h" #include "mem-pool.h" #include "commit-reach.h"
builtin/fetch.c +1 -0
@@ -10,6 +10,7 @@#include "repository.h" #include "refs.h" #include "refspec.h" +#include "object-name.h" #include "object-store.h" #include "oidset.h" #include "oid-array.h"
builtin/fsck.c +1 -0
@@ -19,6 +19,7 @@#include "streaming.h" #include "decorate.h" #include "packfile.h" +#include "object-name.h" #include "object-store.h" #include "replace-object.h" #include "resolve-undo.h"
builtin/grep.c +1 -0
@@ -26,6 +26,7 @@#include "setup.h" #include "submodule.h" #include "submodule-config.h" +#include "object-name.h" #include "object-store.h" #include "packfile.h" #include "write-or-die.h"
builtin/log.c +1 -0
@@ -12,6 +12,7 @@#include "gettext.h" #include "hex.h" #include "refs.h" +#include "object-name.h" #include "object-store.h" #include "color.h" #include "commit.h"
builtin/ls-files.c +1 -0
@@ -13,6 +13,7 @@#include "dir.h" #include "builtin.h" #include "gettext.h" +#include "object-name.h" #include "strbuf.h" #include "tree.h" #include "cache-tree.h"
builtin/ls-tree.c +1 -0
@@ -7,6 +7,7 @@#include "config.h" #include "gettext.h" #include "hex.h" +#include "object-name.h" #include "object-store.h" #include "blob.h" #include "tree.h"
builtin/merge-base.c +1 -0
@@ -7,6 +7,7 @@#include "refs.h" #include "diff.h" #include "revision.h" +#include "object-name.h" #include "parse-options.h" #include "repository.h" #include "commit-reach.h"
builtin/merge-recursive.c +1 -0
@@ -5,6 +5,7 @@#include "gettext.h" #include "tag.h" #include "merge-recursive.h" +#include "object-name.h" #include "xdiff-interface.h" static const char builtin_merge_recursive_usage[] =
builtin/merge-tree.c +1 -0
@@ -8,6 +8,7 @@#include "commit.h" #include "commit-reach.h" #include "merge-ort.h" +#include "object-name.h" #include "object-store.h" #include "parse-options.h" #include "repository.h"
builtin/merge.c +1 -0
@@ -15,6 +15,7 @@#include "environment.h" #include "gettext.h" #include "hex.h" +#include "object-name.h" #include "parse-options.h" #include "builtin.h" #include "lockfile.h"
builtin/name-rev.c +1 -0
@@ -8,6 +8,7 @@#include "commit.h" #include "tag.h" #include "refs.h" +#include "object-name.h" #include "parse-options.h" #include "prio-queue.h" #include "hash-lookup.h"
builtin/notes.c +1 -0
@@ -13,6 +13,7 @@#include "gettext.h" #include "hex.h" #include "notes.h" +#include "object-name.h" #include "object-store.h" #include "repository.h" #include "blob.h"
builtin/prune.c +1 -0
@@ -11,6 +11,7 @@#include "progress.h" #include "prune-packed.h" #include "replace-object.h" +#include "object-name.h" #include "object-store.h" #include "shallow.h"
builtin/pull.c +1 -0
@@ -12,6 +12,7 @@#include "builtin.h" #include "gettext.h" #include "hex.h" +#include "object-name.h" #include "parse-options.h" #include "exec-cmd.h" #include "run-command.h"
builtin/range-diff.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "builtin.h" #include "gettext.h" +#include "object-name.h" #include "parse-options.h" #include "range-diff.h" #include "config.h"
builtin/read-tree.c +1 -0
@@ -11,6 +11,7 @@#include "hex.h" #include "lockfile.h" #include "object.h" +#include "object-name.h" #include "tree.h" #include "tree-walk.h" #include "cache-tree.h"
builtin/rebase.c +1 -0
@@ -21,6 +21,7 @@#include "cache-tree.h" #include "unpack-trees.h" #include "lockfile.h" +#include "object-name.h" #include "parse-options.h" #include "commit.h" #include "diff.h"
builtin/receive-pack.c +1 -0
@@ -29,6 +29,7 @@#include "tmp-objdir.h" #include "oidset.h" #include "packfile.h" +#include "object-name.h" #include "object-store.h" #include "protocol.h" #include "commit-reach.h"
builtin/replace.c +1 -0
@@ -17,6 +17,7 @@#include "refs.h" #include "parse-options.h" #include "run-command.h" +#include "object-name.h" #include "object-store.h" #include "replace-object.h" #include "repository.h"
builtin/reset.c +1 -0
@@ -24,6 +24,7 @@#include "diffcore.h" #include "tree.h" #include "branch.h" +#include "object-name.h" #include "parse-options.h" #include "unpack-trees.h" #include "cache-tree.h"
builtin/rev-list.c +1 -0
@@ -10,6 +10,7 @@#include "list-objects-filter.h" #include "list-objects-filter-options.h" #include "object.h" +#include "object-name.h" #include "object-store.h" #include "pack.h" #include "pack-bitmap.h"
builtin/rev-parse.c +1 -0
@@ -15,6 +15,7 @@#include "refs.h" #include "quote.h" #include "builtin.h" +#include "object-name.h" #include "parse-options.h" #include "diff.h" #include "revision.h"
builtin/rm.c +1 -0
@@ -13,6 +13,7 @@#include "cache-tree.h" #include "gettext.h" #include "tree-walk.h" +#include "object-name.h" #include "parse-options.h" #include "string-list.h" #include "setup.h"
builtin/show-branch.c +1 -0
@@ -8,6 +8,7 @@#include "builtin.h" #include "color.h" #include "strvec.h" +#include "object-name.h" #include "parse-options.h" #include "dir.h" #include "commit-slab.h"
builtin/show-ref.c +1 -0
@@ -4,6 +4,7 @@#include "gettext.h" #include "hex.h" #include "refs.h" +#include "object-name.h" #include "object-store.h" #include "object.h" #include "tag.h"
builtin/sparse-checkout.c +1 -0
@@ -4,6 +4,7 @@#include "dir.h" #include "environment.h" #include "gettext.h" +#include "object-name.h" #include "parse-options.h" #include "pathspec.h" #include "repository.h"
builtin/stash.c +1 -0
@@ -5,6 +5,7 @@#include "environment.h" #include "gettext.h" #include "hex.h" +#include "object-name.h" #include "parse-options.h" #include "refs.h" #include "lockfile.h"
builtin/submodule--helper.c +1 -0
@@ -24,6 +24,7 @@#include "revision.h" #include "diffcore.h" #include "diff.h" +#include "object-name.h" #include "object-store.h" #include "advice.h" #include "branch.h"
builtin/tag.c +1 -0
@@ -14,6 +14,7 @@#include "gettext.h" #include "hex.h" #include "refs.h" +#include "object-name.h" #include "object-store.h" #include "tag.h" #include "run-command.h"
builtin/unpack-file.c +1 -0
@@ -1,6 +1,7 @@#include "builtin.h" #include "config.h" #include "hex.h" +#include "object-name.h" #include "object-store.h" #include "wrapper.h"
builtin/update-ref.c +1 -0
@@ -3,6 +3,7 @@#include "gettext.h" #include "refs.h" #include "builtin.h" +#include "object-name.h" #include "parse-options.h" #include "quote.h" #include "strvec.h"
builtin/verify-commit.c +1 -0
@@ -9,6 +9,7 @@#include "config.h" #include "builtin.h" #include "gettext.h" +#include "object-name.h" #include "object-store.h" #include "repository.h" #include "commit.h"
builtin/verify-tag.c +1 -0
@@ -11,6 +11,7 @@#include "gettext.h" #include "tag.h" #include "run-command.h" +#include "object-name.h" #include "parse-options.h" #include "gpg-interface.h" #include "ref-filter.h"
builtin/worktree.c +1 -0
@@ -7,6 +7,7 @@#include "environment.h" #include "gettext.h" #include "hex.h" +#include "object-name.h" #include "parse-options.h" #include "strvec.h" #include "branch.h"
cache.h +0 -110
128 lines not on this page · raw message
checkout.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "object-name.h" #include "remote.h" #include "refspec.h" #include "checkout.h"
combine-diff.c +1 -0
@@ -7,6 +7,7 @@#include "diffcore.h" #include "environment.h" #include "hex.h" +#include "object-name.h" #include "quote.h" #include "xdiff-interface.h" #include "xdiff/xmacros.h"
commit.c +1 -0
@@ -6,6 +6,7 @@#include "gettext.h" #include "hex.h" #include "repository.h" +#include "object-name.h" #include "object-store.h" #include "pkt-line.h" #include "utf8.h"
config.c +1 -0
@@ -23,6 +23,7 @@#include "quote.h" #include "hashmap.h" #include "string-list.h" +#include "object-name.h" #include "object-store.h" #include "utf8.h" #include "dir.h"
diff-lib.c +1 -0
@@ -8,6 +8,7 @@#include "diffcore.h" #include "gettext.h" #include "hex.h" +#include "object-name.h" #include "revision.h" #include "cache-tree.h" #include "unpack-trees.h"
diff.c +1 -0
@@ -35,6 +35,7 @@#include "help.h" #include "promisor-remote.h" #include "dir.h" +#include "object-name.h" #include "setup.h" #include "strmap.h" #include "wrapper.h"
fmt-merge-msg.c +1 -0
@@ -3,6 +3,7 @@#include "config.h" #include "environment.h" #include "refs.h" +#include "object-name.h" #include "object-store.h" #include "diff.h" #include "diff-merges.h"
list-objects-filter.c +1 -0
@@ -15,6 +15,7 @@#include "list-objects-filter-options.h" #include "oidmap.h" #include "oidset.h" +#include "object-name.h" #include "object-store.h" /* Remember to update object flag allocation in object.h */
log-tree.c +1 -0
@@ -4,6 +4,7 @@#include "diff.h" #include "environment.h" #include "hex.h" +#include "object-name.h" #include "object-store.h" #include "repository.h" #include "tmp-objdir.h"
mailmap.c +1 -0
@@ -2,6 +2,7 @@#include "environment.h" #include "string-list.h" #include "mailmap.h" +#include "object-name.h" #include "object-store.h" #include "setup.h"
merge-ort.c +1 -0
@@ -32,6 +32,7 @@#include "entry.h" #include "ll-merge.h" #include "mem-pool.h" +#include "object-name.h" #include "object-store.h" #include "oid-array.h" #include "promisor-remote.h"
merge-recursive.c +1 -0
@@ -22,6 +22,7 @@#include "hex.h" #include "ll-merge.h" #include "lockfile.h" +#include "object-name.h" #include "object-store.h" #include "repository.h" #include "revision.h"
notes-merge.c +1 -0
@@ -3,6 +3,7 @@#include "commit.h" #include "gettext.h" #include "refs.h" +#include "object-name.h" #include "object-store.h" #include "repository.h" #include "diff.h"
notes.c +1 -0
@@ -3,6 +3,7 @@#include "environment.h" #include "hex.h" #include "notes.h" +#include "object-name.h" #include "object-store.h" #include "blob.h" #include "tree.h"
object-name.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "object-name.h" #include "advice.h" #include "config.h" #include "environment.h"
object-name.h new file +121 -0
121 lines not on this page · raw message
parse-options-cb.c +1 -0
@@ -6,6 +6,7 @@#include "color.h" #include "environment.h" #include "gettext.h" +#include "object-name.h" #include "string-list.h" #include "strvec.h" #include "oid-array.h"
range-diff.c +1 -0
@@ -2,6 +2,7 @@#include "environment.h" #include "gettext.h" #include "range-diff.h" +#include "object-name.h" #include "string-list.h" #include "run-command.h" #include "strvec.h"
read-cache.c +1 -0
@@ -22,6 +22,7 @@#include "environment.h" #include "gettext.h" #include "mem-pool.h" +#include "object-name.h" #include "resolve-undo.h" #include "run-command.h" #include "strbuf.h"
rebase-interactive.c +1 -0
@@ -8,6 +8,7 @@#include "commit-slab.h" #include "config.h" #include "dir.h" +#include "object-name.h" #include "wrapper.h" static const char edit_todo_list_advice[] =
ref-filter.c +1 -0
@@ -6,6 +6,7 @@#include "parse-options.h" #include "refs.h" #include "wildmatch.h" +#include "object-name.h" #include "object-store.h" #include "oid-array.h" #include "repository.h"
refs.c +1 -0
@@ -16,6 +16,7 @@#include "refs/refs-internal.h" #include "run-command.h" #include "hook.h" +#include "object-name.h" #include "object-store.h" #include "object.h" #include "tag.h"
remote.c +1 -0
@@ -9,6 +9,7 @@#include "urlmatch.h" #include "refs.h" #include "refspec.h" +#include "object-name.h" #include "object-store.h" #include "commit.h" #include "diff.h"
reset.c +1 -0
@@ -3,6 +3,7 @@#include "gettext.h" #include "hex.h" #include "lockfile.h" +#include "object-name.h" #include "refs.h" #include "reset.h" #include "run-command.h"
revision.c +1 -0
@@ -4,6 +4,7 @@#include "environment.h" #include "gettext.h" #include "hex.h" +#include "object-name.h" #include "object-store.h" #include "tag.h" #include "blob.h"
sequencer.c +1 -0
@@ -8,6 +8,7 @@#include "hex.h" #include "lockfile.h" #include "dir.h" +#include "object-name.h" #include "object-store.h" #include "object.h" #include "commit.h"
setup.c +1 -0
@@ -2,6 +2,7 @@#include "abspath.h" #include "environment.h" #include "gettext.h" +#include "object-name.h" #include "repository.h" #include "config.h" #include "dir.h"
strbuf.c +1 -0
@@ -4,6 +4,7 @@#include "environment.h" #include "gettext.h" #include "hex.h" +#include "object-name.h" #include "refs.h" #include "string-list.h" #include "utf8.h"
submodule-config.c +1 -0
@@ -9,6 +9,7 @@#include "submodule-config.h" #include "submodule.h" #include "strbuf.h" +#include "object-name.h" #include "object-store.h" #include "parse-options.h" #include "tree-walk.h"
submodule.c +1 -0
@@ -24,6 +24,7 @@#include "remote.h" #include "worktree.h" #include "parse-options.h" +#include "object-name.h" #include "object-store.h" #include "commit-reach.h" #include "setup.h"
t/helper/test-fast-rebase.c +1 -0
@@ -20,6 +20,7 @@#include "hex.h" #include "lockfile.h" #include "merge-ort.h" +#include "object-name.h" #include "refs.h" #include "revision.h" #include "sequencer.h"
t/helper/test-match-trees.c +1 -0
@@ -1,6 +1,7 @@#include "test-tool.h" #include "cache.h" #include "hex.h" +#include "object-name.h" #include "setup.h" #include "tree.h"
t/helper/test-oidmap.c +1 -0
@@ -1,6 +1,7 @@#include "test-tool.h" #include "cache.h" #include "hex.h" +#include "object-name.h" #include "oidmap.h" #include "setup.h" #include "strbuf.h"
t/helper/test-reach.c +1 -0
@@ -6,6 +6,7 @@#include "config.h" #include "gettext.h" #include "hex.h" +#include "object-name.h" #include "parse-options.h" #include "ref-filter.h" #include "setup.h"
t/helper/test-submodule-config.c +1 -0
@@ -1,6 +1,7 @@#include "test-tool.h" #include "cache.h" #include "config.h" +#include "object-name.h" #include "setup.h" #include "submodule-config.h" #include "submodule.h"
tag.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "environment.h" #include "tag.h" +#include "object-name.h" #include "object-store.h" #include "commit.h" #include "tree.h"
transport-helper.c +1 -0
@@ -7,6 +7,7 @@#include "environment.h" #include "gettext.h" #include "hex.h" +#include "object-name.h" #include "revision.h" #include "remote.h" #include "string-list.h"
transport.c +1 -0
@@ -26,6 +26,7 @@#include "trace2.h" #include "transport-internal.h" #include "protocol.h" +#include "object-name.h" #include "object-store.h" #include "color.h" #include "bundle-uri.h"
tree.c +1 -0
@@ -2,6 +2,7 @@#include "cache-tree.h" #include "hex.h" #include "tree.h" +#include "object-name.h" #include "object-store.h" #include "blob.h" #include "commit.h"
wt-status.c +1 -0
@@ -8,6 +8,7 @@#include "environment.h" #include "gettext.h" #include "hex.h" +#include "object-name.h" #include "revision.h" #include "diffcore.h" #include "quote.h"
Signature · 1 line
gitgitgadget
PATCH v2 13/24 treewide: remove cache.h inclusion due to object-file.h changes
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
--- bulk-checkin.c | 2 +- commit-graph.c | 2 +- http-fetch.c | 2 +- http-walker.c | 2 +- http.h | 1 - notes-merge.c | 2 +- pack-bitmap.c | 2 +- pack-check.c | 2 +- pack-mtimes.c | 2 +- pack-revindex.c | 2 +- streaming.c | 2 +- tmp-objdir.c | 2 +- 12 files changed, 11 insertions(+), 12 deletions(-)
bulk-checkin.c +1 -1
@@ -1,7 +1,7 @@/* * Copyright (c) 2011, Google Inc. */ -#include "cache.h" +#include "git-compat-util.h" #include "alloc.h" #include "bulk-checkin.h" #include "environment.h"
commit-graph.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "config.h" #include "gettext.h" #include "hex.h"
http-fetch.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "config.h" #include "exec-cmd.h" #include "gettext.h"
http-walker.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "repository.h" #include "commit.h" #include "hex.h"
http.h +0 -1
@@ -3,7 +3,6 @@struct packed_git ; -#include "cache.h" #include "git-zlib.h" #include <curl/curl.h>
notes-merge.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "advice.h" #include "commit.h" #include "gettext.h"
pack-bitmap.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "alloc.h" #include "commit.h" #include "gettext.h"
pack-check.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "environment.h" #include "hex.h" #include "repository.h"
pack-mtimes.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "gettext.h" #include "pack-mtimes.h" #include "object-file.h"
pack-revindex.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "gettext.h" #include "pack-revindex.h" #include "object-file.h"
streaming.c +1 -1
@@ -1,7 +1,7 @@/* * Copyright (c) 2011, Google Inc. */ -#include "cache.h" +#include "git-compat-util.h" #include "convert.h" #include "environment.h" #include "streaming.h"
tmp-objdir.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "tmp-objdir.h" #include "abspath.h" #include "chdir-notify.h"
Signature · 1 line
gitgitgadget
PATCH v2 17/24 treewide: remove cache.h inclusion due to editor.h changes
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
This actually only affects sideband.c, but helps towards removing cache.h inclusion in conjunction with some of the upcoming patches that will be applied.
--- sideband.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sideband.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "color.h" #include "config.h" #include "editor.h"
Signature · 1 line
gitgitgadget
PATCH v2 14/24 object.h: move some inline functions and defines from cache.h
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
The object_type() inline function is very tied to the enum object_type declaration within object.h, and just seemed to make more sense to live there. That makes S_ISGITLINK and some other defines make sense to go with it, as well as the create_ce_mode() and canon_mode() inline functions. Move all these inline functions and defines from cache.h to object.h.
--- cache.h | 42 ------------------------------------------ object.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 42 deletions(-)
cache.h +0 -42
@@ -28,18 +28,6 @@#define DTYPE (de) DT_UNKNOWN#endif -/* unknown mode (impossible combination S_IFIFO|S_IFCHR) */ -#define S_IFINVALID 0030000 - -/* -* A "directory link" is a link to another git directory. -* -* The value 0160000 is not normally a valid mode, and -* also just happens to be S_IFDIR + S_IFLNK -*/ -#define S_IFGITLINK 0160000 -#define S_ISGITLINK (m) (((m) & S_IFMT) == S_IFGITLINK) -/* * Some mode bits are also used internally for computations. *
@@ -155,8 +143,6 @@ struct cache_entry {#error "CE_EXTENDED_FLAGS out of range"#endif -#define S_ISSPARSEDIR (m) ((m) == S_IFDIR) -/* Forward structure decls */ struct pathspec ;struct child_process ;
@@ -197,17 +183,6 @@ static inline unsigned create_ce_flags(unsigned stage)#define ce_mark_uptodate (ce) ((ce)->ce_flags |= CE_UPTODATE)#define ce_intent_to_add (ce) ((ce)->ce_flags & CE_INTENT_TO_ADD) -#define ce_permissions (mode) (((mode) & 0100) ? 0755 : 0644) -static inline unsigned int create_ce_mode (unsigned int mode) -{ -if (S_ISLNK (mode)) -return S_IFLNK ; -if (S_ISSPARSEDIR (mode)) -return S_IFDIR ; -if (S_ISDIR (mode) ||S_ISGITLINK (mode)) -return S_IFGITLINK ; -return S_IFREG |ce_permissions (mode); -}static inline unsigned int ce_mode_from_stat (const struct cache_entry *ce,unsigned int mode) {
@@ -234,16 +209,6 @@ static inline int ce_to_dtype(const struct cache_entry *ce)else return DT_UNKNOWN ; } -static inline unsigned int canon_mode (unsigned int mode) -{ -if (S_ISREG (mode)) -return S_IFREG |ce_permissions (mode); -if (S_ISLNK (mode)) -return S_IFLNK ; -if (S_ISDIR (mode)) -return S_IFDIR ; -return S_IFGITLINK ; -} static inline int ce_path_match(struct index_state *istate, const struct cache_entry *ce,
@@ -414,13 +379,6 @@ void prefetch_cache_entries(const struct index_state *istate,extern struct index_state the_index;#endif -static inline enum object_type object_type (unsigned int mode) -{ -return S_ISDIR (mode) ?OBJ_TREE : -S_ISGITLINK (mode) ?OBJ_COMMIT : -OBJ_BLOB ; -} -#define INIT_DB_QUIET 0x0001#define INIT_DB_EXIST_OK 0x0002
object.h +44 -0
50 lines not on this page · raw message
Signature · 1 line
gitgitgadget
PATCH v2 12/24 object-file.h: move declarations for object-file.c functions from cache.h
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
--- apply.c | 1 + builtin/bugreport.c | 1 + builtin/cat-file.c | 1 + builtin/clone.c | 1 + builtin/credential-cache--daemon.c | 1 + builtin/diagnose.c | 1 + builtin/difftool.c | 1 + builtin/fast-export.c | 1 + builtin/fast-import.c | 1 + builtin/fetch-pack.c | 1 + builtin/fsck.c | 1 + builtin/gc.c | 1 + builtin/grep.c | 1 + builtin/hash-object.c | 1 + builtin/index-pack.c | 1 + builtin/init-db.c | 1 + builtin/log.c | 1 + builtin/mktag.c | 1 + builtin/mv.c | 1 + builtin/pack-objects.c | 1 + builtin/prune.c | 1 + builtin/rebase.c | 1 + builtin/replace.c | 1 + builtin/rev-list.c | 1 + builtin/sparse-checkout.c | 1 + builtin/submodule--helper.c | 1 + builtin/update-index.c | 1 + builtin/worktree.c | 1 + bulk-checkin.c | 1 + cache-tree.c | 1 + cache.h | 123 --------------------------- commit-graph.c | 1 + diff.c | 1 + dir.c | 1 + environment.c | 1 + http.c | 1 + merge-recursive.c | 1 + midx.c | 1 + notes-merge.c | 1 + object-file.c | 1 + object-file.h | 129 +++++++++++++++++++++++++++++ object.c | 1 + pack-bitmap.c | 1 + pack-check.c | 1 + pack-mtimes.c | 1 + pack-revindex.c | 1 + packfile.c | 1 + read-cache.c | 1 + refs/files-backend.c | 1 + rerere.c | 1 + revision.c | 1 + sequencer.c | 1 + server-info.c | 1 + streaming.c | 1 + submodule.c | 1 + tmp-objdir.c | 1 + tree-walk.c | 1 + 57 files changed, 184 insertions(+), 123 deletions(-) create mode 100644 object-file.h
apply.c +1 -0
@@ -23,6 +23,7 @@#include "ll-merge.h" #include "lockfile.h" #include "object-name.h" +#include "object-file.h" #include "parse-options.h" #include "quote.h" #include "rerere.h"
builtin/bugreport.c +1 -0
@@ -8,6 +8,7 @@#include "hook.h" #include "hook-list.h" #include "diagnose.h" +#include "object-file.h" #include "setup.h" #include "wrapper.h"
builtin/cat-file.c +1 -0
@@ -20,6 +20,7 @@#include "tree-walk.h" #include "oid-array.h" #include "packfile.h" +#include "object-file.h" #include "object-name.h" #include "object-store.h" #include "replace-object.h"
builtin/clone.c +1 -0
@@ -21,6 +21,7 @@#include "fetch-pack.h" #include "refs.h" #include "refspec.h" +#include "object-file.h" #include "object-store.h" #include "tree.h" #include "tree-walk.h"
builtin/credential-cache--daemon.c +1 -0
@@ -2,6 +2,7 @@#include "abspath.h" #include "alloc.h" #include "gettext.h" +#include "object-file.h" #include "parse-options.h" #ifndef NO_UNIX_SOCKETS
builtin/diagnose.c +1 -0
@@ -1,6 +1,7 @@#include "builtin.h" #include "abspath.h" #include "gettext.h" +#include "object-file.h" #include "parse-options.h" #include "diagnose.h"
builtin/difftool.c +1 -0
@@ -25,6 +25,7 @@#include "strvec.h" #include "strbuf.h" #include "lockfile.h" +#include "object-file.h" #include "object-store.h" #include "dir.h" #include "entry.h"
builtin/fast-export.c +1 -0
@@ -10,6 +10,7 @@#include "hex.h" #include "refs.h" #include "refspec.h" +#include "object-file.h" #include "object-store.h" #include "commit.h" #include "object.h"
builtin/fast-import.c +1 -0
@@ -19,6 +19,7 @@#include "dir.h" #include "run-command.h" #include "packfile.h" +#include "object-file.h" #include "object-name.h" #include "object-store.h" #include "mem-pool.h"
builtin/fetch-pack.c +1 -0
@@ -2,6 +2,7 @@#include "alloc.h" #include "gettext.h" #include "hex.h" +#include "object-file.h" #include "pkt-line.h" #include "fetch-pack.h" #include "remote.h"
builtin/fsck.c +1 -0
@@ -19,6 +19,7 @@#include "streaming.h" #include "decorate.h" #include "packfile.h" +#include "object-file.h" #include "object-name.h" #include "object-store.h" #include "replace-object.h"
builtin/gc.c +1 -0
@@ -25,6 +25,7 @@#include "commit.h" #include "commit-graph.h" #include "packfile.h" +#include "object-file.h" #include "object-store.h" #include "pack.h" #include "pack-objects.h"
builtin/grep.c +1 -0
@@ -26,6 +26,7 @@#include "setup.h" #include "submodule.h" #include "submodule-config.h" +#include "object-file.h" #include "object-name.h" #include "object-store.h" #include "packfile.h"
builtin/hash-object.c +1 -0
@@ -9,6 +9,7 @@#include "config.h" #include "gettext.h" #include "hex.h" +#include "object-file.h" #include "object-store.h" #include "blob.h" #include "quote.h"
builtin/index-pack.c +1 -0
@@ -18,6 +18,7 @@#include "thread-utils.h" #include "packfile.h" #include "pack-revindex.h" +#include "object-file.h" #include "object-store.h" #include "oid-array.h" #include "replace-object.h"
builtin/init-db.c +1 -0
@@ -11,6 +11,7 @@#include "refs.h" #include "builtin.h" #include "exec-cmd.h" +#include "object-file.h" #include "parse-options.h" #include "setup.h" #include "worktree.h"
builtin/log.c +1 -0
@@ -12,6 +12,7 @@#include "gettext.h" #include "hex.h" #include "refs.h" +#include "object-file.h" #include "object-name.h" #include "object-store.h" #include "color.h"
builtin/mktag.c +1 -0
@@ -4,6 +4,7 @@#include "parse-options.h" #include "tag.h" #include "replace-object.h" +#include "object-file.h" #include "object-store.h" #include "fsck.h" #include "config.h"
builtin/mv.c +1 -0
@@ -11,6 +11,7 @@#include "config.h" #include "environment.h" #include "gettext.h" +#include "object-file.h" #include "pathspec.h" #include "lockfile.h" #include "dir.h"
builtin/pack-objects.c +1 -0
@@ -33,6 +33,7 @@#include "strvec.h" #include "list.h" #include "packfile.h" +#include "object-file.h" #include "object-store.h" #include "replace-object.h" #include "dir.h"
builtin/prune.c +1 -0
@@ -11,6 +11,7 @@#include "progress.h" #include "prune-packed.h" #include "replace-object.h" +#include "object-file.h" #include "object-name.h" #include "object-store.h" #include "shallow.h"
builtin/rebase.c +1 -0
@@ -21,6 +21,7 @@#include "cache-tree.h" #include "unpack-trees.h" #include "lockfile.h" +#include "object-file.h" #include "object-name.h" #include "parse-options.h" #include "commit.h"
builtin/replace.c +1 -0
@@ -17,6 +17,7 @@#include "refs.h" #include "parse-options.h" #include "run-command.h" +#include "object-file.h" #include "object-name.h" #include "object-store.h" #include "replace-object.h"
builtin/rev-list.c +1 -0
@@ -11,6 +11,7 @@#include "list-objects-filter-options.h" #include "object.h" #include "object-name.h" +#include "object-file.h" #include "object-store.h" #include "pack.h" #include "pack-bitmap.h"
builtin/sparse-checkout.c +1 -0
@@ -4,6 +4,7 @@#include "dir.h" #include "environment.h" #include "gettext.h" +#include "object-file.h" #include "object-name.h" #include "parse-options.h" #include "pathspec.h"
builtin/submodule--helper.c +1 -0
@@ -24,6 +24,7 @@#include "revision.h" #include "diffcore.h" #include "diff.h" +#include "object-file.h" #include "object-name.h" #include "object-store.h" #include "advice.h"
builtin/update-index.c +1 -0
@@ -15,6 +15,7 @@#include "cache-tree.h" #include "tree-walk.h" #include "builtin.h" +#include "object-file.h" #include "refs.h" #include "resolve-undo.h" #include "parse-options.h"
builtin/worktree.c +1 -0
@@ -7,6 +7,7 @@#include "environment.h" #include "gettext.h" #include "hex.h" +#include "object-file.h" #include "object-name.h" #include "parse-options.h" #include "strvec.h"
bulk-checkin.c +1 -0
@@ -15,6 +15,7 @@#include "string-list.h" #include "tmp-objdir.h" #include "packfile.h" +#include "object-file.h" #include "object-store.h" static int odb_transaction_nesting;
cache-tree.c +1 -0
@@ -7,6 +7,7 @@#include "tree-walk.h" #include "cache-tree.h" #include "bulk-checkin.h" +#include "object-file.h" #include "object-store.h" #include "replace-object.h" #include "promisor-remote.h"
cache.h +0 -123
153 lines not on this page · raw message
commit-graph.c +1 -0
@@ -11,6 +11,7 @@#include "revision.h" #include "hash-lookup.h" #include "commit-graph.h" +#include "object-file.h" #include "object-store.h" #include "oid-array.h" #include "alloc.h"
diff.c +1 -0
@@ -35,6 +35,7 @@#include "help.h" #include "promisor-remote.h" #include "dir.h" +#include "object-file.h" #include "object-name.h" #include "setup.h" #include "strmap.h"
dir.c +1 -0
@@ -13,6 +13,7 @@#include "dir.h" #include "environment.h" #include "gettext.h" +#include "object-file.h" #include "object-store.h" #include "attr.h" #include "refs.h"
environment.c +1 -0
@@ -19,6 +19,7 @@#include "fmt-merge-msg.h" #include "commit.h" #include "strvec.h" +#include "object-file.h" #include "object-store.h" #include "replace-object.h" #include "tmp-objdir.h"
http.c +1 -0
@@ -17,6 +17,7 @@#include "packfile.h" #include "protocol.h" #include "string-list.h" +#include "object-file.h" #include "object-store.h" static struct trace_key trace_curl =TRACE_KEY_INIT (CURL );
merge-recursive.c +1 -0
@@ -22,6 +22,7 @@#include "hex.h" #include "ll-merge.h" #include "lockfile.h" +#include "object-file.h" #include "object-name.h" #include "object-store.h" #include "repository.h"
midx.c +1 -0
@@ -8,6 +8,7 @@#include "hex.h" #include "lockfile.h" #include "packfile.h" +#include "object-file.h" #include "object-store.h" #include "hash-lookup.h" #include "midx.h"
notes-merge.c +1 -0
@@ -3,6 +3,7 @@#include "commit.h" #include "gettext.h" #include "refs.h" +#include "object-file.h" #include "object-name.h" #include "object-store.h" #include "repository.h"
object-file.c +1 -0
@@ -36,6 +36,7 @@#include "mergesort.h" #include "quote.h" #include "packfile.h" +#include "object-file.h" #include "object-store.h" #include "promisor-remote.h" #include "setup.h"
object-file.h new file +129 -0
129 lines not on this page · raw message
object.c +1 -0
@@ -3,6 +3,7 @@#include "hex.h" #include "object.h" #include "replace-object.h" +#include "object-file.h" #include "object-store.h" #include "blob.h" #include "tree.h"
pack-bitmap.c +1 -0
@@ -16,6 +16,7 @@#include "packfile.h" #include "repository.h" #include "trace2.h" +#include "object-file.h" #include "object-store.h" #include "list-objects-filter-options.h" #include "midx.h"
pack-check.c +1 -0
@@ -6,6 +6,7 @@#include "pack-revindex.h" #include "progress.h" #include "packfile.h" +#include "object-file.h" #include "object-store.h" struct idx_entry {
pack-mtimes.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "gettext.h" #include "pack-mtimes.h" +#include "object-file.h" #include "object-store.h" #include "packfile.h"
pack-revindex.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "gettext.h" #include "pack-revindex.h" +#include "object-file.h" #include "object-store.h" #include "packfile.h" #include "trace2.h"
packfile.c +1 -0
@@ -18,6 +18,7 @@#include "trace.h" #include "tree-walk.h" #include "tree.h" +#include "object-file.h" #include "object-store.h" #include "midx.h" #include "commit-graph.h"
read-cache.c +1 -0
@@ -14,6 +14,7 @@#include "cache-tree.h" #include "refs.h" #include "dir.h" +#include "object-file.h" #include "object-store.h" #include "oid-array.h" #include "tree.h"
refs/files-backend.c +1 -0
@@ -12,6 +12,7 @@#include "../dir-iterator.h" #include "../lockfile.h" #include "../object.h" +#include "../object-file.h" #include "../dir.h" #include "../chdir-notify.h" #include "../setup.h"
rerere.c +1 -0
@@ -13,6 +13,7 @@#include "ll-merge.h" #include "attr.h" #include "pathspec.h" +#include "object-file.h" #include "object-store.h" #include "hash-lookup.h" #include "strmap.h"
revision.c +1 -0
@@ -5,6 +5,7 @@#include "gettext.h" #include "hex.h" #include "object-name.h" +#include "object-file.h" #include "object-store.h" #include "tag.h" #include "blob.h"
sequencer.c +1 -0
@@ -8,6 +8,7 @@#include "hex.h" #include "lockfile.h" #include "dir.h" +#include "object-file.h" #include "object-name.h" #include "object-store.h" #include "object.h"
server-info.c +1 -0
@@ -9,6 +9,7 @@#include "commit.h" #include "tag.h" #include "packfile.h" +#include "object-file.h" #include "object-store.h" #include "strbuf.h" #include "wrapper.h"
streaming.c +1 -0
@@ -6,6 +6,7 @@#include "environment.h" #include "streaming.h" #include "repository.h" +#include "object-file.h" #include "object-store.h" #include "replace-object.h" #include "packfile.h"
submodule.c +1 -0
@@ -24,6 +24,7 @@#include "remote.h" #include "worktree.h" #include "parse-options.h" +#include "object-file.h" #include "object-name.h" #include "object-store.h" #include "commit-reach.h"
tmp-objdir.c +1 -0
@@ -4,6 +4,7 @@#include "chdir-notify.h" #include "dir.h" #include "environment.h" +#include "object-file.h" #include "sigchain.h" #include "string-list.h" #include "strbuf.h"
tree-walk.c +1 -0
@@ -4,6 +4,7 @@#include "dir.h" #include "gettext.h" #include "hex.h" +#include "object-file.h" #include "object-store.h" #include "trace2.h" #include "tree.h"
Signature · 1 line
gitgitgadget
PATCH v2 15/24 treewide: remove cache.h inclusion due to object.h changes
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
--- bisect.c | 2 +- bundle.c | 2 +- commit.c | 2 +- delta-islands.c | 2 +- diff-no-index.c | 2 +- fsck.c | 2 +- http-push.c | 2 +- list-objects-filter.c | 2 +- list-objects.c | 2 +- log-tree.c | 2 +- pack-bitmap-write.c | 2 +- parse-options-cb.c | 1 - rebase-interactive.c | 2 +- submodule-config.c | 2 +- tag.c | 2 +- transport.c | 2 +- walker.c | 2 +- 17 files changed, 16 insertions(+), 17 deletions(-)
bisect.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "config.h" #include "commit.h" #include "diff.h"
bundle.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "lockfile.h" #include "bundle.h" #include "environment.h"
commit.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "tag.h" #include "commit.h" #include "commit-graph.h"
delta-islands.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "alloc.h" #include "attr.h" #include "object.h"
diff-no-index.c +1 -1
@@ -4,7 +4,7 @@* Copyright (c) 2008 by Junio C Hamano */ -#include "cache.h" +#include "git-compat-util.h" #include "abspath.h" #include "color.h" #include "commit.h"
fsck.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "alloc.h" #include "hex.h" #include "object-store.h"
http-push.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "environment.h" #include "hex.h" #include "repository.h"
list-objects-filter.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "alloc.h" #include "dir.h" #include "gettext.h"
list-objects.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "tag.h" #include "commit.h" #include "gettext.h"
log-tree.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "commit-reach.h" #include "config.h" #include "diff.h"
pack-bitmap-write.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "alloc.h" #include "environment.h" #include "gettext.h"
parse-options-cb.c +0 -1
@@ -1,7 +1,6 @@#include "git-compat-util.h" #include "parse-options.h" #include "branch.h" -#include "cache.h" #include "commit.h" #include "color.h" #include "environment.h"
rebase-interactive.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "commit.h" #include "environment.h" #include "gettext.h"
submodule-config.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "alloc.h" #include "dir.h" #include "environment.h"
tag.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "environment.h" #include "tag.h" #include "object-name.h"
transport.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "advice.h" #include "alloc.h" #include "config.h"
walker.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "gettext.h" #include "hex.h" #include "walker.h"
Signature · 1 line
gitgitgadget
PATCH v2 16/24 editor: move editor-related functions and declarations into common file
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
cache.h and strbuf.[ch] had editor-related functions. Move these into editor.[ch].
--- add-patch.c | 1 + builtin/add.c | 1 + builtin/am.c | 1 + builtin/branch.c | 1 + builtin/bugreport.c | 1 + builtin/commit.c | 1 + builtin/config.c | 1 + builtin/merge.c | 1 + builtin/notes.c | 1 + builtin/replace.c | 1 + builtin/tag.c | 1 + builtin/var.c | 1 + cache.h | 3 --- color.c | 1 + editor.c | 30 ++++++++++++++++++++++++++++++ editor.h | 34 ++++++++++++++++++++++++++++++++++ pager.c | 1 + rebase-interactive.c | 1 + sideband.c | 1 + strbuf.c | 28 ---------------------------- strbuf.h | 24 ------------------------ 21 files changed, 80 insertions(+), 55 deletions(-) create mode 100644 editor.h
add-patch.c +1 -0
@@ -2,6 +2,7 @@#include "add-interactive.h" #include "advice.h" #include "alloc.h" +#include "editor.h" #include "environment.h" #include "gettext.h" #include "object-name.h"
builtin/add.c +1 -0
@@ -9,6 +9,7 @@#include "config.h" #include "builtin.h" #include "lockfile.h" +#include "editor.h" #include "dir.h" #include "gettext.h" #include "pathspec.h"
builtin/am.c +1 -0
@@ -9,6 +9,7 @@#include "advice.h" #include "config.h" #include "builtin.h" +#include "editor.h" #include "environment.h" #include "exec-cmd.h" #include "gettext.h"
builtin/branch.c +1 -0
@@ -8,6 +8,7 @@#include "cache.h" #include "config.h" #include "color.h" +#include "editor.h" #include "environment.h" #include "refs.h" #include "commit.h"
builtin/bugreport.c +1 -0
@@ -1,5 +1,6 @@#include "builtin.h" #include "abspath.h" +#include "editor.h" #include "gettext.h" #include "parse-options.h" #include "strbuf.h"
builtin/commit.c +1 -0
@@ -13,6 +13,7 @@#include "cache-tree.h" #include "color.h" #include "dir.h" +#include "editor.h" #include "environment.h" #include "builtin.h" #include "diff.h"
builtin/config.c +1 -0
@@ -3,6 +3,7 @@#include "alloc.h" #include "config.h" #include "color.h" +#include "editor.h" #include "environment.h" #include "gettext.h" #include "ident.h"
builtin/merge.c +1 -0
@@ -12,6 +12,7 @@#include "advice.h" #include "alloc.h" #include "config.h" +#include "editor.h" #include "environment.h" #include "gettext.h" #include "hex.h"
builtin/notes.c +1 -0
@@ -10,6 +10,7 @@#include "cache.h" #include "config.h" #include "builtin.h" +#include "editor.h" #include "gettext.h" #include "hex.h" #include "notes.h"
builtin/replace.c +1 -0
@@ -11,6 +11,7 @@#include "cache.h" #include "config.h" #include "builtin.h" +#include "editor.h" #include "environment.h" #include "gettext.h" #include "hex.h"
builtin/tag.c +1 -0
@@ -10,6 +10,7 @@#include "advice.h" #include "config.h" #include "builtin.h" +#include "editor.h" #include "environment.h" #include "gettext.h" #include "hex.h"
builtin/var.c +1 -0
@@ -5,6 +5,7 @@*/ #include "builtin.h" #include "config.h" +#include "editor.h" #include "ident.h" #include "refs.h"
cache.h +0 -3
@@ -621,10 +621,7 @@ int df_name_compare(const char *name1, size_t len1, int mode1,int name_compare (const char *name1,size_t len1,const char *name2,size_t len2);int cache_name_stage_compare (const char *name1,int len1,int stage1,const char *name2,int len2,int stage2); -const char *git_editor (void ); -const char *git_sequence_editor (void );const char *git_pager (int stdout_is_tty); -int is_terminal_dumb (void );struct cache_def {struct strbuf path;
color.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "config.h" #include "color.h" +#include "editor.h" #include "gettext.h" #include "hex.h"
editor.c +30 -0
@@ -2,12 +2,14 @@#include "abspath.h" #include "advice.h" #include "config.h" +#include "editor.h" #include "environment.h" #include "gettext.h" #include "strbuf.h" #include "strvec.h" #include "run-command.h" #include "sigchain.h" +#include "wrapper.h" #ifndef DEFAULT_EDITOR #define DEFAULT_EDITOR "vi"
@@ -130,3 +132,31 @@ int launch_sequence_editor(const char *path, struct strbuf *buffer, {return launch_specified_editor (git_sequence_editor (), path, buffer, env); } + +int strbuf_edit_interactively (struct strbuf *buffer,const char *path, +const char *const *env) +{ +char *path2 =NULL ; +int fd, res =0 ; + +if (!is_absolute_path (path)) + path = path2 =xstrdup (git_path ("%s" , path)); + + fd =open (path,O_WRONLY |O_CREAT |O_TRUNC ,0666 ); +if (fd <0 ) + res =error_errno (_ ("could not open '%s' for writing" ), path); +else if (write_in_full (fd, buffer->buf, buffer->len) <0 ) { + res =error_errno (_ ("could not write to '%s'" ), path); +close (fd); + }else if (close (fd) <0 ) + res =error_errno (_ ("could not close '%s'" ), path); +else { +strbuf_reset (buffer); +if (launch_editor (path, buffer, env) <0 ) + res =error_errno (_ ("could not edit '%s'" ), path); +unlink (path); + } + +free (path2); +return res; +}
editor.h new file +34 -0
@@ -0,0 +1,34 @@ +#ifndef EDITOR_H +#define EDITOR_H + +struct strbuf ; + +const char *git_editor (void ); +const char *git_sequence_editor (void ); +int is_terminal_dumb (void ); + +/** +* Launch the user preferred editor to edit a file and fill the buffer +* with the file's contents upon the user completing their editing. The +* third argument can be used to set the environment which the editor is +* run in. If the buffer is NULL the editor is launched as usual but the +* file's contents are not read into the buffer upon completion. +*/ +int launch_editor (const char *path,struct strbuf *buffer, +const char *const *env); + +int launch_sequence_editor (const char *path,struct strbuf *buffer, +const char *const *env); + +/* +* In contrast to `launch_editor()`, this function writes out the contents +* of the specified file first, then clears the `buffer`, then launches +* the editor and reads back in the file contents into the `buffer`. +* Finally, it deletes the temporary file. +* +* If `path` is relative, it refers to a file in the `.git` directory. +*/ +int strbuf_edit_interactively (struct strbuf *buffer,const char *path, +const char *const *env); + +#endif
pager.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "config.h" +#include "editor.h" #include "run-command.h" #include "sigchain.h" #include "alias.h"
rebase-interactive.c +1 -0
@@ -1,5 +1,6 @@#include "git-compat-util.h" #include "commit.h" +#include "editor.h" #include "environment.h" #include "gettext.h" #include "sequencer.h"
sideband.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "color.h" #include "config.h" +#include "editor.h" #include "gettext.h" #include "sideband.h" #include "help.h"
strbuf.c +0 -28
@@ -1180,34 +1180,6 @@ int strbuf_normalize_path(struct strbuf *src)return 0 ; } -int strbuf_edit_interactively (struct strbuf *buffer,const char *path, -const char *const *env) -{ -char *path2 =NULL ; -int fd, res =0 ; - -if (!is_absolute_path (path)) - path = path2 =xstrdup (git_path ("%s" , path)); - - fd =open (path,O_WRONLY |O_CREAT |O_TRUNC ,0666 ); -if (fd <0 ) - res =error_errno (_ ("could not open '%s' for writing" ), path); -else if (write_in_full (fd, buffer->buf, buffer->len) <0 ) { - res =error_errno (_ ("could not write to '%s'" ), path); -close (fd); - }else if (close (fd) <0 ) - res =error_errno (_ ("could not close '%s'" ), path); -else { -strbuf_reset (buffer); -if (launch_editor (path, buffer, env) <0 ) - res =error_errno (_ ("could not edit '%s'" ), path); -unlink (path); - } - -free (path2); -return res; -} -void strbuf_strip_file_from_path (struct strbuf *sb) {char *path_sep =find_last_dir_sep (sb->buf);
strbuf.h +0 -24
@@ -640,30 +640,6 @@ void strbuf_repo_add_unique_abbrev(struct strbuf *sb, struct repository *repo,void strbuf_add_unique_abbrev (struct strbuf *sb,const struct object_id *oid,int abbrev_len); -/** -* Launch the user preferred editor to edit a file and fill the buffer -* with the file's contents upon the user completing their editing. The -* third argument can be used to set the environment which the editor is -* run in. If the buffer is NULL the editor is launched as usual but the -* file's contents are not read into the buffer upon completion. -*/ -int launch_editor (const char *path,struct strbuf *buffer, -const char *const *env); - -int launch_sequence_editor (const char *path,struct strbuf *buffer, -const char *const *env); - -/* -* In contrast to `launch_editor()`, this function writes out the contents -* of the specified file first, then clears the `buffer`, then launches -* the editor and reads back in the file contents into the `buffer`. -* Finally, it deletes the temporary file. -* -* If `path` is relative, it refers to a file in the `.git` directory. -*/ -int strbuf_edit_interactively (struct strbuf *buffer,const char *path, -const char *const *env); -/* * Remove the filename from the provided path string. If the path * contains a trailing separator, then the path is considered a directory
Signature · 1 line
gitgitgadget
PATCH v2 20/24 cache.h: remove unnecessary includes
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
cache.h did not need any of these headers, and nothing that depended upon cache.h needed them either. Simply expunge these includes.
--- cache.h | 4 ---- 1 file changed, 4 deletions(-)
cache.h +0 -4
@@ -4,14 +4,10 @@#include "git-compat-util.h" #include "strbuf.h" #include "hashmap.h" -#include "list.h" #include "gettext.h" #include "string-list.h" -#include "hash.h" -#include "path.h" #include "pathspec.h" #include "object.h" -#include "repository.h" #include "statinfo.h" #if defined(DT_UNKNOWN ) && !defined(NO_D_TYPE_IN_DIRENT )
Signature · 1 line
gitgitgadget
PATCH v2 18/24 pager.h: move declarations for pager.c functions from cache.h
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
--- builtin/am.c | 1 + builtin/blame.c | 1 + builtin/fetch.c | 1 + builtin/grep.c | 1 + builtin/help.c | 1 + builtin/log.c | 1 + builtin/name-rev.c | 1 + builtin/var.c | 1 + cache.h | 13 ------------- color.c | 1 + column.c | 1 + config.c | 1 + date.c | 1 + diff.c | 1 + editor.c | 1 + environment.c | 1 - git.c | 1 + pager.c | 3 +++ pager.h | 17 +++++++++++++++++ pretty.c | 1 + progress.c | 1 + range-diff.c | 1 + sequencer.c | 1 + 23 files changed, 39 insertions(+), 14 deletions(-) create mode 100644 pager.h
builtin/am.c +1 -0
@@ -40,6 +40,7 @@#include "apply.h" #include "string-list.h" #include "packfile.h" +#include "pager.h" #include "repository.h" #include "pretty.h" #include "wrapper.h"
builtin/blame.c +1 -0
@@ -30,6 +30,7 @@#include "progress.h" #include "object-name.h" #include "object-store.h" +#include "pager.h" #include "blame.h" #include "refs.h" #include "setup.h"
builtin/fetch.c +1 -0
@@ -28,6 +28,7 @@#include "strvec.h" #include "utf8.h" #include "packfile.h" +#include "pager.h" #include "list-objects-filter-options.h" #include "commit-reach.h" #include "branch.h"
builtin/grep.c +1 -0
@@ -30,6 +30,7 @@#include "object-name.h" #include "object-store.h" #include "packfile.h" +#include "pager.h" #include "write-or-die.h" static const char *grep_prefix;
builtin/help.c +1 -0
@@ -6,6 +6,7 @@#include "builtin.h" #include "exec-cmd.h" #include "gettext.h" +#include "pager.h" #include "parse-options.h" #include "run-command.h" #include "config-list.h"
builtin/log.c +1 -0
@@ -15,6 +15,7 @@#include "object-file.h" #include "object-name.h" #include "object-store.h" +#include "pager.h" #include "color.h" #include "commit.h" #include "diff.h"
builtin/name-rev.c +1 -0
@@ -9,6 +9,7 @@#include "tag.h" #include "refs.h" #include "object-name.h" +#include "pager.h" #include "parse-options.h" #include "prio-queue.h" #include "hash-lookup.h"
builtin/var.c +1 -0
@@ -7,6 +7,7 @@#include "config.h" #include "editor.h" #include "ident.h" +#include "pager.h" #include "refs.h" static const char var_usage[] ="git var (-l | <variable>)" ;
cache.h +0 -13
@@ -145,7 +145,6 @@ struct cache_entry {/* Forward structure decls */ struct pathspec ; -struct child_process ;struct tree ;/*
@@ -621,8 +620,6 @@ int df_name_compare(const char *name1, size_t len1, int mode1,int name_compare (const char *name1,size_t len1,const char *name2,size_t len2);int cache_name_stage_compare (const char *name1,int len1,int stage1,const char *name2,int len2,int stage2); -const char *git_pager (int stdout_is_tty); -struct cache_def {struct strbuf path;int flags;
@@ -671,16 +668,6 @@ int copy_fd(int ifd, int ofd);int copy_file (const char *dst,const char *src,int mode);int copy_file_with_time (const char *dst,const char *src,int mode); -/* pager.c */ -void setup_pager (void ); -int pager_in_use (void ); -extern int pager_use_color; -int term_columns (void ); -void term_clear_line (void ); -int decimal_width (uintmax_t ); -int check_pager_config (const char *cmd); -void prepare_pager_args (struct child_process *,const char *pager); -/* base85 */ int decode_85 (char *dst,const char *line,int linelen);void encode_85 (char *buf,const unsigned char *data,int bytes);
color.c +1 -0
@@ -4,6 +4,7 @@#include "editor.h" #include "gettext.h" #include "hex.h" +#include "pager.h" static int git_use_color_default =GIT_COLOR_AUTO ;int color_stdout_is_tty =-1 ;
column.c +1 -0
@@ -2,6 +2,7 @@#include "config.h" #include "column.h" #include "string-list.h" +#include "pager.h" #include "parse-options.h" #include "run-command.h" #include "utf8.h"
config.c +1 -0
@@ -25,6 +25,7 @@#include "string-list.h" #include "object-name.h" #include "object-store.h" +#include "pager.h" #include "utf8.h" #include "dir.h" #include "color.h"
date.c +1 -0
@@ -7,6 +7,7 @@#include "cache.h" #include "date.h" #include "gettext.h" +#include "pager.h" /* * This is like mktime, but without normalization of tm_wday and tm_yday.
diff.c +1 -0
@@ -31,6 +31,7 @@#include "graph.h" #include "oid-array.h" #include "packfile.h" +#include "pager.h" #include "parse-options.h" #include "help.h" #include "promisor-remote.h"
editor.c +1 -0
@@ -5,6 +5,7 @@#include "editor.h" #include "environment.h" #include "gettext.h" +#include "pager.h" #include "strbuf.h" #include "strvec.h" #include "run-command.h"
environment.c +0 -1
@@ -59,7 +59,6 @@ size_t packed_git_window_size = DEFAULT_PACKED_GIT_WINDOW_SIZE;size_t packed_git_limit =DEFAULT_PACKED_GIT_LIMIT ;size_t delta_base_cache_limit =96 *1024 *1024 ;unsigned long big_file_threshold =512 *1024 *1024 ; -int pager_use_color =1 ;const char *editor_program;const char *askpass_program;const char *excludes_file;
git.c +1 -0
@@ -4,6 +4,7 @@#include "exec-cmd.h" #include "gettext.h" #include "help.h" +#include "pager.h" #include "run-command.h" #include "alias.h" #include "replace-object.h"
pager.c +3 -0
@@ -1,10 +1,13 @@#include "cache.h" #include "config.h" #include "editor.h" +#include "pager.h" #include "run-command.h" #include "sigchain.h" #include "alias.h" +int pager_use_color =1 ; +#ifndef DEFAULT_PAGER #define DEFAULT_PAGER "less"#endif
pager.h new file +17 -0
@@ -0,0 +1,17 @@ +#ifndef PAGER_H +#define PAGER_H + +struct child_process ; + +const char *git_pager (int stdout_is_tty); +void setup_pager (void ); +int pager_in_use (void ); +int term_columns (void ); +void term_clear_line (void ); +int decimal_width (uintmax_t ); +int check_pager_config (const char *cmd); +void prepare_pager_args (struct child_process *,const char *pager); + +extern int pager_use_color; + +#endif /* PAGER_H */
pretty.c +1 -0
@@ -7,6 +7,7 @@#include "hex.h" #include "utf8.h" #include "diff.h" +#include "pager.h" #include "revision.h" #include "string-list.h" #include "mailmap.h"
progress.c +1 -0
@@ -10,6 +10,7 @@#define GIT_TEST_PROGRESS_ONLY #include "cache.h" +#include "pager.h" #include "progress.h" #include "strbuf.h" #include "trace.h"
range-diff.c +1 -0
@@ -11,6 +11,7 @@#include "linear-assignment.h" #include "diffcore.h" #include "commit.h" +#include "pager.h" #include "pretty.h" #include "userdiff.h" #include "apply.h"
sequencer.c +1 -0
@@ -12,6 +12,7 @@#include "object-name.h" #include "object-store.h" #include "object.h" +#include "pager.h" #include "commit.h" #include "sequencer.h" #include "tag.h"
Signature · 1 line
gitgitgadget
PATCH v2 19/24 treewide: remove cache.h inclusion due to pager.h changes
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
--- column.c | 2 +- editor.c | 2 +- pager.c | 2 +- pretty.c | 2 +- progress.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-)
column.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "config.h" #include "column.h" #include "string-list.h"
editor.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "abspath.h" #include "advice.h" #include "config.h"
pager.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "config.h" #include "editor.h" #include "pager.h"
pretty.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "alloc.h" #include "config.h" #include "commit.h"
progress.c +1 -1
@@ -9,7 +9,7 @@*/ #define GIT_TEST_PROGRESS_ONLY -#include "cache.h" +#include "git-compat-util.h" #include "pager.h" #include "progress.h" #include "strbuf.h"
Signature · 1 line
gitgitgadget
PATCH v2 22/24 treewide: remove double forward declaration of read_in_full
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
cache.h's nature of a dumping ground of includes prevented it from being included in some compat/ files, forcing us into a workaround of having a double forward declaration of the read_in_full() function (see commit 14086b0a13 ("compat/pread.c: Add a forward declaration to fix a warning", 2007-11-17)). Now that we have moved functions like read_in_full() from cache.h to wrapper.h, and wrapper.h isn't littered with unrelated and scary #defines, get rid of the extra forward declaration and just have compat/pread.c include wrapper.h.
--- builtin/clone.c | 1 + bulk-checkin.c | 1 + combine-diff.c | 1 + compat/pread.c | 1 + git-compat-util.h | 6 ------ grep.c | 1 + pack-write.c | 1 + path.c | 1 + refs/packed-backend.c | 1 + send-pack.c | 1 + setup.c | 1 + upload-pack.c | 1 + 12 files changed, 11 insertions(+), 6 deletions(-)
builtin/clone.c +1 -0
@@ -42,6 +42,7 @@#include "hook.h" #include "bundle.h" #include "bundle-uri.h" +#include "wrapper.h" /* * Overall FIXMEs:
bulk-checkin.c +1 -0
@@ -17,6 +17,7 @@#include "packfile.h" #include "object-file.h" #include "object-store.h" +#include "wrapper.h" static int odb_transaction_nesting;
combine-diff.c +1 -0
@@ -16,6 +16,7 @@#include "userdiff.h" #include "oid-array.h" #include "revision.h" +#include "wrapper.h" static int compare_paths (const struct combine_diff_path *one,const struct diff_filespec *two)
compat/pread.c +1 -0
@@ -1,4 +1,5 @@#include "../git-compat-util.h" +#include "../wrapper.h" ssize_t git_pread (int fd,void *buf,size_t count,off_t offset) {
git-compat-util.h +0 -6
@@ -859,12 +859,6 @@ int git_lstat(const char *, struct stat *);#define pread git_preadssize_t git_pread (int fd,void *buf,size_t count,off_t offset);#endif -/* -* Forward decl that will remind us if its twin in cache.h changes. -* This function is used in compat/pread.c. But we can't include -* cache.h there. -*/ -ssize_t read_in_full (int fd,void *buf,size_t count);#ifdef NO_SETENV #define setenv gitsetenv
grep.c +1 -0
@@ -11,6 +11,7 @@#include "commit.h" #include "quote.h" #include "help.h" +#include "wrapper.h" static int grep_source_load (struct grep_source *gs); static int grep_source_is_binary(struct grep_source *gs,
pack-write.c +1 -0
@@ -10,6 +10,7 @@#include "oidmap.h" #include "pack-objects.h" #include "pack-revindex.h" +#include "wrapper.h" void reset_pack_idx_option (struct pack_idx_option *opts) {
path.c +1 -0
@@ -18,6 +18,7 @@#include "object-store.h" #include "lockfile.h" #include "exec-cmd.h" +#include "wrapper.h" static int get_st_mode_bits (const char *path,int *mode) {
refs/packed-backend.c +1 -0
@@ -9,6 +9,7 @@#include "../iterator.h" #include "../lockfile.h" #include "../chdir-notify.h" +#include "../wrapper.h" #include "../write-or-die.h" enum mmap_strategy {
send-pack.c +1 -0
@@ -14,6 +14,7 @@#include "quote.h" #include "transport.h" #include "version.h" +#include "wrapper.h" #include "oid-array.h" #include "gpg-interface.h" #include "shallow.h"
setup.c +1 -0
@@ -12,6 +12,7 @@#include "promisor-remote.h" #include "quote.h" #include "trace2.h" +#include "wrapper.h" static int inside_git_dir =-1 ;static int inside_work_tree =-1 ;
upload-pack.c +1 -0
@@ -32,6 +32,7 @@#include "commit-graph.h" #include "commit-reach.h" #include "shallow.h" +#include "wrapper.h" #include "write-or-die.h" /* Remember to update object flag allocation in object.h */
Signature · 1 line
gitgitgadget
PATCH v2 21/24 strbuf: move forward declarations to beginning of file
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
--- strbuf.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
strbuf.h +2 -7
@@ -1,6 +1,8 @@#ifndef STRBUF_H #define STRBUF_H +struct object_id ; +struct repository ;struct string_list ;/**
@@ -72,12 +74,6 @@ struct strbuf {extern char strbuf_slopbuf[];#define STRBUF_INIT { .buf = strbuf_slopbuf } -/* -* Predeclare this here, since cache.h includes this file before it defines the -* struct. -*/ -struct object_id ; -/** * Life Cycle Functions * --------------------
@@ -634,7 +630,6 @@ void strbuf_list_free(struct strbuf **list);* Add the abbreviation, as generated by repo_find_unique_abbrev(), of `sha1` to * the strbuf `sb`. */ -struct repository ;void strbuf_repo_add_unique_abbrev (struct strbuf *sb,struct repository *repo,const struct object_id *oid,int abbrev_len); void strbuf_add_unique_abbrev(struct strbuf *sb, const struct object_id *oid,
Signature · 1 line
gitgitgadget
PATCH v2 24/24 mailmap, quote: move declarations of global vars to correct unit
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
Since earlier commits removed the inclusion of cache.h from mailmap.c and quote.c, it feels odd to have the extern declarations of global variables in cache.h rather than the actual header included by the source file. Move these global variable extern declarations from cache.h to mailmap.c and quote.c.
--- cache.h | 5 ----- config.c | 1 + mailmap.h | 3 +++ quote.h | 2 ++ 4 files changed, 6 insertions(+), 5 deletions(-)
cache.h +0 -5
@@ -599,8 +599,6 @@ void set_alternate_index_output(const char *);extern int verify_index_checksum;extern int verify_ce_order; -extern int quote_path_fully; -#define MTIME_CHANGED 0x0001#define CTIME_CHANGED 0x0002#define OWNER_CHANGED 0x0004
@@ -655,9 +653,6 @@ struct pack_entry {/* Dumb servers support */ int update_server_info (int ); -extern const char *git_mailmap_file; -extern const char *git_mailmap_blob; -#define COPY_READ_ERROR (-2)#define COPY_WRITE_ERROR (-3)int copy_fd (int ifd,int ofd);
config.c +1 -0
@@ -18,6 +18,7 @@#include "ident.h" #include "repository.h" #include "lockfile.h" +#include "mailmap.h" #include "exec-cmd.h" #include "strbuf.h" #include "quote.h"
mailmap.h +3 -0
@@ -3,6 +3,9 @@struct string_list ; +extern const char *git_mailmap_file; +extern const char *git_mailmap_blob; +int read_mailmap (struct string_list *map);void clear_mailmap (struct string_list *map);
quote.h +2 -0
@@ -3,6 +3,8 @@struct strbuf ; +extern int quote_path_fully; +/* Help to copy the thing properly quoted for the shell safety. * any single quote is replaced with '\'', any exclamation point * is replaced with '\!', and the whole thing is enclosed in a
Signature · 1 line
gitgitgadget