Header cleanups
cover Header cleanups
Maintainer note: I dropped multiple changes from this series to avoid conflicts with other in-flight series, but two small conflicts remain. In order to merge with next, add the following declaration to abspath.h:
/* Likewise, but path=="-" always yields "-" */
char *prefix_filename_except_for_dash(const char *prefix, const char *path);(from cache.h) and remove the entire conflicted region in cache.h. There is also a semantic conflict with seen; to fix, include abspath.h in the new file compat/fsmonitor/fsm-path-utils-linux.c.
This series picks up where en/header-cleanups leaves off and does more header cleanups, trying to reduce the number of files depending on cache.h. (There are still more that could be done, but again, this is a good chunk for now.)
Notes:
* As I mentioned in my last series, Dscho's gitgitgadget is super helpful for a series like this.
* As with my previous series (en/header-cleanup), I used the scripts at my header-cleanup-scripts branch
[https://github.com/newren/git/commit/db81c8d7fb554b3edf04320e218bddeb98bb6194],
and some tweaks thereof, repeatedly while making this series (though they are prone to produce both false positive and false negatives, so if you use them, only use them to generate hints about which files to look at).
Elijah Newren (16):
treewide: remove unnecessary cache.h inclusion from a few headers
treewide: be explicit about dependence on gettext.h
treewide: remove unnecessary inclusion of gettext.h
treewide: remove unnecessary cache.h inclusion from several sources
environment: move comment_line_char from cache.h abspath.h: move absolute path functions from cache.h cache.h: remove expand_user_path()
path.h: move function declarations for path.c functions from cache.h wrapper.h: move declarations for wrapper.c functions from cache.h
treewide: remove unnecessary includes of cache.h environment.h: move declarations for environment.c functions from
cache.h
treewide: remove cache.h inclusion due to environment.h changes setup.h: move declarations for setup.c functions from cache.h
treewide: remove cache.h inclusion due to setup.h changes write-or-die.h: move declarations for write-or-die.c functions from
cache.h
csum-file.h: remove unnecessary inclusion of cache.h
abspath.c | 4 +- abspath.h | 30 + add-interactive.c | 1 + add-patch.c | 2 + apply.c | 5 + archive-tar.c | 2 + archive-zip.c | 2 + archive.c | 4 + attr.c | 3 + bisect.c | 2 + blame.c | 2 + branch.c | 2 + builtin/add.c | 1 + builtin/am.c | 4 + builtin/apply.c | 1 + builtin/archive.c | 1 + builtin/bisect.c | 3 + builtin/blame.c | 4 + builtin/branch.c | 3 + builtin/bugreport.c | 5 +- builtin/bundle.c | 3 + builtin/cat-file.c | 3 + builtin/check-attr.c | 4 + builtin/check-ignore.c | 2 + builtin/check-mailmap.c | 2 + builtin/check-ref-format.c | 1 + builtin/checkout--worker.c | 1 + builtin/checkout-index.c | 2 + builtin/checkout.c | 3 + builtin/clean.c | 3 + builtin/clone.c | 4 + builtin/column.c | 1 + builtin/commit-graph.c | 2 + builtin/commit-tree.c | 1 + builtin/commit.c | 2 + builtin/config.c | 5 + builtin/count-objects.c | 2 + builtin/credential-cache--daemon.c | 2 + builtin/credential-cache.c | 3 + builtin/credential-store.c | 2 + builtin/describe.c | 3 + builtin/diagnose.c | 2 + builtin/diff-index.c | 1 + builtin/diff-tree.c | 1 + builtin/diff.c | 2 + builtin/difftool.c | 5 + builtin/fast-export.c | 1 + builtin/fast-import.c | 4 + builtin/fetch-pack.c | 1 + builtin/fetch.c | 2 + builtin/fmt-merge-msg.c | 2 + builtin/for-each-ref.c | 1 + builtin/for-each-repo.c | 1 + builtin/fsck.c | 1 + builtin/fsmonitor--daemon.c | 3 + builtin/gc.c | 5 + builtin/get-tar-commit-id.c | 1 + builtin/grep.c | 3 + builtin/hash-object.c | 4 + builtin/help.c | 2 + builtin/hook.c | 1 + builtin/index-pack.c | 4 + builtin/init-db.c | 5 + builtin/interpret-trailers.c | 1 + builtin/log.c | 4 + builtin/ls-files.c | 2 + builtin/ls-remote.c | 1 + builtin/ls-tree.c | 1 + builtin/mailinfo.c | 3 + builtin/mailsplit.c | 1 + builtin/merge-base.c | 1 + builtin/merge-file.c | 3 + builtin/merge-recursive.c | 1 + builtin/merge-tree.c | 1 + builtin/merge.c | 4 + builtin/mktag.c | 1 + builtin/mktree.c | 1 + builtin/multi-pack-index.c | 3 + builtin/mv.c | 4 + builtin/name-rev.c | 2 + builtin/notes.c | 2 + builtin/pack-objects.c | 3 + builtin/pack-redundant.c | 1 + builtin/pack-refs.c | 1 + builtin/patch-id.c | 1 + builtin/prune-packed.c | 1 + builtin/prune.c | 2 + builtin/pull.c | 1 + builtin/push.c | 2 + builtin/range-diff.c | 1 + builtin/read-tree.c | 2 + builtin/rebase.c | 4 + builtin/receive-pack.c | 4 + builtin/reflog.c | 1 + builtin/remote.c | 1 + builtin/repack.c | 2 + builtin/replace.c | 2 + builtin/rerere.c | 2 + builtin/reset.c | 3 + builtin/rev-list.c | 2 + builtin/rev-parse.c | 4 + builtin/revert.c | 1 + builtin/rm.c | 2 + builtin/send-pack.c | 1 + builtin/shortlog.c | 3 + builtin/show-branch.c | 2 + builtin/show-index.c | 1 + builtin/show-ref.c | 1 + builtin/sparse-checkout.c | 3 + builtin/stash.c | 4 + builtin/stripspace.c | 3 + builtin/submodule--helper.c | 4 + builtin/symbolic-ref.c | 1 + builtin/tag.c | 3 + builtin/unpack-file.c | 1 + builtin/unpack-objects.c | 2 + builtin/update-index.c | 4 + builtin/update-ref.c | 1 + builtin/update-server-info.c | 1 + builtin/upload-pack.c | 1 + builtin/verify-commit.c | 1 + builtin/verify-pack.c | 1 + builtin/verify-tag.c | 1 + builtin/worktree.c | 4 + builtin/write-tree.c | 2 + bulk-checkin.c | 4 +- bulk-checkin.h | 2 +- bundle-uri.c | 2 + bundle.c | 3 + bundle.h | 1 - cache-tree.c | 3 +- cache.h | 568 ------------------- chdir-notify.c | 1 + chunk-format.c | 2 + color.c | 1 + combine-diff.c | 1 + commit-graph.c | 4 +- commit.c | 3 + common-main.c | 2 + compat/disk.h | 2 + compat/fsmonitor/fsm-health-win32.c | 1 + compat/fsmonitor/fsm-listen-darwin.c | 1 + compat/fsmonitor/fsm-listen-win32.c | 1 + compat/fsmonitor/fsm-path-utils-darwin.c | 1 + compat/fsmonitor/fsm-path-utils-win32.c | 1 + compat/linux/procinfo.c | 2 +- compat/mingw.c | 4 + compat/precompose_utf8.c | 2 + compat/simple-ipc/ipc-shared.c | 2 +- compat/simple-ipc/ipc-unix-socket.c | 1 + compat/simple-ipc/ipc-win32.c | 2 + compat/terminal.c | 4 +- config.c | 7 +- connect.c | 2 + connected.c | 3 +- convert.c | 2 + copy.c | 1 + credential.c | 2 + csum-file.c | 3 +- csum-file.h | 2 +- daemon.c | 4 + date.c | 1 + delta-islands.c | 3 +- diagnose.c | 2 + diff-lib.c | 1 + diff-no-index.c | 2 + diff.c | 5 + dir.c | 5 + editor.c | 3 + entry.c | 3 + environment.c | 5 + environment.h | 220 +++++++ exec-cmd.c | 3 + fetch-pack.c | 5 +- fmt-merge-msg.c | 3 +- fsck.c | 2 +- fsmonitor-ipc.c | 1 + fsmonitor.c | 1 + gettext.c | 4 +- git.c | 3 + gpg-interface.c | 6 +- grep.c | 3 +- http-backend.c | 5 +- http-fetch.c | 2 + http-push.c | 2 + imap-send.c | 3 + line-log.c | 2 +- list-objects-filter-options.h | 1 + list-objects-filter.c | 1 + list-objects.c | 1 + ll-merge.c | 1 + lockfile.c | 4 +- log-tree.c | 2 + ls-refs.c | 4 +- mailmap.c | 2 + merge-ort-wrappers.c | 1 + merge-ort.c | 2 + merge-recursive.c | 3 + merge.c | 1 + midx.c | 4 +- name-hash.c | 2 + negotiator/default.c | 2 +- negotiator/skipping.c | 2 +- notes-cache.c | 2 +- notes-merge.c | 2 + notes-utils.c | 4 +- notes.c | 1 + object-file.c | 7 +- object-name.c | 3 + object.c | 1 + pack-bitmap-write.c | 5 +- pack-bitmap.c | 3 +- pack-check.c | 1 + pack-mtimes.c | 3 +- pack-revindex.c | 1 + pack-write.c | 2 + pack.h | 2 + packfile.c | 5 +- packfile.h | 4 +- parallel-checkout.c | 2 + parse-options-cb.c | 2 + parse-options.c | 3 +- parse-options.h | 2 + patch-ids.c | 2 +- path.c | 6 +- path.h | 62 +- pathspec.c | 4 + pkt-line.c | 3 + preload-index.c | 2 + pretty.c | 2 + progress.c | 1 - promisor-remote.c | 1 + prompt.c | 3 +- protocol.c | 1 + prune-packed.c | 2 + range-diff.c | 2 + reachable.c | 3 +- read-cache.c | 3 + rebase-interactive.c | 3 + ref-filter.c | 4 +- ref-filter.h | 1 + reflog.c | 3 +- refs.c | 6 +- refs.h | 1 - refs/files-backend.c | 7 +- refs/iterator.c | 2 +- refs/packed-backend.c | 4 +- refspec.c | 1 + remote-curl.c | 4 + remote.c | 6 +- replace-object.c | 3 +- repository.c | 2 + rerere.c | 3 + rerere.h | 1 + reset.c | 1 + revision.c | 3 + run-command.c | 2 + scalar.c | 2 + send-pack.c | 4 +- sequencer.c | 4 + server-info.c | 4 +- setup.c | 4 + setup.h | 168 ++++++ shallow.c | 3 +- sideband.c | 2 + sparse-index.c | 2 + split-index.c | 1 + strbuf.c | 6 +- streaming.c | 2 + streaming.h | 4 +- submodule-config.c | 2 + submodule.c | 6 +- symlinks.c | 2 + t/helper/test-advise.c | 2 +- t/helper/test-bitmap.c | 3 +- t/helper/test-bloom.c | 4 +- t/helper/test-bundle-uri.c | 1 + t/helper/test-cache-tree.c | 2 + t/helper/test-config.c | 2 +- t/helper/test-delta.c | 2 +- t/helper/test-dump-cache-tree.c | 2 +- t/helper/test-dump-fsmonitor.c | 1 + t/helper/test-dump-split-index.c | 1 + t/helper/test-dump-untracked-cache.c | 1 + t/helper/test-fast-rebase.c | 5 +- t/helper/test-fsmonitor-client.c | 2 + t/helper/test-hash.c | 1 - t/helper/test-lazy-init-name-hash.c | 2 + t/helper/test-match-trees.c | 1 + t/helper/test-oid-array.c | 1 + t/helper/test-oidmap.c | 1 + t/helper/test-oidtree.c | 1 + t/helper/test-pack-mtimes.c | 2 +- t/helper/test-parse-pathspec-file.c | 1 - t/helper/test-partial-clone.c | 4 +- t/helper/test-path-utils.c | 3 + t/helper/test-pkt-line.c | 3 +- t/helper/test-proc-receive.c | 4 +- t/helper/test-progress.c | 1 - t/helper/test-reach.c | 3 + t/helper/test-read-cache.c | 2 + t/helper/test-read-graph.c | 2 +- t/helper/test-read-midx.c | 1 + t/helper/test-ref-store.c | 2 +- t/helper/test-repository.c | 3 +- t/helper/test-revision-walking.c | 2 +- t/helper/test-run-command.c | 1 - t/helper/test-scrap-cache-tree.c | 1 + t/helper/test-serve-v2.c | 3 +- t/helper/test-submodule-config.c | 1 + t/helper/test-submodule-nested-repo-config.c | 2 +- t/helper/test-submodule.c | 2 +- t/helper/test-subprocess.c | 2 +- t/helper/test-trace2.c | 2 +- t/helper/test-userdiff.c | 2 +- t/helper/test-write-cache.c | 1 + tag.c | 2 + tempfile.c | 4 +- tmp-objdir.c | 2 + trace.c | 4 + trace2/tr2_cfg.c | 4 +- trace2/tr2_cmd_name.c | 3 +- trace2/tr2_dst.c | 4 +- trace2/tr2_sid.c | 3 +- trailer.c | 4 +- transport-helper.c | 3 + transport.c | 4 +- transport.h | 1 - tree-walk.c | 1 + unpack-trees.c | 3 + upload-pack.c | 3 + usage.c | 4 +- walker.c | 1 + worktree.c | 5 + wrapper.c | 3 + wrapper.h | 36 ++ write-or-die.c | 4 +- write-or-die.h | 78 +++ wt-status.c | 3 + xdiff-interface.c | 2 +- 340 files changed, 1308 insertions(+), 666 deletions(-) create mode 100644 abspath.h create mode 100644 setup.h create mode 100644 wrapper.h create mode 100644 write-or-die.h
base-commit: 950264636c68591989456e3ba0a5442f93152c1a
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1493%2Fnewren%2Fheader-cleanup-2-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1493/newren/header-cleanup-2-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1493
Signature · 1 line
gitgitgadget
PATCH 1/16 treewide: remove unnecessary cache.h inclusion from a few headers
From: Elijah Newren <[email protected]>
Ever since a64215b6cd ("object.h: stop depending on cache.h; make cache.h depend on object.h", 2023-02-24), we have a few headers that could have replaced their include of cache.h with an include of object.h. Make that change now.
Some C files had to start including cache.h after this change (or some smaller header it had brought in), because the C files were depending on things from cache.h but were only formerly implicitly getting cache.h through one of these headers being modified in this patch.
--- bulk-checkin.h | 2 +- bundle.h | 1 - cache-tree.c | 2 +- config.c | 2 +- fmt-merge-msg.c | 2 +- fsck.c | 2 +- http-backend.c | 2 +- pack-mtimes.c | 2 +- packfile.h | 4 +++- prune-packed.c | 2 +- ref-filter.c | 2 +- refs.c | 2 +- refs.h | 1 - refs/packed-backend.c | 2 +- refspec.c | 1 + remote.c | 2 +- server-info.c | 2 +- shallow.c | 2 +- strbuf.c | 2 +- streaming.h | 4 +++- submodule.c | 2 +- t/helper/test-bundle-uri.c | 1 + t/helper/test-fast-rebase.c | 2 +- t/helper/test-pack-mtimes.c | 2 +- t/helper/test-reach.c | 1 + transport.c | 2 +- transport.h | 1 - worktree.c | 2 +- 28 files changed, 29 insertions(+), 25 deletions(-)
bulk-checkin.h +1 -1
@@ -4,7 +4,7 @@#ifndef BULK_CHECKIN_H #define BULK_CHECKIN_H -#include "cache.h" +#include "object.h" void prepare_loose_object_bulk_checkin (void );void fsync_loose_object_bulk_checkin (int fd,const char *filename);
bundle.h +0 -1
@@ -2,7 +2,6 @@#define BUNDLE_H #include "strvec.h" -#include "cache.h" #include "string-list.h" #include "list-objects-filter-options.h"
cache-tree.c +1 -1
@@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "alloc.h" #include "hex.h" #include "lockfile.h"
config.c +1 -1
@@ -5,7 +5,7 @@* Copyright (C) Johannes Schindelin, 2005 * */ -#include "git-compat-util.h" +#include "cache.h" #include "alloc.h" #include "date.h" #include "branch.h"
fmt-merge-msg.c +1 -1
@@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "alloc.h" #include "config.h" #include "refs.h"
fsck.c +1 -1
@@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "alloc.h" #include "hex.h" #include "object-store.h"
http-backend.c +1 -1
@@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "alloc.h" #include "config.h" #include "hex.h"
pack-mtimes.c +1 -1
@@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "pack-mtimes.h" #include "object-store.h" #include "packfile.h"
packfile.h +3 -1
@@ -1,11 +1,13 @@#ifndef PACKFILE_H #define PACKFILE_H -#include "cache.h" +#include "object.h" #include "oidset.h" /* in object-store.h */ struct packed_git ; +struct pack_entry ; +struct pack_window ;struct object_info ;/*
prune-packed.c +1 -1
@@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "object-store.h" #include "packfile.h" #include "progress.h"
ref-filter.c +1 -1
@@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "alloc.h" #include "hex.h" #include "parse-options.h"
refs.c +1 -1
@@ -2,7 +2,7 @@* The backend-independent part of the reference module. */ -#include "git-compat-util.h" +#include "cache.h" #include "alloc.h" #include "config.h" #include "hashmap.h"
refs.h +0 -1
@@ -1,7 +1,6 @@#ifndef REFS_H #define REFS_H -#include "cache.h" #include "commit.h" struct object_id ;
refs/packed-backend.c +1 -1
@@ -1,4 +1,4 @@ -#include "../git-compat-util.h" +#include "../cache.h" #include "../alloc.h" #include "../config.h" #include "../hex.h"
refspec.c +1 -0
@@ -1,5 +1,6 @@#include "git-compat-util.h" #include "alloc.h" +#include "gettext.h" #include "hex.h" #include "strvec.h" #include "refs.h"
remote.c +1 -1
@@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "alloc.h" #include "config.h" #include "hex.h"
server-info.c +1 -1
@@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "alloc.h" #include "dir.h" #include "hex.h"
shallow.c +1 -1
@@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "alloc.h" #include "hex.h" #include "repository.h"
strbuf.c +1 -1
@@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "alloc.h" #include "hex.h" #include "refs.h"
streaming.h +3 -1
@@ -3,10 +3,12 @@*/ #ifndef STREAMING_H #define STREAMING_H 1 -#include "cache.h" + +#include "object.h" /* opaque */ struct git_istream ; +struct stream_filter ; struct git_istream *open_istream(struct repository *, const struct object_id *, enum object_type *, unsigned long *,
submodule.c +1 -1
@@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "alloc.h" #include "repository.h" #include "config.h"
t/helper/test-bundle-uri.c +1 -0
@@ -1,6 +1,7 @@#include "test-tool.h" #include "parse-options.h" #include "bundle-uri.h" +#include "gettext.h" #include "strbuf.h" #include "string-list.h" #include "transport.h"
t/helper/test-fast-rebase.c +1 -1
@@ -12,7 +12,7 @@#define USE_THE_INDEX_VARIABLE #include "test-tool.h" - +#include "cache.h" #include "cache-tree.h" #include "commit.h" #include "hex.h"
t/helper/test-pack-mtimes.c +1 -1
@@ -1,5 +1,5 @@ -#include "git-compat-util.h" #include "test-tool.h" +#include "cache.h" #include "hex.h" #include "strbuf.h" #include "object-store.h"
t/helper/test-reach.c +1 -0
@@ -1,4 +1,5 @@#include "test-tool.h" +#include "cache.h" #include "alloc.h" #include "commit.h" #include "commit-reach.h"
transport.c +1 -1
@@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "alloc.h" #include "config.h" #include "hex.h"
transport.h +0 -1
@@ -1,7 +1,6 @@#ifndef TRANSPORT_H #define TRANSPORT_H -#include "cache.h" #include "run-command.h" #include "remote.h" #include "list-objects-filter-options.h"
worktree.c +1 -1
@@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "alloc.h" #include "repository.h" #include "refs.h"
Signature · 1 line
gitgitgadget
PATCH 3/16 treewide: remove unnecessary inclusion of gettext.h
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
Looking at things from the opposite angle of the last patch, we had a few files that were including gettext.h and perhaps needed it at some point in history, but no longer require it. Remove the include.
--- progress.c | 1 - t/helper/test-parse-pathspec-file.c | 1 - t/helper/test-progress.c | 1 - t/helper/test-run-command.c | 1 - 4 files changed, 4 deletions(-)
progress.c +0 -1
@@ -10,7 +10,6 @@#define GIT_TEST_PROGRESS_ONLY #include "cache.h" -#include "gettext.h" #include "progress.h" #include "strbuf.h" #include "trace.h"
t/helper/test-parse-pathspec-file.c +0 -1
@@ -1,7 +1,6 @@#include "test-tool.h" #include "parse-options.h" #include "pathspec.h" -#include "gettext.h" int cmd__parse_pathspec_file (int argc,const char **argv) {
t/helper/test-progress.c +0 -1
@@ -19,7 +19,6 @@*/ #define GIT_TEST_PROGRESS_ONLY #include "test-tool.h" -#include "gettext.h" #include "parse-options.h" #include "progress.h" #include "strbuf.h"
t/helper/test-run-command.c +0 -1
@@ -16,7 +16,6 @@#include "string-list.h" #include "thread-utils.h" #include "wildmatch.h" -#include "gettext.h" static int number_callbacks; static int parallel_next(struct child_process *cp,
Signature · 1 line
gitgitgadget
PATCH 5/16 environment: move comment_line_char from cache.h
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
This is one step towards making strbuf.c not depend upon cache.h. Additional steps will follow in subsequent commits.
--- add-patch.c | 1 + builtin/branch.c | 1 + builtin/commit.c | 1 + builtin/merge.c | 1 + builtin/tag.c | 1 + cache.h | 7 ------- commit.c | 1 + environment.h | 7 +++++++ fmt-merge-msg.c | 1 + sequencer.c | 1 + strbuf.c | 1 + trailer.c | 1 + wt-status.c | 1 + 13 files changed, 18 insertions(+), 7 deletions(-)
add-patch.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "add-interactive.h" #include "alloc.h" +#include "environment.h" #include "gettext.h" #include "strbuf.h" #include "run-command.h"
builtin/branch.c +1 -0
@@ -8,6 +8,7 @@#include "cache.h" #include "config.h" #include "color.h" +#include "environment.h" #include "refs.h" #include "commit.h" #include "builtin.h"
builtin/commit.c +1 -0
@@ -12,6 +12,7 @@#include "cache-tree.h" #include "color.h" #include "dir.h" +#include "environment.h" #include "builtin.h" #include "diff.h" #include "diffcore.h"
builtin/merge.c +1 -0
@@ -10,6 +10,7 @@#include "cache.h" #include "alloc.h" #include "config.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "parse-options.h"
builtin/tag.c +1 -0
@@ -9,6 +9,7 @@#include "cache.h" #include "config.h" #include "builtin.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "refs.h"
cache.h +0 -7
@@ -956,13 +956,6 @@ extern int sparse_expect_files_outside_of_patterns;*/ int use_optional_locks (void ); -/* -* The character that begins a commented line in user-editable file -* that is subject to stripspace. -*/ -extern char comment_line_char; -extern int auto_comment_line_char; -enum log_refs_config {LOG_REFS_UNSET =-1 ,LOG_REFS_NONE =0 ,
commit.c +1 -0
@@ -2,6 +2,7 @@#include "tag.h" #include "commit.h" #include "commit-graph.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "repository.h"
environment.h +7 -0
@@ -3,6 +3,13 @@#include "strvec.h" +/* +* The character that begins a commented line in user-editable file +* that is subject to stripspace. +*/ +extern char comment_line_char; +extern int auto_comment_line_char; +/* * Wrapper of getenv() that returns a strdup value. This value is kept * in argv to be freed later.
fmt-merge-msg.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "alloc.h" #include "config.h" +#include "environment.h" #include "refs.h" #include "object-store.h" #include "diff.h"
sequencer.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "alloc.h" #include "config.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "lockfile.h"
strbuf.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "alloc.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "refs.h"
trailer.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "alloc.h" #include "config.h" +#include "environment.h" #include "gettext.h" #include "string-list.h" #include "run-command.h"
wt-status.c +1 -0
@@ -4,6 +4,7 @@#include "dir.h" #include "commit.h" #include "diff.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "revision.h"
Signature · 1 line
gitgitgadget
PATCH 4/16 treewide: remove unnecessary cache.h inclusion from several sources
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
A number of files were apparently including cache.h solely to get gettext.h. By making those files explicitly include gettext.h, we can already drop the include of cache.h in these files. Remove those now unnecessary includes.
--- compat/linux/procinfo.c | 2 +- compat/simple-ipc/ipc-shared.c | 2 +- connected.c | 2 +- grep.c | 2 +- negotiator/default.c | 2 +- negotiator/skipping.c | 2 +- notes-cache.c | 2 +- patch-ids.c | 2 +- reflog.c | 2 +- refs/iterator.c | 2 +- replace-object.c | 2 +- t/helper/test-hash.c | 1 - xdiff-interface.c | 2 +- 13 files changed, 12 insertions(+), 13 deletions(-)
compat/linux/procinfo.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "strbuf.h" #include "strvec.h"
compat/simple-ipc/ipc-shared.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "simple-ipc.h" #include "strbuf.h" #include "pkt-line.h"
connected.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"
grep.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "config.h" #include "gettext.h" #include "grep.h"
negotiator/default.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "default.h" #include "../commit.h" #include "../fetch-negotiator.h"
negotiator/skipping.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "skipping.h" #include "../commit.h" #include "../fetch-negotiator.h"
notes-cache.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "notes-cache.h" #include "object-store.h" #include "repository.h"
patch-ids.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "diff.h" #include "commit.h" #include "hash-lookup.h"
reflog.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "gettext.h" #include "object-store.h" #include "reflog.h"
refs/iterator.c +1 -1
@@ -3,7 +3,7 @@* documentation about the design and use of reference iterators. */ -#include "cache.h" +#include "git-compat-util.h" #include "refs.h" #include "refs/refs-internal.h" #include "iterator.h"
replace-object.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "gettext.h" #include "hex.h" #include "oidmap.h"
t/helper/test-hash.c +0 -1
@@ -1,5 +1,4 @@#include "test-tool.h" -#include "cache.h" #include "hex.h" int cmd_hash_impl (int ac,const char **av,int algo)
xdiff-interface.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "config.h" #include "hex.h" #include "object-store.h"
Signature · 1 line
gitgitgadget
PATCH 7/16 cache.h: remove expand_user_path()
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
expand_user_path() was renamed to interpolate_path() back in mid-2021, but reinstated with a #define and a NEEDSWORK comment that we would eventually want to get rid of it. Do so now.
--- cache.h | 2 -- gpg-interface.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-)
cache.h +0 -2
@@ -1142,8 +1142,6 @@ enum scld_error safe_create_leading_directories_no_share(char *path);int mkdir_in_gitdir (const char *path);char *interpolate_path (const char *path,int real_home); -/* NEEDSWORK: remove this synonym once in-flight topics have migrated */ -#define expand_user_path interpolate_pathconst char *enter_repo (const char *path,int strict);const char *remove_leading_path (const char *in,const char *prefix);const char *relative_path (const char *in,const char *prefix,struct strbuf *sb);
gpg-interface.c +1 -1
@@ -1049,7 +1049,7 @@ static int sign_buffer_ssh(struct strbuf *buffer, struct strbuf *signature, ssh_signing_key_file =strbuf_detach (&key_file->filename,NULL ); }else {/* We assume a file */ - ssh_signing_key_file =expand_user_path (signing_key,1 ); + ssh_signing_key_file =interpolate_path (signing_key,1 ); } buffer_file =mks_tempfile_t (".git_signing_buffer_tmpXXXXXX" );
Signature · 1 line
gitgitgadget
PATCH 6/16 abspath.h: move absolute path functions from cache.h
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
This is another step towards letting us remove the include of cache.h in strbuf.c. It does mean that we also need to add includes of abspath.h in a number of C files.
--- abspath.c | 4 +++- abspath.h | 30 ++++++++++++++++++++++++++++++ apply.c | 1 + archive.c | 1 + builtin/am.c | 1 + builtin/bugreport.c | 1 + builtin/bundle.c | 1 + builtin/clean.c | 1 + builtin/clone.c | 1 + builtin/config.c | 1 + builtin/credential-cache--daemon.c | 1 + builtin/diagnose.c | 1 + builtin/difftool.c | 1 + builtin/fast-import.c | 1 + builtin/fsmonitor--daemon.c | 1 + builtin/gc.c | 1 + builtin/hash-object.c | 1 + builtin/init-db.c | 1 + builtin/log.c | 1 + builtin/mailinfo.c | 1 + builtin/merge-file.c | 1 + builtin/merge.c | 1 + builtin/multi-pack-index.c | 1 + builtin/mv.c | 1 + builtin/rebase.c | 1 + builtin/receive-pack.c | 1 + builtin/rev-parse.c | 1 + builtin/stash.c | 1 + builtin/submodule--helper.c | 1 + builtin/worktree.c | 1 + cache.h | 24 ------------------------ chdir-notify.c | 1 + compat/disk.h | 1 + compat/mingw.c | 1 + compat/simple-ipc/ipc-win32.c | 1 + config.c | 1 + credential.c | 1 + daemon.c | 1 + diff-no-index.c | 1 + diff.c | 1 + dir.c | 1 + editor.c | 1 + environment.c | 1 + exec-cmd.c | 1 + gettext.c | 1 + lockfile.c | 1 + midx.c | 1 + object-file.c | 1 + parse-options.c | 1 + path.c | 1 + pathspec.c | 1 + remote.c | 1 + repository.c | 1 + rerere.c | 1 + scalar.c | 1 + sequencer.c | 1 + setup.c | 1 + strbuf.c | 1 + submodule.c | 1 + t/helper/test-path-utils.c | 1 + tmp-objdir.c | 1 + trace.c | 1 + trace2/tr2_dst.c | 1 + worktree.c | 1 + wrapper.c | 1 + 65 files changed, 95 insertions(+), 25 deletions(-) create mode 100644 abspath.h
abspath.c +3 -1
@@ -1,4 +1,6 @@ -#include "cache.h" +#include "git-compat-util.h" +#include "abspath.h" +#include "strbuf.h" /* * Do not use this for inspecting *tracked* content. When path is a
abspath.h new file +30 -0
@@ -0,0 +1,30 @@ +#ifndef ABSPATH_H +#define ABSPATH_H + +int is_directory (const char *); +char *strbuf_realpath (struct strbuf *resolved,const char *path, +int die_on_error); +char *strbuf_realpath_forgiving (struct strbuf *resolved,const char *path, +int die_on_error); +char *real_pathdup (const char *path,int die_on_error); +const char *absolute_path (const char *path); +char *absolute_pathdup (const char *path); + +/* +* Concatenate "prefix" (if len is non-zero) and "path", with no +* connecting characters (so "prefix" should end with a "/"). +* Unlike prefix_path, this should be used if the named file does +* not have to interact with index entry; i.e. name of a random file +* on the filesystem. +* +* The return value is always a newly allocated string (even if the +* prefix was empty). +*/ +char *prefix_filename (const char *prefix,const char *path); + +static inline int is_absolute_path (const char *path) +{ +return is_dir_sep (path[0 ]) ||has_dos_drive_prefix (path); +} + +#endif /* ABSPATH_H */
apply.c +1 -0
@@ -8,6 +8,7 @@*/ #include "cache.h" +#include "abspath.h" #include "alloc.h" #include "config.h" #include "object-store.h"
archive.c +1 -0
@@ -1,4 +1,5 @@#include "git-compat-util.h" +#include "abspath.h" #include "alloc.h" #include "config.h" #include "gettext.h"
builtin/am.c +1 -0
@@ -5,6 +5,7 @@*/ #define USE_THE_INDEX_VARIABLE #include "cache.h" +#include "abspath.h" #include "config.h" #include "builtin.h" #include "exec-cmd.h"
builtin/bugreport.c +1 -0
@@ -1,4 +1,5 @@#include "builtin.h" +#include "abspath.h" #include "gettext.h" #include "parse-options.h" #include "strbuf.h"
builtin/bundle.c +1 -0
@@ -1,4 +1,5 @@#include "builtin.h" +#include "abspath.h" #include "gettext.h" #include "strvec.h" #include "parse-options.h"
builtin/clean.c +1 -0
@@ -8,6 +8,7 @@#define USE_THE_INDEX_VARIABLE #include "builtin.h" +#include "abspath.h" #include "cache.h" #include "config.h" #include "dir.h"
builtin/clone.c +1 -0
@@ -10,6 +10,7 @@#define USE_THE_INDEX_VARIABLE #include "builtin.h" +#include "abspath.h" #include "config.h" #include "gettext.h" #include "hex.h"
builtin/config.c +1 -0
@@ -1,4 +1,5 @@#include "builtin.h" +#include "abspath.h" #include "alloc.h" #include "config.h" #include "color.h"
builtin/credential-cache--daemon.c +1 -0
@@ -1,4 +1,5 @@#include "builtin.h" +#include "abspath.h" #include "alloc.h" #include "gettext.h" #include "parse-options.h"
builtin/diagnose.c +1 -0
@@ -1,4 +1,5 @@#include "builtin.h" +#include "abspath.h" #include "gettext.h" #include "parse-options.h" #include "diagnose.h"
builtin/difftool.c +1 -0
@@ -13,6 +13,7 @@*/ #define USE_THE_INDEX_VARIABLE #include "cache.h" +#include "abspath.h" #include "config.h" #include "builtin.h" #include "run-command.h"
builtin/fast-import.c +1 -0
@@ -1,4 +1,5 @@#include "builtin.h" +#include "abspath.h" #include "cache.h" #include "gettext.h" #include "hex.h"
builtin/fsmonitor--daemon.c +1 -0
@@ -1,4 +1,5 @@#include "builtin.h" +#include "abspath.h" #include "alloc.h" #include "config.h" #include "gettext.h"
builtin/gc.c +1 -0
@@ -11,6 +11,7 @@*/ #include "builtin.h" +#include "abspath.h" #include "hex.h" #include "repository.h" #include "config.h"
builtin/hash-object.c +1 -0
@@ -5,6 +5,7 @@* Copyright (C) Junio C Hamano, 2005 */ #include "builtin.h" +#include "abspath.h" #include "config.h" #include "gettext.h" #include "hex.h"
builtin/init-db.c +1 -0
@@ -4,6 +4,7 @@* Copyright (C) Linus Torvalds, 2005 */ #include "cache.h" +#include "abspath.h" #include "config.h" #include "gettext.h" #include "refs.h"
builtin/log.c +1 -0
@@ -5,6 +5,7 @@* 2006 Junio Hamano */ #include "git-compat-util.h" +#include "abspath.h" #include "alloc.h" #include "config.h" #include "gettext.h"
builtin/mailinfo.c +1 -0
@@ -3,6 +3,7 @@* email to figure out authorship and subject */ #include "cache.h" +#include "abspath.h" #include "builtin.h" #include "gettext.h" #include "utf8.h"
builtin/merge-file.c +1 -0
@@ -1,4 +1,5 @@#include "builtin.h" +#include "abspath.h" #include "cache.h" #include "config.h" #include "gettext.h"
builtin/merge.c +1 -0
@@ -8,6 +8,7 @@#define USE_THE_INDEX_VARIABLE #include "cache.h" +#include "abspath.h" #include "alloc.h" #include "config.h" #include "environment.h"
builtin/multi-pack-index.c +1 -0
@@ -1,4 +1,5 @@#include "builtin.h" +#include "abspath.h" #include "cache.h" #include "config.h" #include "gettext.h"
builtin/mv.c +1 -0
@@ -5,6 +5,7 @@*/ #define USE_THE_INDEX_VARIABLE #include "builtin.h" +#include "abspath.h" #include "alloc.h" #include "config.h" #include "gettext.h"
builtin/rebase.c +1 -0
@@ -6,6 +6,7 @@#define USE_THE_INDEX_VARIABLE #include "builtin.h" +#include "abspath.h" #include "gettext.h" #include "hex.h" #include "run-command.h"
builtin/receive-pack.c +1 -0
@@ -1,4 +1,5 @@#include "builtin.h" +#include "abspath.h" #include "repository.h" #include "config.h" #include "gettext.h"
builtin/rev-parse.c +1 -0
@@ -5,6 +5,7 @@*/ #define USE_THE_INDEX_VARIABLE #include "cache.h" +#include "abspath.h" #include "alloc.h" #include "config.h" #include "commit.h"
builtin/stash.c +1 -0
@@ -1,5 +1,6 @@#define USE_THE_INDEX_VARIABLE #include "builtin.h" +#include "abspath.h" #include "config.h" #include "gettext.h" #include "hex.h"
builtin/submodule--helper.c +1 -0
@@ -1,5 +1,6 @@#define USE_THE_INDEX_VARIABLE #include "builtin.h" +#include "abspath.h" #include "alloc.h" #include "gettext.h" #include "hex.h"
builtin/worktree.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "abspath.h" #include "checkout.h" #include "config.h" #include "builtin.h"
cache.h +0 -24
@@ -598,18 +598,6 @@ const char *setup_git_directory(void);char *prefix_path (const char *prefix,int len,const char *path);char *prefix_path_gently (const char *prefix,int len,int *remaining,const char *path); -/* -* Concatenate "prefix" (if len is non-zero) and "path", with no -* connecting characters (so "prefix" should end with a "/"). -* Unlike prefix_path, this should be used if the named file does -* not have to interact with index entry; i.e. name of a random file -* on the filesystem. -* -* The return value is always a newly allocated string (even if the -* prefix was empty). -*/ -char *prefix_filename (const char *prefix,const char *path); -int check_filename (const char *prefix,const char *name); void verify_filename(const char *prefix, const char *name,
@@ -1157,18 +1145,6 @@ char *interpolate_path(const char *path, int real_home);/* NEEDSWORK: remove this synonym once in-flight topics have migrated */ #define expand_user_path interpolate_pathconst char *enter_repo (const char *path,int strict); -static inline int is_absolute_path (const char *path) -{ -return is_dir_sep (path[0 ]) ||has_dos_drive_prefix (path); -} -int is_directory (const char *); -char *strbuf_realpath (struct strbuf *resolved,const char *path, -int die_on_error); -char *strbuf_realpath_forgiving (struct strbuf *resolved,const char *path, -int die_on_error); -char *real_pathdup (const char *path,int die_on_error); -const char *absolute_path (const char *path); -char *absolute_pathdup (const char *path);const char *remove_leading_path (const char *in,const char *prefix);const char *relative_path (const char *in,const char *prefix,struct strbuf *sb);int normalize_path_copy_len (char *dst,const char *src,int *prefix_len);
chdir-notify.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "abspath.h" #include "chdir-notify.h" #include "list.h" #include "strbuf.h"
compat/disk.h +1 -0
@@ -2,6 +2,7 @@#define COMPAT_DISK_H #include "git-compat-util.h" +#include "abspath.h" #include "gettext.h" static int get_disk_info (struct strbuf *out)
compat/mingw.c +1 -0
@@ -7,6 +7,7 @@#include "../strbuf.h" #include "../run-command.h" #include "../cache.h" +#include "../abspath.h" #include "../alloc.h" #include "win32/lazyload.h" #include "../config.h"
compat/simple-ipc/ipc-win32.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "abspath.h" #include "gettext.h" #include "simple-ipc.h" #include "strbuf.h"
config.c +1 -0
@@ -6,6 +6,7 @@* */ #include "cache.h" +#include "abspath.h" #include "alloc.h" #include "date.h" #include "branch.h"
credential.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "abspath.h" #include "config.h" #include "credential.h" #include "gettext.h"
daemon.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "abspath.h" #include "alloc.h" #include "config.h" #include "pkt-line.h"
diff-no-index.c +1 -0
@@ -5,6 +5,7 @@*/ #include "cache.h" +#include "abspath.h" #include "color.h" #include "commit.h" #include "blob.h"
diff.c +1 -0
@@ -2,6 +2,7 @@* Copyright (C) 2005 Junio C Hamano */ #include "cache.h" +#include "abspath.h" #include "alloc.h" #include "config.h" #include "gettext.h"
dir.c +1 -0
@@ -6,6 +6,7 @@* Junio Hamano, 2005-2006 */ #include "git-compat-util.h" +#include "abspath.h" #include "alloc.h" #include "config.h" #include "dir.h"
editor.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "abspath.h" #include "config.h" #include "gettext.h" #include "strbuf.h"
environment.c +1 -0
@@ -8,6 +8,7 @@* are. */ #include "cache.h" +#include "abspath.h" #include "branch.h" #include "environment.h" #include "gettext.h"
exec-cmd.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "abspath.h" #include "exec-cmd.h" #include "gettext.h" #include "quote.h"
gettext.c +1 -0
@@ -3,6 +3,7 @@*/ #include "cache.h" +#include "abspath.h" #include "exec-cmd.h" #include "gettext.h" #include "strbuf.h"
lockfile.c +1 -0
@@ -3,6 +3,7 @@*/ #include "cache.h" +#include "abspath.h" #include "gettext.h" #include "lockfile.h"
midx.c +1 -0
@@ -1,4 +1,5 @@#include "git-compat-util.h" +#include "abspath.h" #include "alloc.h" #include "config.h" #include "csum-file.h"
object-file.c +1 -0
@@ -7,6 +7,7 @@* creation etc. */ #include "git-compat-util.h" +#include "abspath.h" #include "alloc.h" #include "config.h" #include "gettext.h"
parse-options.c +1 -0
@@ -1,5 +1,6 @@#include "git-compat-util.h" #include "parse-options.h" +#include "abspath.h" #include "cache.h" #include "config.h" #include "commit.h"
path.c +1 -0
@@ -2,6 +2,7 @@* Utilities for paths and pathnames */ #include "cache.h" +#include "abspath.h" #include "gettext.h" #include "hex.h" #include "repository.h"
pathspec.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "abspath.h" #include "config.h" #include "dir.h" #include "gettext.h"
remote.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "abspath.h" #include "alloc.h" #include "config.h" #include "gettext.h"
repository.c +1 -0
@@ -4,6 +4,7 @@*/ #define USE_THE_INDEX_VARIABLE #include "cache.h" +#include "abspath.h" #include "repository.h" #include "object-store.h" #include "config.h"
rerere.c +1 -0
@@ -1,4 +1,5 @@#include "git-compat-util.h" +#include "abspath.h" #include "alloc.h" #include "config.h" #include "gettext.h"
scalar.c +1 -0
@@ -3,6 +3,7 @@*/ #include "cache.h" +#include "abspath.h" #include "gettext.h" #include "parse-options.h" #include "config.h"
sequencer.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "abspath.h" #include "alloc.h" #include "config.h" #include "environment.h"
setup.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "abspath.h" #include "gettext.h" #include "repository.h" #include "config.h"
strbuf.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "abspath.h" #include "alloc.h" #include "environment.h" #include "gettext.h"
submodule.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "abspath.h" #include "alloc.h" #include "repository.h" #include "config.h"
t/helper/test-path-utils.c +1 -0
@@ -1,5 +1,6 @@#include "test-tool.h" #include "cache.h" +#include "abspath.h" #include "string-list.h" #include "utf8.h"
tmp-objdir.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "tmp-objdir.h" +#include "abspath.h" #include "chdir-notify.h" #include "dir.h" #include "sigchain.h"
trace.c +1 -0
@@ -22,6 +22,7 @@*/ #include "cache.h" +#include "abspath.h" #include "quote.h" struct trace_key trace_default_key = {"GIT_TRACE" ,0 ,0 ,0 };
trace2/tr2_dst.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "abspath.h" #include "sigchain.h" #include "trace2/tr2_dst.h" #include "trace2/tr2_sid.h"
worktree.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "abspath.h" #include "alloc.h" #include "gettext.h" #include "repository.h"
wrapper.c +1 -0
@@ -2,6 +2,7 @@* Various trivial helper wrappers around standard functions */ #include "cache.h" +#include "abspath.h" #include "config.h" #include "gettext.h"
Signature · 1 line
gitgitgadget
PATCH 8/16 path.h: move function declarations for path.c functions from cache.h
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
--- cache.h | 59 ------------------------------------------------------ path.h | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 61 insertions(+), 60 deletions(-)
cache.h +0 -59
@@ -1105,7 +1105,6 @@ enum sharedrepo { PERM_EVERYBODY = 0664 };int git_config_perm (const char *var,const char *value); -int adjust_shared_perm (const char *path);/* * Create the directory containing the named path, using care to be
@@ -1141,54 +1140,6 @@ enum scld_error safe_create_leading_directories_const(const char *path);enum scld_error safe_create_leading_directories_no_share (char *path);int mkdir_in_gitdir (const char *path); -char *interpolate_path (const char *path,int real_home); -const char *enter_repo (const char *path,int strict); -const char *remove_leading_path (const char *in,const char *prefix); -const char *relative_path (const char *in,const char *prefix,struct strbuf *sb); -int normalize_path_copy_len (char *dst,const char *src,int *prefix_len); -int normalize_path_copy (char *dst,const char *src); -int longest_ancestor_length (const char *path,struct string_list *prefixes); -char *strip_path_suffix (const char *path,const char *suffix); -int daemon_avoid_alias (const char *path); - -/* -* These functions match their is_hfs_dotgit() counterparts; see utf8.h for -* details. -*/ -int is_ntfs_dotgit (const char *name); -int is_ntfs_dotgitmodules (const char *name); -int is_ntfs_dotgitignore (const char *name); -int is_ntfs_dotgitattributes (const char *name); -int is_ntfs_dotmailmap (const char *name); - -/* -* Returns true iff "str" could be confused as a command-line option when -* passed to a sub-program like "ssh". Note that this has nothing to do with -* shell-quoting, which should be handled separately; we're assuming here that -* the string makes it verbatim to the sub-program. -*/ -int looks_like_command_line_option (const char *str); - -/** -* Return a newly allocated string with the evaluation of -* "$XDG_CONFIG_HOME/$subdir/$filename" if $XDG_CONFIG_HOME is non-empty, otherwise -* "$HOME/.config/$subdir/$filename". Return NULL upon error. -*/ -char *xdg_config_home_for (const char *subdir,const char *filename); - -/** -* Return a newly allocated string with the evaluation of -* "$XDG_CONFIG_HOME/git/$filename" if $XDG_CONFIG_HOME is non-empty, otherwise -* "$HOME/.config/git/$filename". Return NULL upon error. -*/ -char *xdg_config_home (const char *filename); - -/** -* Return a newly allocated string with the evaluation of -* "$XDG_CACHE_HOME/git/$filename" if $XDG_CACHE_HOME is non-empty, otherwise -* "$HOME/.cache/git/$filename". Return NULL upon error. -*/ -char *xdg_cache_home (const char *filename);int git_open_cloexec (const char *name,int flags);#define git_open (name) git_open_cloexec(name, O_RDONLY)
@@ -1355,8 +1306,6 @@ int repo_interpret_branch_name(struct repository *r,#define interpret_branch_name (str, len, buf, options) \ repo_interpret_branch_name(the_repository, str, len, buf, options) -int validate_headref (const char *ref); -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,
@@ -1616,14 +1565,6 @@ void stat_validity_update(struct stat_validity *sv, int fd);int versioncmp (const char *s1,const char *s2); -/* -* Create a directory and (if share is nonzero) adjust its permissions -* according to the shared_repository setting. Only use this for -* directories under $GIT_DIR. Don't use it for working tree -* directories. -*/ -void safe_create_dir (const char *dir,int share); -/* * Should we print an ellipsis after an abbreviated SHA-1 value * when doing diff-raw output or indicating a detached HEAD?
path.h +61 -1
74 lines not on this page · raw message
Signature · 1 line
gitgitgadget
PATCH 2/16 treewide: be explicit about dependence on gettext.h
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
Dozens of files made use of gettext functions, without explicitly including gettext.h. This made it more difficult to find which files could remove a dependence on cache.h. Make C files explicitly include gettext.h if they are using it.
However, while compat/fsmonitor/fsm-ipc-darwin.c should also gain an include of gettext.h, it was left out to avoid conflicting with an in-flight topic.
--- add-interactive.c | 1 + add-patch.c | 1 + apply.c | 1 + archive-tar.c | 1 + archive-zip.c | 1 + archive.c | 1 + attr.c | 1 + bisect.c | 1 + blame.c | 1 + branch.c | 1 + builtin/add.c | 1 + builtin/am.c | 1 + builtin/apply.c | 1 + builtin/archive.c | 1 + builtin/bisect.c | 1 + builtin/blame.c | 1 + builtin/branch.c | 1 + builtin/bugreport.c | 1 + builtin/bundle.c | 1 + builtin/cat-file.c | 1 + builtin/check-attr.c | 1 + builtin/check-ignore.c | 1 + builtin/check-mailmap.c | 1 + builtin/checkout--worker.c | 1 + builtin/checkout-index.c | 1 + builtin/checkout.c | 1 + builtin/clean.c | 1 + builtin/clone.c | 1 + builtin/column.c | 1 + builtin/commit-graph.c | 1 + builtin/commit-tree.c | 1 + builtin/commit.c | 1 + builtin/config.c | 1 + builtin/count-objects.c | 1 + builtin/credential-cache--daemon.c | 1 + builtin/credential-cache.c | 1 + builtin/credential-store.c | 1 + builtin/describe.c | 1 + builtin/diagnose.c | 1 + builtin/diff-tree.c | 1 + builtin/diff.c | 1 + builtin/difftool.c | 1 + builtin/fast-export.c | 1 + builtin/fast-import.c | 1 + builtin/fetch-pack.c | 1 + builtin/fetch.c | 1 + builtin/fmt-merge-msg.c | 1 + builtin/for-each-ref.c | 1 + builtin/for-each-repo.c | 1 + builtin/fsck.c | 1 + builtin/fsmonitor--daemon.c | 1 + builtin/gc.c | 1 + builtin/grep.c | 1 + builtin/hash-object.c | 1 + builtin/help.c | 1 + builtin/hook.c | 1 + builtin/index-pack.c | 1 + builtin/init-db.c | 1 + builtin/interpret-trailers.c | 1 + builtin/log.c | 1 + builtin/ls-files.c | 1 + builtin/ls-remote.c | 1 + builtin/ls-tree.c | 1 + builtin/mailinfo.c | 1 + builtin/mailsplit.c | 1 + builtin/merge-base.c | 1 + builtin/merge-file.c | 1 + builtin/merge-recursive.c | 1 + builtin/merge-tree.c | 1 + builtin/merge.c | 1 + builtin/mktag.c | 1 + builtin/mktree.c | 1 + builtin/multi-pack-index.c | 1 + builtin/mv.c | 1 + builtin/name-rev.c | 1 + builtin/notes.c | 1 + builtin/pack-objects.c | 1 + builtin/pack-redundant.c | 1 + builtin/pack-refs.c | 1 + builtin/patch-id.c | 1 + builtin/prune-packed.c | 1 + builtin/prune.c | 1 + builtin/pull.c | 1 + builtin/push.c | 1 + builtin/range-diff.c | 1 + builtin/read-tree.c | 1 + builtin/rebase.c | 1 + builtin/receive-pack.c | 1 + builtin/reflog.c | 1 + builtin/remote.c | 1 + builtin/repack.c | 1 + builtin/replace.c | 1 + builtin/rerere.c | 1 + builtin/reset.c | 1 + builtin/rev-list.c | 1 + builtin/rev-parse.c | 1 + builtin/revert.c | 1 + builtin/rm.c | 1 + builtin/shortlog.c | 1 + builtin/show-branch.c | 1 + builtin/show-index.c | 1 + builtin/show-ref.c | 1 + builtin/sparse-checkout.c | 1 + builtin/stash.c | 1 + builtin/stripspace.c | 1 + builtin/submodule--helper.c | 1 + builtin/symbolic-ref.c | 1 + builtin/tag.c | 1 + builtin/unpack-objects.c | 1 + builtin/update-index.c | 1 + builtin/update-ref.c | 1 + builtin/update-server-info.c | 1 + builtin/upload-pack.c | 1 + builtin/verify-commit.c | 1 + builtin/verify-pack.c | 1 + builtin/verify-tag.c | 1 + builtin/worktree.c | 1 + builtin/write-tree.c | 1 + bulk-checkin.c | 1 + bundle-uri.c | 1 + bundle.c | 1 + chunk-format.c | 1 + color.c | 1 + commit-graph.c | 1 + commit.c | 1 + common-main.c | 1 + compat/disk.h | 1 + compat/fsmonitor/fsm-health-win32.c | 1 + compat/fsmonitor/fsm-listen-darwin.c | 1 + compat/fsmonitor/fsm-listen-win32.c | 1 + compat/fsmonitor/fsm-path-utils-darwin.c | 1 + compat/fsmonitor/fsm-path-utils-win32.c | 1 + compat/mingw.c | 1 + compat/precompose_utf8.c | 1 + compat/simple-ipc/ipc-unix-socket.c | 1 + compat/simple-ipc/ipc-win32.c | 1 + compat/terminal.c | 1 + config.c | 1 + connect.c | 1 + connected.c | 1 + convert.c | 1 + credential.c | 1 + date.c | 1 + delta-islands.c | 1 + diagnose.c | 1 + diff-lib.c | 1 + diff-no-index.c | 1 + diff.c | 1 + dir.c | 1 + editor.c | 1 + entry.c | 1 + environment.c | 1 + exec-cmd.c | 1 + fetch-pack.c | 1 + fsmonitor-ipc.c | 1 + git.c | 1 + gpg-interface.c | 1 + grep.c | 1 + http-fetch.c | 1 + imap-send.c | 1 + list-objects-filter-options.h | 1 + list-objects-filter.c | 1 + list-objects.c | 1 + lockfile.c | 1 + ls-refs.c | 1 + merge-ort-wrappers.c | 1 + merge-ort.c | 1 + merge-recursive.c | 1 + merge.c | 1 + midx.c | 1 + name-hash.c | 1 + notes-merge.c | 1 + notes-utils.c | 1 + object-file.c | 1 + object-name.c | 1 + object.c | 1 + pack-bitmap-write.c | 1 + pack-bitmap.c | 1 + pack-mtimes.c | 1 + pack-revindex.c | 1 + pack-write.c | 1 + packfile.c | 1 + parallel-checkout.c | 1 + parse-options-cb.c | 1 + parse-options.c | 1 + parse-options.h | 2 ++ path.c | 1 + pathspec.c | 1 + pkt-line.c | 1 + preload-index.c | 1 + pretty.c | 1 + promisor-remote.c | 1 + prune-packed.c | 1 + range-diff.c | 1 + reachable.c | 1 + read-cache.c | 1 + rebase-interactive.c | 1 + ref-filter.c | 1 + ref-filter.h | 1 + reflog.c | 1 + refs.c | 1 + refs/files-backend.c | 1 + refs/packed-backend.c | 1 + remote-curl.c | 1 + remote.c | 1 + replace-object.c | 1 + rerere.c | 1 + rerere.h | 1 + reset.c | 1 + revision.c | 1 + run-command.c | 1 + send-pack.c | 1 + sequencer.c | 1 + setup.c | 1 + sideband.c | 1 + sparse-index.c | 1 + split-index.c | 1 + strbuf.c | 1 + submodule-config.c | 1 + submodule.c | 1 + symlinks.c | 1 + t/helper/test-cache-tree.c | 1 + t/helper/test-fast-rebase.c | 1 + t/helper/test-reach.c | 1 + t/helper/test-serve-v2.c | 1 + trailer.c | 1 + transport-helper.c | 1 + tree-walk.c | 1 + unpack-trees.c | 1 + upload-pack.c | 1 + usage.c | 2 +- walker.c | 1 + worktree.c | 1 + wrapper.c | 1 + wt-status.c | 1 + 235 files changed, 236 insertions(+), 1 deletion(-)
add-interactive.c +1 -0
@@ -3,6 +3,7 @@#include "color.h" #include "config.h" #include "diffcore.h" +#include "gettext.h" #include "hex.h" #include "revision.h" #include "refs.h"
add-patch.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "add-interactive.h" #include "alloc.h" +#include "gettext.h" #include "strbuf.h" #include "run-command.h" #include "strvec.h"
apply.c +1 -0
@@ -15,6 +15,7 @@#include "delta.h" #include "diff.h" #include "dir.h" +#include "gettext.h" #include "hex.h" #include "xdiff-interface.h" #include "ll-merge.h"
archive-tar.c +1 -0
@@ -4,6 +4,7 @@#include "git-compat-util.h" #include "alloc.h" #include "config.h" +#include "gettext.h" #include "hex.h" #include "tar.h" #include "archive.h"
archive-zip.c +1 -0
@@ -4,6 +4,7 @@#include "cache.h" #include "config.h" #include "archive.h" +#include "gettext.h" #include "hex.h" #include "streaming.h" #include "utf8.h"
archive.c +1 -0
@@ -1,6 +1,7 @@#include "git-compat-util.h" #include "alloc.h" #include "config.h" +#include "gettext.h" #include "hex.h" #include "refs.h" #include "object-store.h"
attr.c +1 -0
@@ -12,6 +12,7 @@#include "exec-cmd.h" #include "attr.h" #include "dir.h" +#include "gettext.h" #include "utf8.h" #include "quote.h" #include "revision.h"
bisect.c +1 -0
@@ -2,6 +2,7 @@#include "config.h" #include "commit.h" #include "diff.h" +#include "gettext.h" #include "hex.h" #include "revision.h" #include "refs.h"
blame.c +1 -0
@@ -5,6 +5,7 @@#include "mergesort.h" #include "diff.h" #include "diffcore.h" +#include "gettext.h" #include "hex.h" #include "tag.h" #include "blame.h"
branch.c +1 -0
@@ -2,6 +2,7 @@#include "cache.h" #include "config.h" #include "branch.h" +#include "gettext.h" #include "hex.h" #include "refs.h" #include "refspec.h"
builtin/add.c +1 -0
@@ -9,6 +9,7 @@#include "builtin.h" #include "lockfile.h" #include "dir.h" +#include "gettext.h" #include "pathspec.h" #include "exec-cmd.h" #include "cache-tree.h"
builtin/am.c +1 -0
@@ -8,6 +8,7 @@#include "config.h" #include "builtin.h" #include "exec-cmd.h" +#include "gettext.h" #include "hex.h" #include "parse-options.h" #include "dir.h"
builtin/apply.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "builtin.h" +#include "gettext.h" #include "parse-options.h" #include "apply.h"
builtin/archive.c +1 -0
@@ -5,6 +5,7 @@#include "cache.h" #include "builtin.h" #include "archive.h" +#include "gettext.h" #include "transport.h" #include "parse-options.h" #include "pkt-line.h"
builtin/bisect.c +1 -0
@@ -1,5 +1,6 @@#include "builtin.h" #include "cache.h" +#include "gettext.h" #include "hex.h" #include "parse-options.h" #include "bisect.h"
builtin/blame.c +1 -0
@@ -10,6 +10,7 @@#include "config.h" #include "color.h" #include "builtin.h" +#include "gettext.h" #include "hex.h" #include "repository.h" #include "commit.h"
builtin/branch.c +1 -0
@@ -11,6 +11,7 @@#include "refs.h" #include "commit.h" #include "builtin.h" +#include "gettext.h" #include "remote.h" #include "parse-options.h" #include "branch.h"
builtin/bugreport.c +1 -0
@@ -1,4 +1,5 @@#include "builtin.h" +#include "gettext.h" #include "parse-options.h" #include "strbuf.h" #include "help.h"
builtin/bundle.c +1 -0
@@ -1,4 +1,5 @@#include "builtin.h" +#include "gettext.h" #include "strvec.h" #include "parse-options.h" #include "cache.h"
builtin/cat-file.c +1 -0
@@ -9,6 +9,7 @@#include "config.h" #include "builtin.h" #include "diff.h" +#include "gettext.h" #include "hex.h" #include "ident.h" #include "parse-options.h"
builtin/check-attr.c +1 -0
@@ -3,6 +3,7 @@#include "cache.h" #include "config.h" #include "attr.h" +#include "gettext.h" #include "quote.h" #include "parse-options.h"
builtin/check-ignore.c +1 -0
@@ -3,6 +3,7 @@#include "cache.h" #include "config.h" #include "dir.h" +#include "gettext.h" #include "quote.h" #include "pathspec.h" #include "parse-options.h"
builtin/check-mailmap.c +1 -0
@@ -1,5 +1,6 @@#include "builtin.h" #include "config.h" +#include "gettext.h" #include "ident.h" #include "mailmap.h" #include "parse-options.h"
builtin/checkout--worker.c +1 -0
@@ -2,6 +2,7 @@#include "alloc.h" #include "config.h" #include "entry.h" +#include "gettext.h" #include "parallel-checkout.h" #include "parse-options.h" #include "pkt-line.h"
builtin/checkout-index.c +1 -0
@@ -8,6 +8,7 @@#include "builtin.h" #include "config.h" #include "dir.h" +#include "gettext.h" #include "lockfile.h" #include "quote.h" #include "cache-tree.h"
builtin/checkout.c +1 -0
@@ -9,6 +9,7 @@#include "config.h" #include "diff.h" #include "dir.h" +#include "gettext.h" #include "hex.h" #include "hook.h" #include "ll-merge.h"
builtin/clean.c +1 -0
@@ -11,6 +11,7 @@#include "cache.h" #include "config.h" #include "dir.h" +#include "gettext.h" #include "parse-options.h" #include "string-list.h" #include "quote.h"
builtin/clone.c +1 -0
@@ -11,6 +11,7 @@#define USE_THE_INDEX_VARIABLE #include "builtin.h" #include "config.h" +#include "gettext.h" #include "hex.h" #include "lockfile.h" #include "parse-options.h"
builtin/column.c +1 -0
@@ -1,6 +1,7 @@#include "builtin.h" #include "cache.h" #include "config.h" +#include "gettext.h" #include "strbuf.h" #include "parse-options.h" #include "string-list.h"
builtin/commit-graph.c +1 -0
@@ -1,6 +1,7 @@#include "builtin.h" #include "config.h" #include "dir.h" +#include "gettext.h" #include "hex.h" #include "lockfile.h" #include "parse-options.h"
builtin/commit-tree.c +1 -0
@@ -5,6 +5,7 @@*/ #include "cache.h" #include "config.h" +#include "gettext.h" #include "hex.h" #include "object-store.h" #include "repository.h"
builtin/commit.c +1 -0
@@ -16,6 +16,7 @@#include "diff.h" #include "diffcore.h" #include "commit.h" +#include "gettext.h" #include "revision.h" #include "wt-status.h" #include "run-command.h"
builtin/config.c +1 -0
@@ -2,6 +2,7 @@#include "alloc.h" #include "config.h" #include "color.h" +#include "gettext.h" #include "ident.h" #include "parse-options.h" #include "urlmatch.h"
builtin/count-objects.c +1 -0
@@ -7,6 +7,7 @@#include "cache.h" #include "config.h" #include "dir.h" +#include "gettext.h" #include "repository.h" #include "builtin.h" #include "parse-options.h"
builtin/credential-cache--daemon.c +1 -0
@@ -1,5 +1,6 @@#include "builtin.h" #include "alloc.h" +#include "gettext.h" #include "parse-options.h" #ifndef NO_UNIX_SOCKETS
builtin/credential-cache.c +1 -0
@@ -1,4 +1,5 @@#include "builtin.h" +#include "gettext.h" #include "parse-options.h" #ifndef NO_UNIX_SOCKETS
builtin/credential-store.c +1 -0
@@ -1,5 +1,6 @@#include "builtin.h" #include "config.h" +#include "gettext.h" #include "lockfile.h" #include "credential.h" #include "string-list.h"
builtin/describe.c +1 -0
@@ -1,6 +1,7 @@#define USE_THE_INDEX_VARIABLE #include "cache.h" #include "config.h" +#include "gettext.h" #include "hex.h" #include "lockfile.h" #include "commit.h"
builtin/diagnose.c +1 -0
@@ -1,4 +1,5 @@#include "builtin.h" +#include "gettext.h" #include "parse-options.h" #include "diagnose.h"
builtin/diff-tree.c +1 -0
@@ -3,6 +3,7 @@#include "config.h" #include "diff.h" #include "commit.h" +#include "gettext.h" #include "hex.h" #include "log-tree.h" #include "builtin.h"
builtin/diff.c +1 -0
@@ -11,6 +11,7 @@#include "color.h" #include "commit.h" #include "blob.h" +#include "gettext.h" #include "tag.h" #include "diff.h" #include "diff-merges.h"
builtin/difftool.c +1 -0
@@ -17,6 +17,7 @@#include "builtin.h" #include "run-command.h" #include "exec-cmd.h" +#include "gettext.h" #include "hex.h" #include "parse-options.h" #include "strvec.h"
builtin/fast-export.c +1 -0
@@ -6,6 +6,7 @@#include "builtin.h" #include "cache.h" #include "config.h" +#include "gettext.h" #include "hex.h" #include "refs.h" #include "refspec.h"
builtin/fast-import.c +1 -0
@@ -1,5 +1,6 @@#include "builtin.h" #include "cache.h" +#include "gettext.h" #include "hex.h" #include "repository.h" #include "config.h"
builtin/fetch-pack.c +1 -0
@@ -1,5 +1,6 @@#include "builtin.h" #include "alloc.h" +#include "gettext.h" #include "hex.h" #include "pkt-line.h" #include "fetch-pack.h"
builtin/fetch.c +1 -0
@@ -3,6 +3,7 @@*/ #include "cache.h" #include "config.h" +#include "gettext.h" #include "hex.h" #include "repository.h" #include "refs.h"
builtin/fmt-merge-msg.c +1 -0
@@ -1,6 +1,7 @@#include "builtin.h" #include "config.h" #include "fmt-merge-msg.h" +#include "gettext.h" #include "parse-options.h" static const char *const fmt_merge_msg_usage[] = {
builtin/for-each-ref.c +1 -0
@@ -1,6 +1,7 @@#include "builtin.h" #include "cache.h" #include "config.h" +#include "gettext.h" #include "refs.h" #include "object.h" #include "parse-options.h"
builtin/for-each-repo.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "config.h" #include "builtin.h" +#include "gettext.h" #include "parse-options.h" #include "run-command.h" #include "string-list.h"
builtin/fsck.c +1 -0
@@ -1,5 +1,6 @@#include "builtin.h" #include "cache.h" +#include "gettext.h" #include "hex.h" #include "repository.h" #include "config.h"
builtin/fsmonitor--daemon.c +1 -0
@@ -1,6 +1,7 @@#include "builtin.h" #include "alloc.h" #include "config.h" +#include "gettext.h" #include "parse-options.h" #include "fsmonitor.h" #include "fsmonitor-ipc.h"
builtin/gc.c +1 -0
@@ -32,6 +32,7 @@#include "refs.h" #include "remote.h" #include "exec-cmd.h" +#include "gettext.h" #include "hook.h" #define FAILED_RUN "failed to run %s"
builtin/grep.c +1 -0
@@ -5,6 +5,7 @@*/ #include "cache.h" #include "alloc.h" +#include "gettext.h" #include "hex.h" #include "repository.h" #include "config.h"
builtin/hash-object.c +1 -0
@@ -6,6 +6,7 @@*/ #include "builtin.h" #include "config.h" +#include "gettext.h" #include "hex.h" #include "object-store.h" #include "blob.h"
builtin/help.c +1 -0
@@ -5,6 +5,7 @@#include "config.h" #include "builtin.h" #include "exec-cmd.h" +#include "gettext.h" #include "parse-options.h" #include "run-command.h" #include "config-list.h"
builtin/hook.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "builtin.h" #include "config.h" +#include "gettext.h" #include "hook.h" #include "parse-options.h" #include "strbuf.h"
builtin/index-pack.c +1 -0
@@ -2,6 +2,7 @@#include "alloc.h" #include "config.h" #include "delta.h" +#include "gettext.h" #include "hex.h" #include "pack.h" #include "csum-file.h"
builtin/init-db.c +1 -0
@@ -5,6 +5,7 @@*/ #include "cache.h" #include "config.h" +#include "gettext.h" #include "refs.h" #include "builtin.h" #include "exec-cmd.h"
builtin/interpret-trailers.c +1 -0
@@ -7,6 +7,7 @@#include "cache.h" #include "builtin.h" +#include "gettext.h" #include "parse-options.h" #include "string-list.h" #include "trailer.h"
builtin/log.c +1 -0
@@ -7,6 +7,7 @@#include "git-compat-util.h" #include "alloc.h" #include "config.h" +#include "gettext.h" #include "hex.h" #include "refs.h" #include "object-store.h"
builtin/ls-files.c +1 -0
@@ -11,6 +11,7 @@#include "quote.h" #include "dir.h" #include "builtin.h" +#include "gettext.h" #include "strbuf.h" #include "tree.h" #include "cache-tree.h"
builtin/ls-remote.c +1 -0
@@ -1,5 +1,6 @@#include "builtin.h" #include "cache.h" +#include "gettext.h" #include "hex.h" #include "transport.h" #include "ref-filter.h"
builtin/ls-tree.c +1 -0
@@ -5,6 +5,7 @@*/ #include "cache.h" #include "config.h" +#include "gettext.h" #include "hex.h" #include "object-store.h" #include "blob.h"
builtin/mailinfo.c +1 -0
@@ -4,6 +4,7 @@*/ #include "cache.h" #include "builtin.h" +#include "gettext.h" #include "utf8.h" #include "strbuf.h" #include "mailinfo.h"
builtin/mailsplit.c +1 -0
@@ -6,6 +6,7 @@*/ #include "cache.h" #include "builtin.h" +#include "gettext.h" #include "string-list.h" #include "strbuf.h"
builtin/merge-base.c +1 -0
@@ -2,6 +2,7 @@#include "cache.h" #include "config.h" #include "commit.h" +#include "gettext.h" #include "hex.h" #include "refs.h" #include "diff.h"
builtin/merge-file.c +1 -0
@@ -1,6 +1,7 @@#include "builtin.h" #include "cache.h" #include "config.h" +#include "gettext.h" #include "xdiff/xdiff.h" #include "xdiff-interface.h" #include "parse-options.h"
builtin/merge-recursive.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "builtin.h" #include "commit.h" +#include "gettext.h" #include "tag.h" #include "merge-recursive.h" #include "xdiff-interface.h"
builtin/merge-tree.c +1 -0
@@ -3,6 +3,7 @@#include "tree-walk.h" #include "xdiff-interface.h" #include "help.h" +#include "gettext.h" #include "hex.h" #include "commit.h" #include "commit-reach.h"
builtin/merge.c +1 -0
@@ -10,6 +10,7 @@#include "cache.h" #include "alloc.h" #include "config.h" +#include "gettext.h" #include "hex.h" #include "parse-options.h" #include "builtin.h"
builtin/mktag.c +1 -0
@@ -1,4 +1,5 @@#include "builtin.h" +#include "gettext.h" #include "hex.h" #include "parse-options.h" #include "tag.h"
builtin/mktree.c +1 -0
@@ -5,6 +5,7 @@*/ #include "builtin.h" #include "alloc.h" +#include "gettext.h" #include "hex.h" #include "quote.h" #include "tree.h"
builtin/multi-pack-index.c +1 -0
@@ -1,6 +1,7 @@#include "builtin.h" #include "cache.h" #include "config.h" +#include "gettext.h" #include "parse-options.h" #include "midx.h" #include "trace2.h"
builtin/mv.c +1 -0
@@ -7,6 +7,7 @@#include "builtin.h" #include "alloc.h" #include "config.h" +#include "gettext.h" #include "pathspec.h" #include "lockfile.h" #include "dir.h"
builtin/name-rev.c +1 -0
@@ -1,5 +1,6 @@#include "builtin.h" #include "alloc.h" +#include "gettext.h" #include "hex.h" #include "repository.h" #include "config.h"
builtin/notes.c +1 -0
@@ -10,6 +10,7 @@#include "cache.h" #include "config.h" #include "builtin.h" +#include "gettext.h" #include "hex.h" #include "notes.h" #include "object-store.h"
builtin/pack-objects.c +1 -0
@@ -1,5 +1,6 @@#include "builtin.h" #include "alloc.h" +#include "gettext.h" #include "hex.h" #include "repository.h" #include "config.h"
builtin/pack-redundant.c +1 -0
@@ -7,6 +7,7 @@*/ #include "builtin.h" +#include "gettext.h" #include "hex.h" #include "repository.h" #include "packfile.h"
builtin/pack-refs.c +1 -0
@@ -1,5 +1,6 @@#include "builtin.h" #include "config.h" +#include "gettext.h" #include "parse-options.h" #include "refs.h" #include "repository.h"
builtin/patch-id.c +1 -0
@@ -2,6 +2,7 @@#include "builtin.h" #include "config.h" #include "diff.h" +#include "gettext.h" #include "hex.h" #include "parse-options.h"
builtin/prune-packed.c +1 -0
@@ -1,4 +1,5 @@#include "builtin.h" +#include "gettext.h" #include "parse-options.h" #include "prune-packed.h"
builtin/prune.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "commit.h" #include "diff.h" +#include "gettext.h" #include "hex.h" #include "revision.h" #include "builtin.h"
builtin/pull.c +1 -0
@@ -9,6 +9,7 @@#include "cache.h" #include "config.h" #include "builtin.h" +#include "gettext.h" #include "hex.h" #include "parse-options.h" #include "exec-cmd.h"
builtin/push.c +1 -0
@@ -4,6 +4,7 @@#include "cache.h" #include "branch.h" #include "config.h" +#include "gettext.h" #include "refs.h" #include "refspec.h" #include "run-command.h"
builtin/range-diff.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "builtin.h" +#include "gettext.h" #include "parse-options.h" #include "range-diff.h" #include "config.h"
builtin/read-tree.c +1 -0
@@ -7,6 +7,7 @@#define USE_THE_INDEX_VARIABLE #include "cache.h" #include "config.h" +#include "gettext.h" #include "hex.h" #include "lockfile.h" #include "object.h"
builtin/rebase.c +1 -0
@@ -6,6 +6,7 @@#define USE_THE_INDEX_VARIABLE #include "builtin.h" +#include "gettext.h" #include "hex.h" #include "run-command.h" #include "exec-cmd.h"
builtin/receive-pack.c +1 -0
@@ -1,6 +1,7 @@#include "builtin.h" #include "repository.h" #include "config.h" +#include "gettext.h" #include "hex.h" #include "lockfile.h" #include "pack.h"
builtin/reflog.c +1 -0
@@ -1,5 +1,6 @@#include "builtin.h" #include "config.h" +#include "gettext.h" #include "revision.h" #include "reachable.h" #include "worktree.h"
builtin/remote.c +1 -0
@@ -1,5 +1,6 @@#include "builtin.h" #include "config.h" +#include "gettext.h" #include "parse-options.h" #include "transport.h" #include "remote.h"
builtin/repack.c +1 -0
@@ -2,6 +2,7 @@#include "alloc.h" #include "config.h" #include "dir.h" +#include "gettext.h" #include "hex.h" #include "parse-options.h" #include "run-command.h"
builtin/replace.c +1 -0
@@ -11,6 +11,7 @@#include "cache.h" #include "config.h" #include "builtin.h" +#include "gettext.h" #include "hex.h" #include "refs.h" #include "parse-options.h"
builtin/rerere.c +1 -0
@@ -2,6 +2,7 @@#include "cache.h" #include "config.h" #include "dir.h" +#include "gettext.h" #include "parse-options.h" #include "string-list.h" #include "rerere.h"
builtin/reset.c +1 -0
@@ -10,6 +10,7 @@#define USE_THE_INDEX_VARIABLE #include "builtin.h" #include "config.h" +#include "gettext.h" #include "hex.h" #include "lockfile.h" #include "tag.h"
builtin/rev-list.c +1 -0
@@ -2,6 +2,7 @@#include "config.h" #include "commit.h" #include "diff.h" +#include "gettext.h" #include "hex.h" #include "revision.h" #include "list-objects.h"
builtin/rev-parse.c +1 -0
@@ -8,6 +8,7 @@#include "alloc.h" #include "config.h" #include "commit.h" +#include "gettext.h" #include "hex.h" #include "refs.h" #include "quote.h"
builtin/revert.c +1 -0
@@ -4,6 +4,7 @@#include "builtin.h" #include "parse-options.h" #include "diff.h" +#include "gettext.h" #include "revision.h" #include "rerere.h" #include "dir.h"
builtin/rm.c +1 -0
@@ -11,6 +11,7 @@#include "lockfile.h" #include "dir.h" #include "cache-tree.h" +#include "gettext.h" #include "tree-walk.h" #include "parse-options.h" #include "string-list.h"
builtin/shortlog.c +1 -0
@@ -3,6 +3,7 @@#include "config.h" #include "commit.h" #include "diff.h" +#include "gettext.h" #include "string-list.h" #include "revision.h" #include "utf8.h"
builtin/show-branch.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "config.h" +#include "gettext.h" #include "hex.h" #include "pretty.h" #include "refs.h"
builtin/show-index.c +1 -0
@@ -1,5 +1,6 @@#include "builtin.h" #include "cache.h" +#include "gettext.h" #include "hex.h" #include "pack.h" #include "parse-options.h"
builtin/show-ref.c +1 -0
@@ -1,6 +1,7 @@#include "builtin.h" #include "cache.h" #include "config.h" +#include "gettext.h" #include "hex.h" #include "refs.h" #include "object-store.h"
builtin/sparse-checkout.c +1 -0
@@ -2,6 +2,7 @@#include "cache.h" #include "config.h" #include "dir.h" +#include "gettext.h" #include "parse-options.h" #include "pathspec.h" #include "repository.h"
builtin/stash.c +1 -0
@@ -1,6 +1,7 @@#define USE_THE_INDEX_VARIABLE #include "builtin.h" #include "config.h" +#include "gettext.h" #include "hex.h" #include "parse-options.h" #include "refs.h"
builtin/stripspace.c +1 -0
@@ -1,6 +1,7 @@#include "builtin.h" #include "cache.h" #include "config.h" +#include "gettext.h" #include "parse-options.h" #include "strbuf.h"
builtin/submodule--helper.c +1 -0
@@ -1,6 +1,7 @@#define USE_THE_INDEX_VARIABLE #include "builtin.h" #include "alloc.h" +#include "gettext.h" #include "hex.h" #include "repository.h" #include "cache.h"
builtin/symbolic-ref.c +1 -0
@@ -1,6 +1,7 @@#include "builtin.h" #include "config.h" #include "cache.h" +#include "gettext.h" #include "refs.h" #include "parse-options.h"
builtin/tag.c +1 -0
@@ -9,6 +9,7 @@#include "cache.h" #include "config.h" #include "builtin.h" +#include "gettext.h" #include "hex.h" #include "refs.h" #include "object-store.h"
builtin/unpack-objects.c +1 -0
@@ -2,6 +2,7 @@#include "cache.h" #include "bulk-checkin.h" #include "config.h" +#include "gettext.h" #include "hex.h" #include "object-store.h" #include "object.h"
builtin/update-index.c +1 -0
@@ -7,6 +7,7 @@#include "cache.h" #include "bulk-checkin.h" #include "config.h" +#include "gettext.h" #include "hex.h" #include "lockfile.h" #include "quote.h"
builtin/update-ref.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "config.h" +#include "gettext.h" #include "refs.h" #include "builtin.h" #include "parse-options.h"
builtin/update-server-info.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "config.h" #include "builtin.h" +#include "gettext.h" #include "parse-options.h" static const char *const update_server_info_usage[] = {
builtin/upload-pack.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "builtin.h" #include "exec-cmd.h" +#include "gettext.h" #include "pkt-line.h" #include "parse-options.h" #include "protocol.h"
builtin/verify-commit.c +1 -0
@@ -8,6 +8,7 @@#include "cache.h" #include "config.h" #include "builtin.h" +#include "gettext.h" #include "object-store.h" #include "repository.h" #include "commit.h"
builtin/verify-pack.c +1 -0
@@ -1,6 +1,7 @@#include "builtin.h" #include "cache.h" #include "config.h" +#include "gettext.h" #include "run-command.h" #include "parse-options.h"
builtin/verify-tag.c +1 -0
@@ -8,6 +8,7 @@#include "cache.h" #include "config.h" #include "builtin.h" +#include "gettext.h" #include "tag.h" #include "run-command.h" #include "parse-options.h"
builtin/worktree.c +1 -0
@@ -3,6 +3,7 @@#include "config.h" #include "builtin.h" #include "dir.h" +#include "gettext.h" #include "hex.h" #include "parse-options.h" #include "strvec.h"
builtin/write-tree.c +1 -0
@@ -7,6 +7,7 @@#include "builtin.h" #include "cache.h" #include "config.h" +#include "gettext.h" #include "hex.h" #include "tree.h" #include "cache-tree.h"
bulk-checkin.c +1 -0
@@ -4,6 +4,7 @@#include "git-compat-util.h" #include "alloc.h" #include "bulk-checkin.h" +#include "gettext.h" #include "hex.h" #include "lockfile.h" #include "repository.h"
bundle-uri.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "bundle-uri.h" #include "bundle.h" +#include "gettext.h" #include "object-store.h" #include "refs.h" #include "run-command.h"
bundle.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "lockfile.h" #include "bundle.h" +#include "gettext.h" #include "hex.h" #include "object-store.h" #include "repository.h"
chunk-format.c +1 -0
@@ -2,6 +2,7 @@#include "alloc.h" #include "chunk-format.h" #include "csum-file.h" +#include "gettext.h" /* * When writing a chunk-based file format, collect the chunks in
color.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "config.h" #include "color.h" +#include "gettext.h" #include "hex.h" static int git_use_color_default =GIT_COLOR_AUTO ;
commit-graph.c +1 -0
@@ -1,5 +1,6 @@#include "git-compat-util.h" #include "config.h" +#include "gettext.h" #include "hex.h" #include "lockfile.h" #include "pack.h"
commit.c +1 -0
@@ -2,6 +2,7 @@#include "tag.h" #include "commit.h" #include "commit-graph.h" +#include "gettext.h" #include "hex.h" #include "repository.h" #include "object-store.h"
common-main.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "exec-cmd.h" +#include "gettext.h" #include "attr.h" /*
compat/disk.h +1 -0
@@ -2,6 +2,7 @@#define COMPAT_DISK_H #include "git-compat-util.h" +#include "gettext.h" static int get_disk_info (struct strbuf *out) {
compat/fsmonitor/fsm-health-win32.c +1 -0
@@ -3,6 +3,7 @@#include "fsmonitor.h" #include "fsm-health.h" #include "fsmonitor--daemon.h" +#include "gettext.h" /* * Every minute wake up and test our health.
compat/fsmonitor/fsm-listen-darwin.c +1 -0
@@ -28,6 +28,7 @@#include "fsm-listen.h" #include "fsmonitor--daemon.h" #include "fsmonitor-path-utils.h" +#include "gettext.h" struct fsm_listen_data {
compat/fsmonitor/fsm-listen-win32.c +1 -0
@@ -3,6 +3,7 @@#include "fsmonitor.h" #include "fsm-listen.h" #include "fsmonitor--daemon.h" +#include "gettext.h" /* * The documentation of ReadDirectoryChangesW() states that the maximum
compat/fsmonitor/fsm-path-utils-darwin.c +1 -0
@@ -1,5 +1,6 @@#include "fsmonitor.h" #include "fsmonitor-path-utils.h" +#include "gettext.h" #include <dirent.h> #include <errno.h> #include <fcntl.h>
compat/fsmonitor/fsm-path-utils-win32.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "fsmonitor.h" #include "fsmonitor-path-utils.h" +#include "gettext.h" /* * Check remote working directory protocol.
compat/mingw.c +1 -0
@@ -11,6 +11,7 @@#include "win32/lazyload.h" #include "../config.h" #include "dir.h" +#include "gettext.h" #define SECURITY_WIN32 #include <sspi.h>
compat/precompose_utf8.c +1 -0
@@ -7,6 +7,7 @@#include "cache.h" #include "config.h" +#include "gettext.h" #include "utf8.h" #include "precompose_utf8.h"
compat/simple-ipc/ipc-unix-socket.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "gettext.h" #include "simple-ipc.h" #include "strbuf.h" #include "pkt-line.h"
compat/simple-ipc/ipc-win32.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "gettext.h" #include "simple-ipc.h" #include "strbuf.h" #include "pkt-line.h"
compat/terminal.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "compat/terminal.h" +#include "gettext.h" #include "sigchain.h" #include "strbuf.h" #include "run-command.h"
config.c +1 -0
@@ -11,6 +11,7 @@#include "branch.h" #include "config.h" #include "environment.h" +#include "gettext.h" #include "ident.h" #include "repository.h" #include "lockfile.h"
connect.c +1 -0
@@ -1,6 +1,7 @@#include "git-compat-util.h" #include "cache.h" #include "config.h" +#include "gettext.h" #include "hex.h" #include "pkt-line.h" #include "quote.h"
connected.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "gettext.h" #include "hex.h" #include "object-store.h" #include "run-command.h"
convert.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "config.h" +#include "gettext.h" #include "hex.h" #include "object-store.h" #include "attr.h"
credential.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "config.h" #include "credential.h" +#include "gettext.h" #include "string-list.h" #include "run-command.h" #include "url.h"
date.c +1 -0
@@ -6,6 +6,7 @@#include "cache.h" #include "date.h" +#include "gettext.h" /* * This is like mktime, but without normalization of tm_wday and tm_yday.
delta-islands.c +1 -0
@@ -4,6 +4,7 @@#include "object.h" #include "blob.h" #include "commit.h" +#include "gettext.h" #include "hex.h" #include "tag.h" #include "tree.h"
diagnose.c +1 -0
@@ -4,6 +4,7 @@#include "archive.h" #include "dir.h" #include "help.h" +#include "gettext.h" #include "hex.h" #include "strvec.h" #include "object-store.h"
diff-lib.c +1 -0
@@ -6,6 +6,7 @@#include "commit.h" #include "diff.h" #include "diffcore.h" +#include "gettext.h" #include "hex.h" #include "revision.h" #include "cache-tree.h"
diff-no-index.c +1 -0
@@ -11,6 +11,7 @@#include "tag.h" #include "diff.h" #include "diffcore.h" +#include "gettext.h" #include "revision.h" #include "log-tree.h" #include "parse-options.h"
diff.c +1 -0
@@ -4,6 +4,7 @@#include "cache.h" #include "alloc.h" #include "config.h" +#include "gettext.h" #include "tempfile.h" #include "quote.h" #include "diff.h"
dir.c +1 -0
@@ -9,6 +9,7 @@#include "alloc.h" #include "config.h" #include "dir.h" +#include "gettext.h" #include "object-store.h" #include "attr.h" #include "refs.h"
editor.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "config.h" +#include "gettext.h" #include "strbuf.h" #include "strvec.h" #include "run-command.h"
entry.c +1 -0
@@ -2,6 +2,7 @@#include "blob.h" #include "object-store.h" #include "dir.h" +#include "gettext.h" #include "hex.h" #include "streaming.h" #include "submodule.h"
environment.c +1 -0
@@ -10,6 +10,7 @@#include "cache.h" #include "branch.h" #include "environment.h" +#include "gettext.h" #include "repository.h" #include "config.h" #include "refs.h"
exec-cmd.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "exec-cmd.h" +#include "gettext.h" #include "quote.h" #include "strvec.h"
fetch-pack.c +1 -0
@@ -2,6 +2,7 @@#include "alloc.h" #include "repository.h" #include "config.h" +#include "gettext.h" #include "hex.h" #include "lockfile.h" #include "refs.h"
fsmonitor-ipc.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "fsmonitor.h" +#include "gettext.h" #include "simple-ipc.h" #include "fsmonitor-ipc.h" #include "run-command.h"
git.c +1 -0
@@ -1,6 +1,7 @@#include "builtin.h" #include "config.h" #include "exec-cmd.h" +#include "gettext.h" #include "help.h" #include "run-command.h" #include "alias.h"
gpg-interface.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "commit.h" #include "config.h" +#include "gettext.h" #include "run-command.h" #include "strbuf.h" #include "dir.h"
grep.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "config.h" +#include "gettext.h" #include "grep.h" #include "hex.h" #include "object-store.h"
http-fetch.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "config.h" #include "exec-cmd.h" +#include "gettext.h" #include "hex.h" #include "http.h" #include "walker.h"
imap-send.c +1 -0
@@ -25,6 +25,7 @@#include "config.h" #include "credential.h" #include "exec-cmd.h" +#include "gettext.h" #include "run-command.h" #include "parse-options.h" #if defined(NO_OPENSSL ) && !defined(HAVE_OPENSSL_CSPRNG )
list-objects-filter-options.h +1 -0
@@ -1,6 +1,7 @@#ifndef LIST_OBJECTS_FILTER_OPTIONS_H #define LIST_OBJECTS_FILTER_OPTIONS_H +#include "gettext.h" #include "object.h" #include "parse-options.h" #include "string-list.h"
list-objects-filter.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "alloc.h" #include "dir.h" +#include "gettext.h" #include "hex.h" #include "tag.h" #include "commit.h"
list-objects.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "tag.h" #include "commit.h" +#include "gettext.h" #include "hex.h" #include "tree.h" #include "blob.h"
lockfile.c +1 -0
@@ -3,6 +3,7 @@*/ #include "cache.h" +#include "gettext.h" #include "lockfile.h" /*
ls-refs.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "gettext.h" #include "hex.h" #include "repository.h" #include "refs.h"
merge-ort-wrappers.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "gettext.h" #include "merge-ort.h" #include "merge-ort-wrappers.h"
merge-ort.c +1 -0
@@ -26,6 +26,7 @@#include "diff.h" #include "diffcore.h" #include "dir.h" +#include "gettext.h" #include "hex.h" #include "entry.h" #include "ll-merge.h"
merge-recursive.c +1 -0
@@ -17,6 +17,7 @@#include "diff.h" #include "diffcore.h" #include "dir.h" +#include "gettext.h" #include "hex.h" #include "ll-merge.h" #include "lockfile.h"
merge.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "diff.h" #include "diffcore.h" +#include "gettext.h" #include "hex.h" #include "lockfile.h" #include "commit.h"
midx.c +1 -0
@@ -3,6 +3,7 @@#include "config.h" #include "csum-file.h" #include "dir.h" +#include "gettext.h" #include "hex.h" #include "lockfile.h" #include "packfile.h"
name-hash.c +1 -0
@@ -6,6 +6,7 @@* Copyright (C) 2008 Linus Torvalds */ #include "cache.h" +#include "gettext.h" #include "thread-utils.h" #include "trace2.h" #include "sparse-index.h"
notes-merge.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "commit.h" +#include "gettext.h" #include "refs.h" #include "object-store.h" #include "repository.h"
notes-utils.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "config.h" #include "commit.h" +#include "gettext.h" #include "refs.h" #include "notes-utils.h" #include "repository.h"
object-file.c +1 -0
@@ -9,6 +9,7 @@#include "git-compat-util.h" #include "alloc.h" #include "config.h" +#include "gettext.h" #include "hex.h" #include "string-list.h" #include "lockfile.h"
object-name.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "config.h" +#include "gettext.h" #include "hex.h" #include "tag.h" #include "commit.h"
object.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "gettext.h" #include "hex.h" #include "object.h" #include "replace-object.h"
pack-bitmap-write.c +1 -0
@@ -1,5 +1,6 @@#include "git-compat-util.h" #include "alloc.h" +#include "gettext.h" #include "hex.h" #include "object-store.h" #include "commit.h"
pack-bitmap.c +1 -0
@@ -1,6 +1,7 @@#include "git-compat-util.h" #include "alloc.h" #include "commit.h" +#include "gettext.h" #include "hex.h" #include "strbuf.h" #include "tag.h"
pack-mtimes.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "gettext.h" #include "pack-mtimes.h" #include "object-store.h" #include "packfile.h"
pack-revindex.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "gettext.h" #include "pack-revindex.h" #include "object-store.h" #include "packfile.h"
pack-write.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "gettext.h" #include "hex.h" #include "pack.h" #include "csum-file.h"
packfile.c +1 -0
@@ -1,5 +1,6 @@#include "git-compat-util.h" #include "alloc.h" +#include "gettext.h" #include "hex.h" #include "list.h" #include "pack.h"
parallel-checkout.c +1 -0
@@ -2,6 +2,7 @@#include "alloc.h" #include "config.h" #include "entry.h" +#include "gettext.h" #include "hex.h" #include "parallel-checkout.h" #include "pkt-line.h"
parse-options-cb.c +1 -0
@@ -4,6 +4,7 @@#include "cache.h" #include "commit.h" #include "color.h" +#include "gettext.h" #include "string-list.h" #include "strvec.h" #include "oid-array.h"
parse-options.c +1 -0
@@ -4,6 +4,7 @@#include "config.h" #include "commit.h" #include "color.h" +#include "gettext.h" #include "utf8.h" static int disallow_abbreviated_options;
parse-options.h +2 -0
@@ -1,6 +1,8 @@#ifndef PARSE_OPTIONS_H #define PARSE_OPTIONS_H +#include "gettext.h" +/** * Refer to Documentation/technical/api-parse-options.txt for the API doc. */
path.c +1 -0
@@ -2,6 +2,7 @@* Utilities for paths and pathnames */ #include "cache.h" +#include "gettext.h" #include "hex.h" #include "repository.h" #include "strbuf.h"
pathspec.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "config.h" #include "dir.h" +#include "gettext.h" #include "pathspec.h" #include "attr.h" #include "strvec.h"
pkt-line.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "pkt-line.h" +#include "gettext.h" #include "hex.h" #include "run-command.h"
preload-index.c +1 -0
@@ -5,6 +5,7 @@#include "pathspec.h" #include "dir.h" #include "fsmonitor.h" +#include "gettext.h" #include "config.h" #include "progress.h" #include "thread-utils.h"
pretty.c +1 -0
@@ -2,6 +2,7 @@#include "alloc.h" #include "config.h" #include "commit.h" +#include "gettext.h" #include "hex.h" #include "utf8.h" #include "diff.h"
promisor-remote.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "gettext.h" #include "hex.h" #include "object-store.h" #include "promisor-remote.h"
prune-packed.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "gettext.h" #include "object-store.h" #include "packfile.h" #include "progress.h"
range-diff.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "gettext.h" #include "range-diff.h" #include "string-list.h" #include "run-command.h"
reachable.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "gettext.h" #include "hex.h" #include "refs.h" #include "tag.h"
read-cache.c +1 -0
@@ -18,6 +18,7 @@#include "tree.h" #include "commit.h" #include "blob.h" +#include "gettext.h" #include "resolve-undo.h" #include "run-command.h" #include "strbuf.h"
rebase-interactive.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "commit.h" +#include "gettext.h" #include "sequencer.h" #include "rebase-interactive.h" #include "strbuf.h"
ref-filter.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "alloc.h" +#include "gettext.h" #include "hex.h" #include "parse-options.h" #include "refs.h"
ref-filter.h +1 -0
@@ -1,6 +1,7 @@#ifndef REF_FILTER_H #define REF_FILTER_H +#include "gettext.h" #include "oid-array.h" #include "refs.h" #include "commit.h"
reflog.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "gettext.h" #include "object-store.h" #include "reflog.h" #include "refs.h"
refs.c +1 -0
@@ -6,6 +6,7 @@#include "alloc.h" #include "config.h" #include "hashmap.h" +#include "gettext.h" #include "hex.h" #include "lockfile.h" #include "iterator.h"
refs/files-backend.c +1 -0
@@ -1,5 +1,6 @@#include "../cache.h" #include "../config.h" +#include "../gettext.h" #include "../hex.h" #include "../refs.h" #include "refs-internal.h"
refs/packed-backend.c +1 -0
@@ -1,6 +1,7 @@#include "../cache.h" #include "../alloc.h" #include "../config.h" +#include "../gettext.h" #include "../hex.h" #include "../refs.h" #include "refs-internal.h"
remote-curl.c +1 -0
@@ -1,6 +1,7 @@#include "git-compat-util.h" #include "alloc.h" #include "config.h" +#include "gettext.h" #include "hex.h" #include "remote.h" #include "connect.h"
remote.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "alloc.h" #include "config.h" +#include "gettext.h" #include "hex.h" #include "remote.h" #include "urlmatch.h"
replace-object.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "gettext.h" #include "hex.h" #include "oidmap.h" #include "object-store.h"
rerere.c +1 -0
@@ -1,6 +1,7 @@#include "git-compat-util.h" #include "alloc.h" #include "config.h" +#include "gettext.h" #include "hex.h" #include "lockfile.h" #include "string-list.h"
rerere.h +1 -0
@@ -1,6 +1,7 @@#ifndef RERERE_H #define RERERE_H +#include "gettext.h" #include "string-list.h" struct pathspec ;
reset.c +1 -0
@@ -1,5 +1,6 @@#include "git-compat-util.h" #include "cache-tree.h" +#include "gettext.h" #include "hex.h" #include "lockfile.h" #include "refs.h"
revision.c +1 -0
@@ -1,6 +1,7 @@#include "git-compat-util.h" #include "alloc.h" #include "config.h" +#include "gettext.h" #include "hex.h" #include "object-store.h" #include "tag.h"
run-command.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "run-command.h" #include "exec-cmd.h" +#include "gettext.h" #include "sigchain.h" #include "strvec.h" #include "thread-utils.h"
send-pack.c +1 -0
@@ -1,6 +1,7 @@#include "git-compat-util.h" #include "config.h" #include "commit.h" +#include "gettext.h" #include "hex.h" #include "refs.h" #include "object-store.h"
sequencer.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "alloc.h" #include "config.h" +#include "gettext.h" #include "hex.h" #include "lockfile.h" #include "dir.h"
setup.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "gettext.h" #include "repository.h" #include "config.h" #include "dir.h"
sideband.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "color.h" #include "config.h" +#include "gettext.h" #include "sideband.h" #include "help.h" #include "pkt-line.h"
sparse-index.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "alloc.h" +#include "gettext.h" #include "repository.h" #include "sparse-index.h" #include "tree.h"
split-index.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "alloc.h" +#include "gettext.h" #include "split-index.h" #include "ewah/ewok.h"
strbuf.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "alloc.h" +#include "gettext.h" #include "hex.h" #include "refs.h" #include "string-list.h"
submodule-config.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "alloc.h" #include "dir.h" +#include "gettext.h" #include "hex.h" #include "repository.h" #include "config.h"
submodule.c +1 -0
@@ -7,6 +7,7 @@#include "dir.h" #include "diff.h" #include "commit.h" +#include "gettext.h" #include "hex.h" #include "revision.h" #include "run-command.h"
symlinks.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "gettext.h" static int threaded_check_leading_path (struct cache_def *cache,const char *name,int len,int warn_on_lstat_err);
t/helper/test-cache-tree.c +1 -0
@@ -1,6 +1,7 @@#define USE_THE_INDEX_VARIABLE #include "test-tool.h" #include "cache.h" +#include "gettext.h" #include "hex.h" #include "tree.h" #include "cache-tree.h"
t/helper/test-fast-rebase.c +1 -0
@@ -15,6 +15,7 @@#include "cache.h" #include "cache-tree.h" #include "commit.h" +#include "gettext.h" #include "hex.h" #include "lockfile.h" #include "merge-ort.h"
t/helper/test-reach.c +1 -0
@@ -4,6 +4,7 @@#include "commit.h" #include "commit-reach.h" #include "config.h" +#include "gettext.h" #include "hex.h" #include "parse-options.h" #include "ref-filter.h"
t/helper/test-serve-v2.c +1 -0
@@ -1,5 +1,6 @@#include "test-tool.h" #include "cache.h" +#include "gettext.h" #include "parse-options.h" #include "serve.h"
trailer.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "alloc.h" #include "config.h" +#include "gettext.h" #include "string-list.h" #include "run-command.h" #include "commit.h"
transport-helper.c +1 -0
@@ -4,6 +4,7 @@#include "run-command.h" #include "commit.h" #include "diff.h" +#include "gettext.h" #include "hex.h" #include "revision.h" #include "remote.h"
tree-walk.c +1 -0
@@ -2,6 +2,7 @@#include "tree-walk.h" #include "alloc.h" #include "dir.h" +#include "gettext.h" #include "hex.h" #include "object-store.h" #include "tree.h"
unpack-trees.c +1 -0
@@ -3,6 +3,7 @@#include "repository.h" #include "config.h" #include "dir.h" +#include "gettext.h" #include "hex.h" #include "tree.h" #include "tree-walk.h"
upload-pack.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "config.h" +#include "gettext.h" #include "hex.h" #include "refs.h" #include "pkt-line.h"
usage.c +1 -1
@@ -3,8 +3,8 @@* * Copyright (C) Linus Torvalds, 2005 */ -#include "git-compat-util.h" #include "cache.h" +#include "gettext.h" static void vreportf (const char *prefix,const char *err,va_list params) {
walker.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "gettext.h" #include "hex.h" #include "walker.h" #include "repository.h"
worktree.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "alloc.h" +#include "gettext.h" #include "repository.h" #include "refs.h" #include "strbuf.h"
wrapper.c +1 -0
@@ -3,6 +3,7 @@*/ #include "cache.h" #include "config.h" +#include "gettext.h" static intmax_t count_fsync_writeout_only;static intmax_t count_fsync_hardware_flush;
wt-status.c +1 -0
@@ -4,6 +4,7 @@#include "dir.h" #include "commit.h" #include "diff.h" +#include "gettext.h" #include "hex.h" #include "revision.h" #include "diffcore.h"
Signature · 1 line
gitgitgadget
PATCH 10/16 treewide: remove unnecessary includes of cache.h
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
The last several commits were geared at replacing the include of cache.h in strbuf.c with an include of git-compat-util.h. Unfortunately, I had to drop a patch moving some functions from cache.h to object-name.h, due to excessive conflicts with other in-flight topics.
However, even without that patch, the series of patches so far allows us to modify a number of C files to replace an include of cache.h with git-compat-util.h. Do that to reduce our dependencies.
(If we could have kept our object-name.h patch in this series, it would have also let us reduce the includes in checkout.c and fmt-merge-msg.c in addition to strbuf.c).
Just to ensure that nothing else was bringing in cache.h, all of the affected files have been checked to ensure that
gcc -E -I. $SOURCE_FILE | grep '"cache.h"'
found no hits and that
make DEVELOPER=1 ${OBJECT_FILE_FOR_SOURCE_FILE}successfully compiles without warnings.
--- compat/terminal.c | 2 +- gpg-interface.c | 2 +- lockfile.c | 2 +- parse-options.c | 1 - t/helper/test-delta.c | 1 - t/helper/test-trace2.c | 2 +- tempfile.c | 3 ++- trace2/tr2_cfg.c | 4 +++- trace2/tr2_cmd_name.c | 3 ++- trace2/tr2_dst.c | 3 ++- trace2/tr2_sid.c | 3 ++- usage.c | 3 ++- 12 files changed, 17 insertions(+), 12 deletions(-)
compat/terminal.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "compat/terminal.h" #include "gettext.h" #include "sigchain.h"
gpg-interface.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "commit.h" #include "config.h" #include "gettext.h"
lockfile.c +1 -1
@@ -2,7 +2,7 @@* Copyright (c) 2005, Junio C Hamano */ -#include "cache.h" +#include "git-compat-util.h" #include "abspath.h" #include "gettext.h" #include "lockfile.h"
parse-options.c +0 -1
@@ -1,7 +1,6 @@#include "git-compat-util.h" #include "parse-options.h" #include "abspath.h" -#include "cache.h" #include "config.h" #include "commit.h" #include "color.h"
t/helper/test-delta.c +0 -1
@@ -11,7 +11,6 @@#include "test-tool.h" #include "git-compat-util.h" #include "delta.h" -#include "cache.h" #include "wrapper.h" static const char usage_str[] =
t/helper/test-trace2.c +1 -1
@@ -1,9 +1,9 @@#include "test-tool.h" -#include "cache.h" #include "strvec.h" #include "run-command.h" #include "exec-cmd.h" #include "config.h" +#include "trace2.h" typedef int (fn_unit_test )(int argc,const char **argv);
tempfile.c +2 -1
@@ -42,7 +42,8 @@* file created by its parent. */ -#include "cache.h" +#include "git-compat-util.h" +#include "path.h" #include "tempfile.h" #include "sigchain.h" #include "wrapper.h"
trace2/tr2_cfg.c +3 -1
@@ -1,5 +1,7 @@ -#include "cache.h" +#include "git-compat-util.h" #include "config.h" +#include "strbuf.h" +#include "trace2.h" #include "trace2/tr2_cfg.h" #include "trace2/tr2_sysenv.h"
trace2/tr2_cmd_name.c +2 -1
@@ -1,4 +1,5 @@ -#include "cache.h" +#include "git-compat-util.h" +#include "strbuf.h" #include "trace2/tr2_cmd_name.h" #define TR2_ENVVAR_PARENT_NAME "GIT_TRACE2_PARENT_NAME"
trace2/tr2_dst.c +2 -1
@@ -1,6 +1,7 @@ -#include "cache.h" +#include "git-compat-util.h" #include "abspath.h" #include "sigchain.h" +#include "strbuf.h" #include "trace2/tr2_dst.h" #include "trace2/tr2_sid.h" #include "trace2/tr2_sysenv.h"
trace2/tr2_sid.c +2 -1
@@ -1,5 +1,6 @@ -#include "cache.h" +#include "git-compat-util.h" #include "hex.h" +#include "strbuf.h" #include "trace2/tr2_tbuf.h" #include "trace2/tr2_sid.h"
usage.c +2 -1
@@ -3,8 +3,9 @@* * Copyright (C) Linus Torvalds, 2005 */ -#include "cache.h" +#include "git-compat-util.h" #include "gettext.h" +#include "trace2.h" #include "wrapper.h" static void vreportf (const char *prefix,const char *err,va_list params)
Signature · 1 line
gitgitgadget
PATCH 12/16 treewide: remove cache.h inclusion due to environment.h changes
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
--- csum-file.c | 2 +- gettext.c | 2 +- ls-refs.c | 2 +- notes-utils.c | 2 +- prompt.c | 2 +- prune-packed.c | 2 +- reachable.c | 2 +- t/helper/test-bitmap.c | 2 +- trailer.c | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-)
csum-file.c +1 -1
@@ -7,7 +7,7 @@* files. Useful when you write a file that you want to be * able to verify hasn't been messed with afterwards. */ -#include "cache.h" +#include "git-compat-util.h" #include "progress.h" #include "csum-file.h" #include "wrapper.h"
gettext.c +1 -1
@@ -2,7 +2,7 @@* Copyright (c) 2010 Ævar Arnfjörð Bjarmason */ -#include "cache.h" +#include "git-compat-util.h" #include "abspath.h" #include "environment.h" #include "exec-cmd.h"
ls-refs.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "environment.h" #include "gettext.h" #include "hex.h"
notes-utils.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "config.h" #include "commit.h" #include "environment.h"
prompt.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "config.h" #include "environment.h" #include "run-command.h"
prune-packed.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "environment.h" #include "gettext.h" #include "object-store.h"
reachable.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "gettext.h" #include "hex.h" #include "refs.h"
t/helper/test-bitmap.c +1 -1
@@ -1,5 +1,5 @@#include "test-tool.h" -#include "cache.h" +#include "git-compat-util.h" #include "pack-bitmap.h" static int bitmap_list_commits (void )
trailer.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 9/16 wrapper.h: move declarations for wrapper.c functions from cache.h
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
--- apply.c | 1 + builtin/am.c | 1 + builtin/bisect.c | 1 + builtin/branch.c | 1 + builtin/bugreport.c | 2 +- builtin/config.c | 1 + builtin/credential-cache.c | 1 + builtin/difftool.c | 1 + builtin/fast-import.c | 1 + builtin/fmt-merge-msg.c | 1 + builtin/gc.c | 1 + builtin/get-tar-commit-id.c | 1 + builtin/index-pack.c | 1 + builtin/init-db.c | 1 + builtin/merge.c | 1 + builtin/pack-objects.c | 1 + builtin/rebase.c | 1 + builtin/receive-pack.c | 1 + builtin/rerere.c | 1 + builtin/unpack-file.c | 1 + builtin/worktree.c | 1 + cache.h | 32 ---------------------------- commit-graph.c | 1 + compat/mingw.c | 1 + compat/terminal.c | 1 + config.c | 1 + convert.c | 1 + copy.c | 1 + csum-file.c | 1 + daemon.c | 1 + diff.c | 1 + dir.c | 1 + entry.c | 1 + environment.c | 1 + fetch-pack.c | 1 + gpg-interface.c | 1 + http-backend.c | 1 + imap-send.c | 1 + ll-merge.c | 1 + merge-recursive.c | 1 + notes-merge.c | 1 + object-file.c | 1 + packfile.c | 1 + parallel-checkout.c | 1 + pkt-line.c | 1 + read-cache.c | 1 + rebase-interactive.c | 1 + refs.c | 1 + refs/files-backend.c | 3 ++- rerere.c | 1 + sequencer.c | 1 + server-info.c | 1 + shallow.c | 1 + strbuf.c | 1 + streaming.c | 1 + t/helper/test-delta.c | 1 + t/helper/test-fsmonitor-client.c | 1 + t/helper/test-read-cache.c | 1 + tag.c | 1 + tempfile.c | 1 + trace.c | 1 + transport-helper.c | 1 + transport.c | 1 + usage.c | 1 + worktree.c | 1 + wrapper.c | 1 + wrapper.h | 36 ++++++++++++++++++++++++++++++++ write-or-die.c | 1 + 68 files changed, 103 insertions(+), 34 deletions(-) create mode 100644 wrapper.h
apply.c +1 -0
@@ -26,6 +26,7 @@#include "rerere.h" #include "apply.h" #include "entry.h" +#include "wrapper.h" struct gitdiff_data {struct strbuf *root;
builtin/am.c +1 -0
@@ -38,6 +38,7 @@#include "packfile.h" #include "repository.h" #include "pretty.h" +#include "wrapper.h" /** * Returns the length of the first line of msg.
builtin/bisect.c +1 -0
@@ -11,6 +11,7 @@#include "prompt.h" #include "quote.h" #include "revision.h" +#include "wrapper.h" static GIT_PATH_FUNC(git_path_bisect_terms, "BISECT_TERMS") static GIT_PATH_FUNC(git_path_bisect_expected_rev, "BISECT_EXPECTED_REV")
builtin/branch.c +1 -0
@@ -26,6 +26,7 @@#include "worktree.h" #include "help.h" #include "commit-reach.h" +#include "wrapper.h" static const char *const builtin_branch_usage[] = {N_ ("git branch [<options>] [-r | -a] [--merged] [--no-merged]" ),
builtin/bugreport.c +1 -1
@@ -8,7 +8,7 @@#include "hook.h" #include "hook-list.h" #include "diagnose.h" - +#include "wrapper.h" static void get_system_info (struct strbuf *sys_info) {
builtin/config.c +1 -0
@@ -9,6 +9,7 @@#include "urlmatch.h" #include "quote.h" #include "worktree.h" +#include "wrapper.h" static const char *const builtin_config_usage[] = {N_ ("git config [<options>]" ),
builtin/credential-cache.c +1 -0
@@ -1,6 +1,7 @@#include "builtin.h" #include "gettext.h" #include "parse-options.h" +#include "wrapper.h" #ifndef NO_UNIX_SOCKETS
builtin/difftool.c +1 -0
@@ -27,6 +27,7 @@#include "object-store.h" #include "dir.h" #include "entry.h" +#include "wrapper.h" static int trust_exit_code;
builtin/fast-import.c +1 -0
@@ -23,6 +23,7 @@#include "commit-reach.h" #include "khash.h" #include "date.h" +#include "wrapper.h" #define PACK_ID_BITS 16#define MAX_PACK_ID ((1<<PACK_ID_BITS)-1)
builtin/fmt-merge-msg.c +1 -0
@@ -3,6 +3,7 @@#include "fmt-merge-msg.h" #include "gettext.h" #include "parse-options.h" +#include "wrapper.h" static const char *const fmt_merge_msg_usage[] = {N_ ("git fmt-merge-msg [-m <message>] [--log[=<n>] | --no-log] [--file <file>]" ),
builtin/gc.c +1 -0
@@ -35,6 +35,7 @@#include "exec-cmd.h" #include "gettext.h" #include "hook.h" +#include "wrapper.h" #define FAILED_RUN "failed to run %s"
builtin/get-tar-commit-id.c +1 -0
@@ -6,6 +6,7 @@#include "tar.h" #include "builtin.h" #include "quote.h" +#include "wrapper.h" static const char builtin_get_tar_commit_id_usage[] ="git get-tar-commit-id" ;
builtin/index-pack.c +1 -0
@@ -19,6 +19,7 @@#include "object-store.h" #include "replace-object.h" #include "promisor-remote.h" +#include "wrapper.h" static const char index_pack_usage[] ="git index-pack [-v] [-o <index-file>] [--keep | --keep=<msg>] [--[no-]rev-index] [--verify] [--strict] (<pack-file> | --stdin [--fix-thin] [<pack-file>])" ;
builtin/init-db.c +1 -0
@@ -12,6 +12,7 @@#include "exec-cmd.h" #include "parse-options.h" #include "worktree.h" +#include "wrapper.h" #ifndef DEFAULT_GIT_TEMPLATE_DIR #define DEFAULT_GIT_TEMPLATE_DIR "/usr/share/git-core/templates"
builtin/merge.c +1 -0
@@ -49,6 +49,7 @@#include "commit-reach.h" #include "wt-status.h" #include "commit-graph.h" +#include "wrapper.h" #define DEFAULT_TWOHEAD (1<<0)#define DEFAULT_OCTOPUS (1<<1)
builtin/pack-objects.c +1 -0
@@ -40,6 +40,7 @@#include "shallow.h" #include "promisor-remote.h" #include "pack-mtimes.h" +#include "wrapper.h" /* * Objects we are going to pack are collected in the `to_pack` structure.
builtin/rebase.c +1 -0
@@ -32,6 +32,7 @@#include "rebase-interactive.h" #include "reset.h" #include "hook.h" +#include "wrapper.h" static char const *const builtin_rebase_usage[] = { N_("git rebase [-i] [options] [--exec <cmd>] "
builtin/receive-pack.c +1 -0
@@ -33,6 +33,7 @@#include "commit-reach.h" #include "worktree.h" #include "shallow.h" +#include "wrapper.h" static const char *const receive_pack_usage[] = {N_ ("git receive-pack <git-dir>" ),
builtin/rerere.c +1 -0
@@ -6,6 +6,7 @@#include "parse-options.h" #include "string-list.h" #include "rerere.h" +#include "wrapper.h" #include "xdiff/xdiff.h" #include "xdiff-interface.h" #include "pathspec.h"
builtin/unpack-file.c +1 -0
@@ -2,6 +2,7 @@#include "config.h" #include "hex.h" #include "object-store.h" +#include "wrapper.h" static char *create_temp_file (struct object_id *oid) {
builtin/worktree.c +1 -0
@@ -16,6 +16,7 @@#include "submodule.h" #include "utf8.h" #include "worktree.h" +#include "wrapper.h" #include "quote.h" #define BUILTIN_WORKTREE_ADD_USAGE \
cache.h +0 -32
@@ -1085,10 +1085,6 @@ const char *repo_find_unique_abbrev(struct repository *r, const struct object_idint repo_find_unique_abbrev_r (struct repository *r,char *hex,const struct object_id *oid,int len);#define find_unique_abbrev_r (hex, oid, len) repo_find_unique_abbrev_r(the_repository, hex, oid, len) -/* set default permissions by passing mode arguments to open(2) */ -int git_mkstemps_mode (char *pattern,int suffix_len,int mode); -int git_mkstemp_mode (char *pattern,int mode); -/* * NOTE NOTE NOTE!! *
@@ -1423,31 +1419,6 @@ static inline int batch_fsync_enabled(enum fsync_component component)return (fsync_components & component) && (fsync_method ==FSYNC_METHOD_BATCH ); } -ssize_t read_in_full (int fd,void *buf,size_t count); -ssize_t write_in_full (int fd,const void *buf,size_t count); -ssize_t pread_in_full (int fd,void *buf,size_t count,off_t offset); - -static inline ssize_t write_str_in_full (int fd,const char *str) -{ -return write_in_full (fd, str,strlen (str)); -} - -/** -* Open (and truncate) the file at path, write the contents of buf to it, -* and close it. Dies if any errors are encountered. -*/ -void write_file_buf (const char *path,const char *buf,size_t len); - -/** -* Like write_file_buf(), but format the contents into a buffer first. -* Additionally, write_file() will append a newline if one is not already -* present, making it convenient to write text files: -* -* write_file(path, "counter: %d", ctr); -*/ -__attribute__((format (printf,2 ,3 ))) -void write_file (const char *path,const char *fmt, ...); -/* pager.c */ void setup_pager (void );int pager_in_use (void );
@@ -1571,7 +1542,4 @@ int versioncmp(const char *s1, const char *s2);*/ int print_sha1_ellipsis (void ); -/* Return 1 if the file is empty or does not exists, 0 otherwise. */ -int is_empty_or_missing_file (const char *filename); -#endif /* CACHE_H */
commit-graph.c +1 -0
@@ -22,6 +22,7 @@#include "json-writer.h" #include "trace2.h" #include "chunk-format.h" +#include "wrapper.h" void git_test_write_commit_graph_or_die (void ) {
compat/mingw.c +1 -0
@@ -11,6 +11,7 @@#include "../alloc.h" #include "win32/lazyload.h" #include "../config.h" +#include "../wrapper.h" #include "dir.h" #include "gettext.h" #define SECURITY_WIN32
compat/terminal.c +1 -0
@@ -6,6 +6,7 @@#include "run-command.h" #include "string-list.h" #include "hashmap.h" +#include "wrapper.h" #if defined(HAVE_DEV_TTY ) || defined(GIT_WINDOWS_NATIVE )
config.c +1 -0
@@ -28,6 +28,7 @@#include "replace-object.h" #include "refs.h" #include "worktree.h" +#include "wrapper.h" struct config_source {struct config_source *prev;
convert.c +1 -0
@@ -11,6 +11,7 @@#include "sub-process.h" #include "utf8.h" #include "ll-merge.h" +#include "wrapper.h" /* * convert.c - convert a file when checking it out and checking it in.
copy.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "wrapper.h" int copy_fd (int ifd,int ofd) {
csum-file.c +1 -0
@@ -10,6 +10,7 @@#include "cache.h" #include "progress.h" #include "csum-file.h" +#include "wrapper.h" static void verify_buffer_or_die(struct hashfile *f, const void *buf,
daemon.c +1 -0
@@ -6,6 +6,7 @@#include "run-command.h" #include "strbuf.h" #include "string-list.h" +#include "wrapper.h" #ifdef NO_INITGROUPS #define initgroups (x, y) (0)/* nothing */
diff.c +1 -0
@@ -33,6 +33,7 @@#include "promisor-remote.h" #include "dir.h" #include "strmap.h" +#include "wrapper.h" #ifdef NO_FAST_WORKING_DIRECTORY #define FAST_WORKING_DIRECTORY 0
dir.c +1 -0
@@ -21,6 +21,7 @@#include "ewah/ewok.h" #include "fsmonitor.h" #include "submodule-config.h" +#include "wrapper.h" /* * Tells read_directory_recursive how a file or directory should be treated.
entry.c +1 -0
@@ -10,6 +10,7 @@#include "fsmonitor.h" #include "entry.h" #include "parallel-checkout.h" +#include "wrapper.h" static void create_directories (const char *path,int path_len,const struct checkout *state)
environment.c +1 -0
@@ -23,6 +23,7 @@#include "tmp-objdir.h" #include "chdir-notify.h" #include "shallow.h" +#include "wrapper.h" int trust_executable_bit =1 ;int trust_ctime =1 ;
fetch-pack.c +1 -0
@@ -30,6 +30,7 @@#include "commit-graph.h" #include "sigchain.h" #include "mergesort.h" +#include "wrapper.h" static int transfer_unpack_limit =-1 ;static int fetch_unpack_limit =-1 ;
gpg-interface.c +1 -0
@@ -10,6 +10,7 @@#include "sigchain.h" #include "tempfile.h" #include "alias.h" +#include "wrapper.h" static int git_gpg_config (const char *,const char *,void *);
http-backend.c +1 -0
@@ -16,6 +16,7 @@#include "object-store.h" #include "protocol.h" #include "date.h" +#include "wrapper.h" static const char content_type[] ="Content-Type" ;static const char content_length[] ="Content-Length" ;
imap-send.c +1 -0
@@ -28,6 +28,7 @@#include "gettext.h" #include "run-command.h" #include "parse-options.h" +#include "wrapper.h" #if defined(NO_OPENSSL ) && !defined(HAVE_OPENSSL_CSPRNG )typedef void *SSL ;#endif
ll-merge.c +1 -0
@@ -11,6 +11,7 @@#include "run-command.h" #include "ll-merge.h" #include "quote.h" +#include "wrapper.h" struct ll_merge_driver ;
merge-recursive.c +1 -0
@@ -30,6 +30,7 @@#include "tag.h" #include "tree-walk.h" #include "unpack-trees.h" +#include "wrapper.h" #include "xdiff-interface.h" struct merge_options_internal {
notes-merge.c +1 -0
@@ -15,6 +15,7 @@#include "strbuf.h" #include "notes-utils.h" #include "commit-reach.h" +#include "wrapper.h" struct notes_merge_pair {struct object_id obj, base, local, remote;
object-file.c +1 -0
@@ -38,6 +38,7 @@#include "promisor-remote.h" #include "submodule.h" #include "fsck.h" +#include "wrapper.h" /* The maximum size for an object header. */ #define MAX_HEADER_LEN 32
packfile.c +1 -0
@@ -20,6 +20,7 @@#include "midx.h" #include "commit-graph.h" #include "promisor-remote.h" +#include "wrapper.h" char *odb_pack_name(struct strbuf *buf, const unsigned char *hash,
parallel-checkout.c +1 -0
@@ -12,6 +12,7 @@#include "streaming.h" #include "thread-utils.h" #include "trace2.h" +#include "wrapper.h" struct pc_worker {struct child_process cp;
pkt-line.c +1 -0
@@ -3,6 +3,7 @@#include "gettext.h" #include "hex.h" #include "run-command.h" +#include "wrapper.h" char packet_buffer[LARGE_PACKET_MAX ];static const char *packet_trace_prefix ="git" ;
read-cache.c +1 -0
@@ -32,6 +32,7 @@#include "csum-file.h" #include "promisor-remote.h" #include "hook.h" +#include "wrapper.h" /* Mask for the name length in ce_flags in the on-disk index */
rebase-interactive.c +1 -0
@@ -7,6 +7,7 @@#include "commit-slab.h" #include "config.h" #include "dir.h" +#include "wrapper.h" static const char edit_todo_list_advice[] = N_("You can fix this with 'git rebase --edit-todo' "
refs.c +1 -0
@@ -24,6 +24,7 @@#include "sigchain.h" #include "date.h" #include "commit.h" +#include "wrapper.h" /* * List of all available backends
refs/files-backend.c +2 -1
@@ -13,7 +13,8 @@#include "../object.h" #include "../dir.h" #include "../chdir-notify.h" -#include "worktree.h" +#include "../worktree.h" +#include "../wrapper.h" /* * This backend uses the following flags in `ref_update::flags` for
rerere.c +1 -0
@@ -16,6 +16,7 @@#include "object-store.h" #include "hash-lookup.h" #include "strmap.h" +#include "wrapper.h" #define RESOLVED 0#define PUNTED 1
sequencer.c +1 -0
@@ -41,6 +41,7 @@#include "rebase-interactive.h" #include "reset.h" #include "branch.h" +#include "wrapper.h" #define GIT_REFLOG_ACTION "GIT_REFLOG_ACTION"
server-info.c +1 -0
@@ -10,6 +10,7 @@#include "packfile.h" #include "object-store.h" #include "strbuf.h" +#include "wrapper.h" struct update_info_ctx {FILE *cur_fp;
shallow.c +1 -0
@@ -17,6 +17,7 @@#include "list-objects.h" #include "commit-reach.h" #include "shallow.h" +#include "wrapper.h" void set_alternate_shallow_file (struct repository *r,const char *path,int override) {
strbuf.c +1 -0
@@ -8,6 +8,7 @@#include "string-list.h" #include "utf8.h" #include "date.h" +#include "wrapper.h" int starts_with (const char *str,const char *prefix) {
streaming.c +1 -0
@@ -7,6 +7,7 @@#include "object-store.h" #include "replace-object.h" #include "packfile.h" +#include "wrapper.h" typedef int (*open_istream_fn)(struct git_istream *, struct repository *,
t/helper/test-delta.c +1 -0
@@ -12,6 +12,7 @@#include "git-compat-util.h" #include "delta.h" #include "cache.h" +#include "wrapper.h" static const char usage_str[] ="test-tool delta (-d|-p) <from_file> <data_file> <out_file>" ;
t/helper/test-fsmonitor-client.c +1 -0
@@ -9,6 +9,7 @@#include "fsmonitor-ipc.h" #include "thread-utils.h" #include "trace2.h" +#include "wrapper.h" #ifndef HAVE_FSMONITOR_DAEMON_BACKEND int cmd__fsmonitor_client (int argc,const char **argv)
t/helper/test-read-cache.c +1 -0
@@ -2,6 +2,7 @@#include "test-tool.h" #include "cache.h" #include "config.h" +#include "wrapper.h" int cmd__read_cache (int argc,const char **argv) {
tag.c +1 -0
@@ -8,6 +8,7 @@#include "gpg-interface.h" #include "hex.h" #include "packfile.h" +#include "wrapper.h" const char *tag_type ="tag" ;
tempfile.c +1 -0
@@ -45,6 +45,7 @@#include "cache.h" #include "tempfile.h" #include "sigchain.h" +#include "wrapper.h" static VOLATILE_LIST_HEAD (tempfile_list);
trace.c +1 -0
@@ -24,6 +24,7 @@#include "cache.h" #include "abspath.h" #include "quote.h" +#include "wrapper.h" struct trace_key trace_default_key = {"GIT_TRACE" ,0 ,0 ,0 };struct trace_key trace_perf_key =TRACE_KEY_INIT (PERFORMANCE );
transport-helper.c +1 -0
@@ -16,6 +16,7 @@#include "refspec.h" #include "transport-internal.h" #include "protocol.h" +#include "wrapper.h" static int debug;
transport.c +1 -0
@@ -26,6 +26,7 @@#include "object-store.h" #include "color.h" #include "bundle-uri.h" +#include "wrapper.h" static int transport_use_color =-1 ;static char transport_colors[][COLOR_MAXLEN ] = {
usage.c +1 -0
@@ -5,6 +5,7 @@*/ #include "cache.h" #include "gettext.h" +#include "wrapper.h" static void vreportf (const char *prefix,const char *err,va_list params) {
worktree.c +1 -0
@@ -9,6 +9,7 @@#include "dir.h" #include "wt-status.h" #include "config.h" +#include "wrapper.h" void free_worktrees (struct worktree **worktrees) {
wrapper.c +1 -0
@@ -5,6 +5,7 @@#include "abspath.h" #include "config.h" #include "gettext.h" +#include "wrapper.h" static intmax_t count_fsync_writeout_only;static intmax_t count_fsync_hardware_flush;
wrapper.h new file +36 -0
@@ -0,0 +1,36 @@ +#ifndef WRAPPER_H +#define WRAPPER_H + +/* set default permissions by passing mode arguments to open(2) */ +int git_mkstemps_mode (char *pattern,int suffix_len,int mode); +int git_mkstemp_mode (char *pattern,int mode); + +ssize_t read_in_full (int fd,void *buf,size_t count); +ssize_t write_in_full (int fd,const void *buf,size_t count); +ssize_t pread_in_full (int fd,void *buf,size_t count,off_t offset); + +static inline ssize_t write_str_in_full (int fd,const char *str) +{ +return write_in_full (fd, str,strlen (str)); +} + +/** +* Open (and truncate) the file at path, write the contents of buf to it, +* and close it. Dies if any errors are encountered. +*/ +void write_file_buf (const char *path,const char *buf,size_t len); + +/** +* Like write_file_buf(), but format the contents into a buffer first. +* Additionally, write_file() will append a newline if one is not already +* present, making it convenient to write text files: +* +* write_file(path, "counter: %d", ctr); +*/ +__attribute__((format (printf,2 ,3 ))) +void write_file (const char *path,const char *fmt, ...); + +/* Return 1 if the file is empty or does not exists, 0 otherwise. */ +int is_empty_or_missing_file (const char *filename); + +#endif /* WRAPPER_H */
write-or-die.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "config.h" #include "run-command.h" +#include "wrapper.h" /* * Some cases use stdio, but want to flush after the write
Signature · 1 line
gitgitgadget
PATCH 14/16 treewide: remove cache.h inclusion due to setup.h changes
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
By moving several declarations to setup.h, the previous patch made it possible to remove the include of cache.h in several source files. Do so.
--- line-log.c | 1 - path.c | 2 +- t/helper/test-advise.c | 1 - t/helper/test-bloom.c | 3 +-- t/helper/test-config.c | 1 - t/helper/test-pack-mtimes.c | 1 - t/helper/test-partial-clone.c | 3 +-- t/helper/test-proc-receive.c | 3 +-- t/helper/test-read-graph.c | 1 - t/helper/test-ref-store.c | 1 - t/helper/test-repository.c | 1 - t/helper/test-revision-walking.c | 1 - t/helper/test-serve-v2.c | 1 - t/helper/test-submodule-nested-repo-config.c | 1 - t/helper/test-submodule.c | 1 - t/helper/test-subprocess.c | 1 - t/helper/test-userdiff.c | 1 - worktree.c | 2 +- 18 files changed, 5 insertions(+), 21 deletions(-)
line-log.c +0 -1
@@ -1,7 +1,6 @@#include "git-compat-util.h" #include "alloc.h" #include "line-range.h" -#include "cache.h" #include "hex.h" #include "tag.h" #include "blob.h"
path.c +1 -1
@@ -1,7 +1,7 @@/* * Utilities for paths and pathnames */ -#include "cache.h" +#include "git-compat-util.h" #include "abspath.h" #include "environment.h" #include "gettext.h"
t/helper/test-advise.c +0 -1
@@ -1,5 +1,4 @@#include "test-tool.h" -#include "cache.h" #include "advice.h" #include "config.h" #include "setup.h"
t/helper/test-bloom.c +1 -2
@@ -1,7 +1,6 @@ -#include "cache.h" +#include "test-tool.h" #include "bloom.h" #include "hex.h" -#include "test-tool.h" #include "commit.h" #include "setup.h"
t/helper/test-config.c +0 -1
@@ -1,5 +1,4 @@#include "test-tool.h" -#include "cache.h" #include "config.h" #include "setup.h" #include "string-list.h"
t/helper/test-pack-mtimes.c +0 -1
@@ -1,5 +1,4 @@#include "test-tool.h" -#include "cache.h" #include "hex.h" #include "strbuf.h" #include "object-store.h"
t/helper/test-partial-clone.c +1 -2
@@ -1,6 +1,5 @@ -#include "cache.h" -#include "hex.h" #include "test-tool.h" +#include "hex.h" #include "repository.h" #include "object-store.h" #include "setup.h"
t/helper/test-proc-receive.c +1 -2
@@ -1,11 +1,10 @@ -#include "cache.h" +#include "test-tool.h" #include "connect.h" #include "hex.h" #include "parse-options.h" #include "pkt-line.h" #include "setup.h" #include "sigchain.h" -#include "test-tool.h" static const char *proc_receive_usage[] = {"test-tool proc-receive [<options>]" ,
t/helper/test-read-graph.c +0 -1
@@ -1,5 +1,4 @@#include "test-tool.h" -#include "cache.h" #include "commit-graph.h" #include "repository.h" #include "object-store.h"
t/helper/test-ref-store.c +0 -1
@@ -1,5 +1,4 @@#include "test-tool.h" -#include "cache.h" #include "hex.h" #include "refs.h" #include "setup.h"
t/helper/test-repository.c +0 -1
@@ -1,5 +1,4 @@#include "test-tool.h" -#include "cache.h" #include "commit-graph.h" #include "commit.h" #include "config.h"
t/helper/test-revision-walking.c +0 -1
@@ -9,7 +9,6 @@*/ #include "test-tool.h" -#include "cache.h" #include "commit.h" #include "diff.h" #include "revision.h"
t/helper/test-serve-v2.c +0 -1
@@ -1,5 +1,4 @@#include "test-tool.h" -#include "cache.h" #include "gettext.h" #include "parse-options.h" #include "serve.h"
t/helper/test-submodule-nested-repo-config.c +0 -1
@@ -1,5 +1,4 @@#include "test-tool.h" -#include "cache.h" #include "setup.h" #include "submodule-config.h"
t/helper/test-submodule.c +0 -1
@@ -1,6 +1,5 @@#include "test-tool.h" #include "test-tool-utils.h" -#include "cache.h" #include "parse-options.h" #include "remote.h" #include "setup.h"
t/helper/test-subprocess.c +0 -1
@@ -1,5 +1,4 @@#include "test-tool.h" -#include "cache.h" #include "run-command.h" #include "setup.h"
t/helper/test-userdiff.c +0 -1
@@ -1,5 +1,4 @@#include "test-tool.h" -#include "cache.h" #include "setup.h" #include "userdiff.h" #include "config.h"
worktree.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "abspath.h" #include "alloc.h" #include "environment.h"
Signature · 1 line
gitgitgadget
PATCH 15/16 write-or-die.h: move declarations for write-or-die.c functions from cache.h
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
--- archive-tar.c | 1 + archive-zip.c | 1 + builtin/blame.c | 1 + builtin/cat-file.c | 1 + builtin/check-attr.c | 1 + builtin/check-ignore.c | 1 + builtin/check-mailmap.c | 1 + builtin/credential-cache.c | 1 + builtin/credential-store.c | 1 + builtin/grep.c | 1 + builtin/hash-object.c | 1 + builtin/log.c | 1 + builtin/notes.c | 1 + builtin/send-pack.c | 1 + builtin/stripspace.c | 1 + builtin/tag.c | 1 + builtin/update-index.c | 1 + bundle.c | 1 + cache.h | 74 ------------------------------------ config.c | 1 + csum-file.h | 1 + diagnose.c | 1 + environment.c | 1 + http-backend.c | 1 + log-tree.c | 1 + pkt-line.c | 1 + refs/files-backend.c | 1 + refs/packed-backend.c | 1 + remote-curl.c | 1 + send-pack.c | 3 +- sideband.c | 1 + t/helper/test-pkt-line.c | 3 +- upload-pack.c | 1 + write-or-die.c | 3 +- write-or-die.h | 78 ++++++++++++++++++++++++++++++++++++++ 35 files changed, 114 insertions(+), 77 deletions(-) create mode 100644 write-or-die.h
archive-tar.c +1 -0
@@ -11,6 +11,7 @@#include "object-store.h" #include "streaming.h" #include "run-command.h" +#include "write-or-die.h" #define RECORDSIZE (512)#define BLOCKSIZE (RECORDSIZE * 20)
archive-zip.c +1 -0
@@ -10,6 +10,7 @@#include "utf8.h" #include "object-store.h" #include "userdiff.h" +#include "write-or-die.h" #include "xdiff-interface.h" #include "date.h"
builtin/blame.c +1 -0
@@ -33,6 +33,7 @@#include "refs.h" #include "setup.h" #include "tag.h" +#include "write-or-die.h" static char blame_usage[] =N_ ("git blame [<options>] [<rev-opts>] [<rev>] [--] <file>" );static char annotate_usage[] =N_ ("git annotate [<options>] [<rev-opts>] [<rev>] [--] <file>" );
builtin/cat-file.c +1 -0
@@ -23,6 +23,7 @@#include "replace-object.h" #include "promisor-remote.h" #include "mailmap.h" +#include "write-or-die.h" enum batch_mode {BATCH_MODE_CONTENTS ,
builtin/check-attr.c +1 -0
@@ -8,6 +8,7 @@#include "quote.h" #include "setup.h" #include "parse-options.h" +#include "write-or-die.h" static int all_attrs;static int cached_attrs;
builtin/check-ignore.c +1 -0
@@ -8,6 +8,7 @@#include "pathspec.h" #include "parse-options.h" #include "submodule.h" +#include "write-or-die.h" static int quiet, verbose, stdin_paths, show_non_matching, no_index;static const char *const check_ignore_usage[] = {
builtin/check-mailmap.c +1 -0
@@ -5,6 +5,7 @@#include "mailmap.h" #include "parse-options.h" #include "string-list.h" +#include "write-or-die.h" static int use_stdin;static const char *const check_mailmap_usage[] = {
builtin/credential-cache.c +1 -0
@@ -2,6 +2,7 @@#include "gettext.h" #include "parse-options.h" #include "wrapper.h" +#include "write-or-die.h" #ifndef NO_UNIX_SOCKETS
builtin/credential-store.c +1 -0
@@ -5,6 +5,7 @@#include "credential.h" #include "string-list.h" #include "parse-options.h" +#include "write-or-die.h" static struct lock_file credential_lock;
builtin/grep.c +1 -0
@@ -28,6 +28,7 @@#include "submodule-config.h" #include "object-store.h" #include "packfile.h" +#include "write-or-die.h" static const char *grep_prefix;
builtin/hash-object.c +1 -0
@@ -15,6 +15,7 @@#include "parse-options.h" #include "exec-cmd.h" #include "setup.h" +#include "write-or-die.h" /* * This is to create corrupt objects for debugging and as such it
builtin/log.c +1 -0
@@ -40,6 +40,7 @@#include "commit-reach.h" #include "range-diff.h" #include "tmp-objdir.h" +#include "write-or-die.h" #define MAIL_DEFAULT_WRAP 72#define COVER_FROM_AUTO_MAX_SUBJECT_LEN 100
builtin/notes.c +1 -0
@@ -25,6 +25,7 @@#include "notes-merge.h" #include "notes-utils.h" #include "worktree.h" +#include "write-or-die.h" static const char *const git_notes_usage[] = {N_ ("git notes [--ref <notes-ref>] [list [<object>]]" ),
builtin/send-pack.c +1 -0
@@ -16,6 +16,7 @@#include "gpg-interface.h" #include "gettext.h" #include "protocol.h" +#include "write-or-die.h" static const char *const send_pack_usage[] = { N_("git send-pack [--mirror] [--dry-run] [--force]\n"
builtin/stripspace.c +1 -0
@@ -5,6 +5,7 @@#include "parse-options.h" #include "setup.h" #include "strbuf.h" +#include "write-or-die.h" static void comment_lines (struct strbuf *buf) {
builtin/tag.c +1 -0
@@ -24,6 +24,7 @@#include "column.h" #include "ref-filter.h" #include "date.h" +#include "write-or-die.h" static const char *const git_tag_usage[] = { N_("git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>] [-e]\n"
builtin/update-index.c +1 -0
@@ -23,6 +23,7 @@#include "setup.h" #include "split-index.h" #include "fsmonitor.h" +#include "write-or-die.h" /* * Default to not allowing changes to the list of files. The
bundle.c +1 -0
@@ -16,6 +16,7 @@#include "strvec.h" #include "list-objects-filter-options.h" #include "connected.h" +#include "write-or-die.h" static const char v2_bundle_signature[] ="# v2 git bundle\n" ;static const char v3_bundle_signature[] ="# v3 git bundle\n" ;
cache.h +0 -74
92 lines not on this page · raw message
config.c +1 -0
@@ -30,6 +30,7 @@#include "setup.h" #include "worktree.h" #include "wrapper.h" +#include "write-or-die.h" struct config_source {struct config_source *prev;
csum-file.h +1 -0
@@ -3,6 +3,7 @@#include "cache.h" #include "hash.h" +#include "write-or-die.h" struct progress ;
diagnose.c +1 -0
@@ -9,6 +9,7 @@#include "strvec.h" #include "object-store.h" #include "packfile.h" +#include "write-or-die.h" struct archive_dir {const char *path;
environment.c +1 -0
@@ -25,6 +25,7 @@#include "setup.h" #include "shallow.h" #include "wrapper.h" +#include "write-or-die.h" int trust_executable_bit =1 ;int trust_ctime =1 ;
http-backend.c +1 -0
@@ -18,6 +18,7 @@#include "protocol.h" #include "date.h" #include "wrapper.h" +#include "write-or-die.h" static const char content_type[] ="Content-Type" ;static const char content_length[] ="Content-Length" ;
log-tree.c +1 -0
@@ -23,6 +23,7 @@#include "help.h" #include "range-diff.h" #include "strmap.h" +#include "write-or-die.h" static struct decoration name_decoration = {"object names" };static int decoration_loaded;
pkt-line.c +1 -0
@@ -4,6 +4,7 @@#include "hex.h" #include "run-command.h" #include "wrapper.h" +#include "write-or-die.h" char packet_buffer[LARGE_PACKET_MAX ];static const char *packet_trace_prefix ="git" ;
refs/files-backend.c +1 -0
@@ -17,6 +17,7 @@#include "../setup.h" #include "../worktree.h" #include "../wrapper.h" +#include "../write-or-die.h" /* * This backend uses the following flags in `ref_update::flags` for
refs/packed-backend.c +1 -0
@@ -9,6 +9,7 @@#include "../iterator.h" #include "../lockfile.h" #include "../chdir-notify.h" +#include "../write-or-die.h" enum mmap_strategy {/*
remote-curl.c +1 -0
@@ -22,6 +22,7 @@#include "protocol.h" #include "quote.h" #include "transport.h" +#include "write-or-die.h" static struct remote *remote;/* always ends with a trailing slash */
send-pack.c +2 -1
@@ -16,8 +16,9 @@#include "version.h" #include "oid-array.h" #include "gpg-interface.h" -#include "cache.h" #include "shallow.h" +#include "trace2.h" +#include "write-or-die.h" int option_parse_push_signed (const struct option *opt,const char *arg,int unset)
sideband.c +1 -0
@@ -5,6 +5,7 @@#include "sideband.h" #include "help.h" #include "pkt-line.h" +#include "write-or-die.h" struct keyword_entry {/*
t/helper/test-pkt-line.c +2 -1
@@ -1,6 +1,7 @@ -#include "cache.h" +#include "git-compat-util.h" #include "test-tool.h" #include "pkt-line.h" +#include "write-or-die.h" static void pack_line (const char *line) {
upload-pack.c +1 -0
@@ -30,6 +30,7 @@#include "commit-graph.h" #include "commit-reach.h" #include "shallow.h" +#include "write-or-die.h" /* Remember to update object flag allocation in object.h */ #define THEY_HAVE (1u << 11)
write-or-die.c +2 -1
@@ -1,7 +1,8 @@ -#include "cache.h" +#include "git-compat-util.h" #include "config.h" #include "run-command.h" #include "wrapper.h" +#include "write-or-die.h" /* * Some cases use stdio, but want to flush after the write
write-or-die.h new file +78 -0
78 lines not on this page · raw message
Signature · 1 line
gitgitgadget
PATCH 16/16 csum-file.h: remove unnecessary inclusion of cache.h
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
With the change in the last commit to move several functions to write-or-die.h, csum-file.h no longer needs to include cache.h. However, removing that include forces several other C files, which directly or indirectly dependend upon csum-file.h's inclusion of cache.h, to now be more explicit about their dependencies.
--- bulk-checkin.c | 2 +- chunk-format.c | 1 + commit-graph.c | 2 +- csum-file.h | 1 - delta-islands.c | 2 +- fetch-pack.c | 2 +- midx.c | 2 +- object-file.c | 2 +- pack-bitmap-write.c | 3 ++- pack-bitmap.c | 2 +- pack.h | 2 ++ packfile.c | 2 +- 12 files changed, 13 insertions(+), 10 deletions(-)
bulk-checkin.c +1 -1
@@ -1,7 +1,7 @@/* * Copyright (c) 2011, Google Inc. */ -#include "git-compat-util.h" +#include "cache.h" #include "alloc.h" #include "bulk-checkin.h" #include "environment.h"
chunk-format.c +1 -0
@@ -3,6 +3,7 @@#include "chunk-format.h" #include "csum-file.h" #include "gettext.h" +#include "trace2.h" /* * When writing a chunk-based file format, collect the chunks in
commit-graph.c +1 -1
@@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "config.h" #include "gettext.h" #include "hex.h"
csum-file.h +0 -1
@@ -1,7 +1,6 @@#ifndef CSUM_FILE_H #define CSUM_FILE_H -#include "cache.h" #include "hash.h" #include "write-or-die.h"
delta-islands.c +1 -1
@@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "alloc.h" #include "attr.h" #include "object.h"
fetch-pack.c +1 -1
@@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "alloc.h" #include "repository.h" #include "config.h"
midx.c +1 -1
@@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "abspath.h" #include "alloc.h" #include "config.h"
object-file.c +1 -1
@@ -6,7 +6,7 @@* This handles basic git object files - packing, unpacking, * creation etc. */ -#include "git-compat-util.h" +#include "cache.h" #include "abspath.h" #include "alloc.h" #include "config.h"
pack-bitmap-write.c +2 -1
@@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "alloc.h" #include "environment.h" #include "gettext.h"
@@ -17,6 +17,7 @@#include "pack-objects.h" #include "commit-reach.h" #include "prio-queue.h" +#include "trace2.h" struct bitmapped_commit {struct commit *commit;
pack-bitmap.c +1 -1
@@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "alloc.h" #include "commit.h" #include "gettext.h"
pack.h +2 -0
@@ -4,6 +4,8 @@#include "object.h" #include "csum-file.h" +struct packed_git ; +struct pack_window ;struct repository ;/*
packfile.c +1 -1
@@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "alloc.h" #include "environment.h" #include "gettext.h"
Signature · 1 line
gitgitgadget
PATCH 11/16 environment.h: move declarations for environment.c functions from cache.h
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
--- apply.c | 1 + archive.c | 1 + attr.c | 1 + bisect.c | 1 + branch.c | 1 + builtin/am.c | 1 + builtin/bisect.c | 1 + builtin/blame.c | 1 + builtin/cat-file.c | 1 + builtin/check-attr.c | 1 + builtin/checkout.c | 1 + builtin/clone.c | 1 + builtin/commit-graph.c | 1 + builtin/config.c | 1 + builtin/count-objects.c | 1 + builtin/describe.c | 1 + builtin/difftool.c | 1 + builtin/fast-import.c | 1 + builtin/fetch.c | 1 + builtin/fsmonitor--daemon.c | 1 + builtin/gc.c | 1 + builtin/index-pack.c | 1 + builtin/init-db.c | 1 + builtin/log.c | 1 + builtin/mailinfo.c | 1 + builtin/multi-pack-index.c | 1 + builtin/mv.c | 1 + builtin/name-rev.c | 1 + builtin/pack-objects.c | 1 + builtin/prune.c | 1 + builtin/push.c | 1 + builtin/rebase.c | 1 + builtin/receive-pack.c | 1 + builtin/repack.c | 1 + builtin/replace.c | 1 + builtin/reset.c | 1 + builtin/rev-list.c | 1 + builtin/rev-parse.c | 1 + builtin/shortlog.c | 1 + builtin/show-branch.c | 1 + builtin/sparse-checkout.c | 1 + builtin/stash.c | 1 + builtin/submodule--helper.c | 1 + builtin/unpack-objects.c | 1 + builtin/update-index.c | 1 + builtin/worktree.c | 1 + builtin/write-tree.c | 1 + bulk-checkin.c | 1 + bundle-uri.c | 1 + bundle.c | 1 + cache-tree.c | 1 + cache.h | 207 --------------------------- combine-diff.c | 1 + compat/mingw.c | 1 + compat/precompose_utf8.c | 1 + connect.c | 1 + daemon.c | 1 + diff.c | 1 + dir.c | 1 + editor.c | 1 + entry.c | 1 + environment.h | 213 ++++++++++++++++++++++++++++ exec-cmd.c | 1 + fetch-pack.c | 1 + fsmonitor.c | 1 + gettext.c | 1 + git.c | 1 + http-backend.c | 1 + http-push.c | 1 + log-tree.c | 1 + ls-refs.c | 1 + mailmap.c | 1 + merge-ort.c | 1 + merge-recursive.c | 1 + name-hash.c | 1 + notes-utils.c | 1 + notes.c | 1 + object-file.c | 1 + object-name.c | 1 + pack-bitmap-write.c | 1 + pack-check.c | 1 + pack-write.c | 1 + packfile.c | 1 + parse-options-cb.c | 1 + path.c | 1 + pathspec.c | 1 + preload-index.c | 1 + pretty.c | 1 + prompt.c | 1 + protocol.c | 1 + prune-packed.c | 1 + range-diff.c | 1 + read-cache.c | 1 + rebase-interactive.c | 1 + ref-filter.c | 1 + refs.c | 1 + refs/files-backend.c | 1 + remote-curl.c | 1 + remote.c | 1 + revision.c | 1 + run-command.c | 1 + server-info.c | 1 + setup.c | 1 + sparse-index.c | 1 + streaming.c | 1 + submodule-config.c | 1 + submodule.c | 1 + t/helper/test-fast-rebase.c | 1 + t/helper/test-lazy-init-name-hash.c | 1 + t/helper/test-path-utils.c | 1 + t/helper/test-repository.c | 1 + tag.c | 1 + tmp-objdir.c | 1 + trace.c | 1 + transport-helper.c | 1 + transport.c | 1 + unpack-trees.c | 1 + upload-pack.c | 1 + worktree.c | 1 + 119 files changed, 330 insertions(+), 207 deletions(-)
apply.c +1 -0
@@ -16,6 +16,7 @@#include "delta.h" #include "diff.h" #include "dir.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "xdiff-interface.h"
archive.c +1 -0
@@ -2,6 +2,7 @@#include "abspath.h" #include "alloc.h" #include "config.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "refs.h"
attr.c +1 -0
@@ -9,6 +9,7 @@#include "cache.h" #include "alloc.h" #include "config.h" +#include "environment.h" #include "exec-cmd.h" #include "attr.h" #include "dir.h"
bisect.c +1 -0
@@ -2,6 +2,7 @@#include "config.h" #include "commit.h" #include "diff.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "revision.h"
branch.c +1 -0
@@ -2,6 +2,7 @@#include "cache.h" #include "config.h" #include "branch.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "refs.h"
builtin/am.c +1 -0
@@ -8,6 +8,7 @@#include "abspath.h" #include "config.h" #include "builtin.h" +#include "environment.h" #include "exec-cmd.h" #include "gettext.h" #include "hex.h"
builtin/bisect.c +1 -0
@@ -1,5 +1,6 @@#include "builtin.h" #include "cache.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "parse-options.h"
builtin/blame.c +1 -0
@@ -10,6 +10,7 @@#include "config.h" #include "color.h" #include "builtin.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "repository.h"
builtin/cat-file.c +1 -0
@@ -9,6 +9,7 @@#include "config.h" #include "builtin.h" #include "diff.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "ident.h"
builtin/check-attr.c +1 -0
@@ -3,6 +3,7 @@#include "cache.h" #include "config.h" #include "attr.h" +#include "environment.h" #include "gettext.h" #include "quote.h" #include "parse-options.h"
builtin/checkout.c +1 -0
@@ -9,6 +9,7 @@#include "config.h" #include "diff.h" #include "dir.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "hook.h"
builtin/clone.c +1 -0
@@ -12,6 +12,7 @@#include "builtin.h" #include "abspath.h" #include "config.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "lockfile.h"
builtin/commit-graph.c +1 -0
@@ -1,6 +1,7 @@#include "builtin.h" #include "config.h" #include "dir.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "lockfile.h"
builtin/config.c +1 -0
@@ -3,6 +3,7 @@#include "alloc.h" #include "config.h" #include "color.h" +#include "environment.h" #include "gettext.h" #include "ident.h" #include "parse-options.h"
builtin/count-objects.c +1 -0
@@ -7,6 +7,7 @@#include "cache.h" #include "config.h" #include "dir.h" +#include "environment.h" #include "gettext.h" #include "repository.h" #include "builtin.h"
builtin/describe.c +1 -0
@@ -1,6 +1,7 @@#define USE_THE_INDEX_VARIABLE #include "cache.h" #include "config.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "lockfile.h"
builtin/difftool.c +1 -0
@@ -17,6 +17,7 @@#include "config.h" #include "builtin.h" #include "run-command.h" +#include "environment.h" #include "exec-cmd.h" #include "gettext.h" #include "hex.h"
builtin/fast-import.c +1 -0
@@ -1,6 +1,7 @@#include "builtin.h" #include "abspath.h" #include "cache.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "repository.h"
builtin/fetch.c +1 -0
@@ -4,6 +4,7 @@#include "cache.h" #include "config.h" #include "gettext.h" +#include "environment.h" #include "hex.h" #include "repository.h" #include "refs.h"
builtin/fsmonitor--daemon.c +1 -0
@@ -2,6 +2,7 @@#include "abspath.h" #include "alloc.h" #include "config.h" +#include "environment.h" #include "gettext.h" #include "parse-options.h" #include "fsmonitor.h"
builtin/gc.c +1 -0
@@ -12,6 +12,7 @@#include "builtin.h" #include "abspath.h" +#include "environment.h" #include "hex.h" #include "repository.h" #include "config.h"
builtin/index-pack.c +1 -0
@@ -2,6 +2,7 @@#include "alloc.h" #include "config.h" #include "delta.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "pack.h"
builtin/init-db.c +1 -0
@@ -6,6 +6,7 @@#include "cache.h" #include "abspath.h" #include "config.h" +#include "environment.h" #include "gettext.h" #include "refs.h" #include "builtin.h"
builtin/log.c +1 -0
@@ -8,6 +8,7 @@#include "abspath.h" #include "alloc.h" #include "config.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "refs.h"
builtin/mailinfo.c +1 -0
@@ -5,6 +5,7 @@#include "cache.h" #include "abspath.h" #include "builtin.h" +#include "environment.h" #include "gettext.h" #include "utf8.h" #include "strbuf.h"
builtin/multi-pack-index.c +1 -0
@@ -2,6 +2,7 @@#include "abspath.h" #include "cache.h" #include "config.h" +#include "environment.h" #include "gettext.h" #include "parse-options.h" #include "midx.h"
builtin/mv.c +1 -0
@@ -8,6 +8,7 @@#include "abspath.h" #include "alloc.h" #include "config.h" +#include "environment.h" #include "gettext.h" #include "pathspec.h" #include "lockfile.h"
builtin/name-rev.c +1 -0
@@ -1,5 +1,6 @@#include "builtin.h" #include "alloc.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "repository.h"
builtin/pack-objects.c +1 -0
@@ -1,5 +1,6 @@#include "builtin.h" #include "alloc.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "repository.h"
builtin/prune.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "commit.h" #include "diff.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "revision.h"
builtin/push.c +1 -0
@@ -4,6 +4,7 @@#include "cache.h" #include "branch.h" #include "config.h" +#include "environment.h" #include "gettext.h" #include "refs.h" #include "refspec.h"
builtin/rebase.c +1 -0
@@ -7,6 +7,7 @@#define USE_THE_INDEX_VARIABLE #include "builtin.h" #include "abspath.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "run-command.h"
builtin/receive-pack.c +1 -0
@@ -2,6 +2,7 @@#include "abspath.h" #include "repository.h" #include "config.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "lockfile.h"
builtin/repack.c +1 -0
@@ -2,6 +2,7 @@#include "alloc.h" #include "config.h" #include "dir.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "parse-options.h"
builtin/replace.c +1 -0
@@ -11,6 +11,7 @@#include "cache.h" #include "config.h" #include "builtin.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "refs.h"
builtin/reset.c +1 -0
@@ -10,6 +10,7 @@#define USE_THE_INDEX_VARIABLE #include "builtin.h" #include "config.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "lockfile.h"
builtin/rev-list.c +1 -0
@@ -2,6 +2,7 @@#include "config.h" #include "commit.h" #include "diff.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "revision.h"
builtin/rev-parse.c +1 -0
@@ -9,6 +9,7 @@#include "alloc.h" #include "config.h" #include "commit.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "refs.h"
builtin/shortlog.c +1 -0
@@ -3,6 +3,7 @@#include "config.h" #include "commit.h" #include "diff.h" +#include "environment.h" #include "gettext.h" #include "string-list.h" #include "revision.h"
builtin/show-branch.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "config.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "pretty.h"
builtin/sparse-checkout.c +1 -0
@@ -2,6 +2,7 @@#include "cache.h" #include "config.h" #include "dir.h" +#include "environment.h" #include "gettext.h" #include "parse-options.h" #include "pathspec.h"
builtin/stash.c +1 -0
@@ -2,6 +2,7 @@#include "builtin.h" #include "abspath.h" #include "config.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "parse-options.h"
builtin/submodule--helper.c +1 -0
@@ -2,6 +2,7 @@#include "builtin.h" #include "abspath.h" #include "alloc.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "repository.h"
builtin/unpack-objects.c +1 -0
@@ -2,6 +2,7 @@#include "cache.h" #include "bulk-checkin.h" #include "config.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "object-store.h"
builtin/update-index.c +1 -0
@@ -7,6 +7,7 @@#include "cache.h" #include "bulk-checkin.h" #include "config.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "lockfile.h"
builtin/worktree.c +1 -0
@@ -4,6 +4,7 @@#include "config.h" #include "builtin.h" #include "dir.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "parse-options.h"
builtin/write-tree.c +1 -0
@@ -7,6 +7,7 @@#include "builtin.h" #include "cache.h" #include "config.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "tree.h"
bulk-checkin.c +1 -0
@@ -4,6 +4,7 @@#include "git-compat-util.h" #include "alloc.h" #include "bulk-checkin.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "lockfile.h"
bundle-uri.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "bundle-uri.h" #include "bundle.h" +#include "environment.h" #include "gettext.h" #include "object-store.h" #include "refs.h"
bundle.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "lockfile.h" #include "bundle.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "object-store.h"
cache-tree.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "alloc.h" +#include "environment.h" #include "hex.h" #include "lockfile.h" #include "tree.h"
cache.h +0 -207
264 lines not on this page · raw message
combine-diff.c +1 -0
@@ -4,6 +4,7 @@#include "blob.h" #include "diff.h" #include "diffcore.h" +#include "environment.h" #include "hex.h" #include "quote.h" #include "xdiff-interface.h"
compat/mingw.c +1 -0
@@ -11,6 +11,7 @@#include "../alloc.h" #include "win32/lazyload.h" #include "../config.h" +#include "../environment.h" #include "../wrapper.h" #include "dir.h" #include "gettext.h"
compat/precompose_utf8.c +1 -0
@@ -7,6 +7,7 @@#include "cache.h" #include "config.h" +#include "environment.h" #include "gettext.h" #include "utf8.h" #include "precompose_utf8.h"
connect.c +1 -0
@@ -1,6 +1,7 @@#include "git-compat-util.h" #include "cache.h" #include "config.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "pkt-line.h"
daemon.c +1 -0
@@ -2,6 +2,7 @@#include "abspath.h" #include "alloc.h" #include "config.h" +#include "environment.h" #include "pkt-line.h" #include "run-command.h" #include "strbuf.h"
diff.c +1 -0
@@ -5,6 +5,7 @@#include "abspath.h" #include "alloc.h" #include "config.h" +#include "environment.h" #include "gettext.h" #include "tempfile.h" #include "quote.h"
dir.c +1 -0
@@ -10,6 +10,7 @@#include "alloc.h" #include "config.h" #include "dir.h" +#include "environment.h" #include "gettext.h" #include "object-store.h" #include "attr.h"
editor.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "abspath.h" #include "config.h" +#include "environment.h" #include "gettext.h" #include "strbuf.h" #include "strvec.h"
entry.c +1 -0
@@ -2,6 +2,7 @@#include "blob.h" #include "object-store.h" #include "dir.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "streaming.h"
environment.h +213 -0
223 lines not on this page · raw message
exec-cmd.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "abspath.h" +#include "environment.h" #include "exec-cmd.h" #include "gettext.h" #include "quote.h"
fetch-pack.c +1 -0
@@ -2,6 +2,7 @@#include "alloc.h" #include "repository.h" #include "config.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "lockfile.h"
fsmonitor.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "config.h" #include "dir.h" +#include "environment.h" #include "ewah/ewok.h" #include "fsmonitor.h" #include "fsmonitor-ipc.h"
gettext.c +1 -0
@@ -4,6 +4,7 @@#include "cache.h" #include "abspath.h" +#include "environment.h" #include "exec-cmd.h" #include "gettext.h" #include "strbuf.h"
git.c +1 -0
@@ -1,5 +1,6 @@#include "builtin.h" #include "config.h" +#include "environment.h" #include "exec-cmd.h" #include "gettext.h" #include "help.h"
http-backend.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "alloc.h" #include "config.h" +#include "environment.h" #include "hex.h" #include "repository.h" #include "refs.h"
http-push.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "environment.h" #include "hex.h" #include "repository.h" #include "commit.h"
log-tree.c +1 -0
@@ -2,6 +2,7 @@#include "commit-reach.h" #include "config.h" #include "diff.h" +#include "environment.h" #include "hex.h" #include "object-store.h" #include "repository.h"
ls-refs.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "repository.h"
mailmap.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "environment.h" #include "string-list.h" #include "mailmap.h" #include "object-store.h"
merge-ort.c +1 -0
@@ -26,6 +26,7 @@#include "diff.h" #include "diffcore.h" #include "dir.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "entry.h"
merge-recursive.c +1 -0
@@ -17,6 +17,7 @@#include "diff.h" #include "diffcore.h" #include "dir.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "ll-merge.h"
name-hash.c +1 -0
@@ -6,6 +6,7 @@* Copyright (C) 2008 Linus Torvalds */ #include "cache.h" +#include "environment.h" #include "gettext.h" #include "thread-utils.h" #include "trace2.h"
notes-utils.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "config.h" #include "commit.h" +#include "environment.h" #include "gettext.h" #include "refs.h" #include "notes-utils.h"
notes.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "config.h" +#include "environment.h" #include "hex.h" #include "notes.h" #include "object-store.h"
object-file.c +1 -0
@@ -10,6 +10,7 @@#include "abspath.h" #include "alloc.h" #include "config.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "string-list.h"
object-name.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "config.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "tag.h"
pack-bitmap-write.c +1 -0
@@ -1,5 +1,6 @@#include "git-compat-util.h" #include "alloc.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "object-store.h"
pack-check.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "environment.h" #include "hex.h" #include "repository.h" #include "pack.h"
pack-write.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "pack.h"
packfile.c +1 -0
@@ -1,5 +1,6 @@#include "git-compat-util.h" #include "alloc.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "list.h"
parse-options-cb.c +1 -0
@@ -4,6 +4,7 @@#include "cache.h" #include "commit.h" #include "color.h" +#include "environment.h" #include "gettext.h" #include "string-list.h" #include "strvec.h"
path.c +1 -0
@@ -3,6 +3,7 @@*/ #include "cache.h" #include "abspath.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "repository.h"
pathspec.c +1 -0
@@ -2,6 +2,7 @@#include "abspath.h" #include "config.h" #include "dir.h" +#include "environment.h" #include "gettext.h" #include "pathspec.h" #include "attr.h"
preload-index.c +1 -0
@@ -4,6 +4,7 @@#include "cache.h" #include "pathspec.h" #include "dir.h" +#include "environment.h" #include "fsmonitor.h" #include "gettext.h" #include "config.h"
pretty.c +1 -0
@@ -2,6 +2,7 @@#include "alloc.h" #include "config.h" #include "commit.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "utf8.h"
prompt.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "config.h" +#include "environment.h" #include "run-command.h" #include "strbuf.h" #include "prompt.h"
protocol.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "config.h" +#include "environment.h" #include "protocol.h" static enum protocol_version parse_protocol_version (const char *value)
prune-packed.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "environment.h" #include "gettext.h" #include "object-store.h" #include "packfile.h"
range-diff.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "environment.h" #include "gettext.h" #include "range-diff.h" #include "string-list.h"
read-cache.c +1 -0
@@ -18,6 +18,7 @@#include "tree.h" #include "commit.h" #include "blob.h" +#include "environment.h" #include "gettext.h" #include "resolve-undo.h" #include "run-command.h"
rebase-interactive.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "commit.h" +#include "environment.h" #include "gettext.h" #include "sequencer.h" #include "rebase-interactive.h"
ref-filter.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "alloc.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "parse-options.h"
refs.c +1 -0
@@ -5,6 +5,7 @@#include "cache.h" #include "alloc.h" #include "config.h" +#include "environment.h" #include "hashmap.h" #include "gettext.h" #include "hex.h"
refs/files-backend.c +1 -0
@@ -1,5 +1,6 @@#include "../cache.h" #include "../config.h" +#include "../environment.h" #include "../gettext.h" #include "../hex.h" #include "../refs.h"
remote-curl.c +1 -0
@@ -1,6 +1,7 @@#include "git-compat-util.h" #include "alloc.h" #include "config.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "remote.h"
remote.c +1 -0
@@ -2,6 +2,7 @@#include "abspath.h" #include "alloc.h" #include "config.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "remote.h"
revision.c +1 -0
@@ -1,6 +1,7 @@#include "git-compat-util.h" #include "alloc.h" #include "config.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "object-store.h"
run-command.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "run-command.h" +#include "environment.h" #include "exec-cmd.h" #include "gettext.h" #include "sigchain.h"
server-info.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "alloc.h" #include "dir.h" +#include "environment.h" #include "hex.h" #include "repository.h" #include "refs.h"
setup.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "abspath.h" +#include "environment.h" #include "gettext.h" #include "repository.h" #include "config.h"
sparse-index.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "alloc.h" +#include "environment.h" #include "gettext.h" #include "repository.h" #include "sparse-index.h"
streaming.c +1 -0
@@ -2,6 +2,7 @@* Copyright (c) 2011, Google Inc. */ #include "cache.h" +#include "environment.h" #include "streaming.h" #include "repository.h" #include "object-store.h"
submodule-config.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "alloc.h" #include "dir.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "repository.h"
submodule.c +1 -0
@@ -8,6 +8,7 @@#include "dir.h" #include "diff.h" #include "commit.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "revision.h"
t/helper/test-fast-rebase.c +1 -0
@@ -15,6 +15,7 @@#include "cache.h" #include "cache-tree.h" #include "commit.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "lockfile.h"
t/helper/test-lazy-init-name-hash.c +1 -0
@@ -1,6 +1,7 @@#define USE_THE_INDEX_VARIABLE #include "test-tool.h" #include "cache.h" +#include "environment.h" #include "parse-options.h" static int single;
t/helper/test-path-utils.c +1 -0
@@ -1,6 +1,7 @@#include "test-tool.h" #include "cache.h" #include "abspath.h" +#include "environment.h" #include "string-list.h" #include "utf8.h"
t/helper/test-repository.c +1 -0
@@ -3,6 +3,7 @@#include "commit-graph.h" #include "commit.h" #include "config.h" +#include "environment.h" #include "hex.h" #include "object-store.h" #include "object.h"
tag.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "environment.h" #include "tag.h" #include "object-store.h" #include "commit.h"
tmp-objdir.c +1 -0
@@ -3,6 +3,7 @@#include "abspath.h" #include "chdir-notify.h" #include "dir.h" +#include "environment.h" #include "sigchain.h" #include "string-list.h" #include "strbuf.h"
trace.c +1 -0
@@ -23,6 +23,7 @@#include "cache.h" #include "abspath.h" +#include "environment.h" #include "quote.h" #include "wrapper.h"
transport-helper.c +1 -0
@@ -4,6 +4,7 @@#include "run-command.h" #include "commit.h" #include "diff.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "revision.h"
transport.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "alloc.h" #include "config.h" +#include "environment.h" #include "hex.h" #include "transport.h" #include "hook.h"
unpack-trees.c +1 -0
@@ -3,6 +3,7 @@#include "repository.h" #include "config.h" #include "dir.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "tree.h"
upload-pack.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "config.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "refs.h"
worktree.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "abspath.h" #include "alloc.h" +#include "environment.h" #include "gettext.h" #include "repository.h" #include "refs.h"
Signature · 1 line
gitgitgadget
PATCH 13/16 setup.h: move declarations for setup.c functions from cache.h
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
--- apply.c | 1 + archive.c | 1 + attr.c | 1 + blame.c | 1 + builtin/blame.c | 1 + builtin/bugreport.c | 1 + builtin/bundle.c | 1 + builtin/check-attr.c | 1 + builtin/check-ref-format.c | 1 + builtin/checkout-index.c | 1 + builtin/checkout.c | 1 + builtin/clean.c | 1 + builtin/clone.c | 1 + builtin/config.c | 1 + builtin/describe.c | 1 + builtin/diff-index.c | 1 + builtin/diff.c | 1 + builtin/difftool.c | 1 + builtin/gc.c | 1 + builtin/grep.c | 1 + builtin/hash-object.c | 1 + builtin/help.c | 1 + builtin/index-pack.c | 1 + builtin/init-db.c | 1 + builtin/ls-files.c | 1 + builtin/merge-file.c | 1 + builtin/mv.c | 1 + builtin/read-tree.c | 1 + builtin/reset.c | 1 + builtin/rev-parse.c | 1 + builtin/rm.c | 1 + builtin/shortlog.c | 1 + builtin/sparse-checkout.c | 1 + builtin/stash.c | 1 + builtin/stripspace.c | 1 + builtin/submodule--helper.c | 1 + builtin/update-index.c | 1 + cache.h | 163 ------------------ commit.c | 1 + common-main.c | 1 + config.c | 1 + daemon.c | 1 + diff.c | 1 + dir.c | 1 + environment.c | 1 + git.c | 1 + http-fetch.c | 1 + http-push.c | 1 + imap-send.c | 1 + line-log.c | 1 + mailmap.c | 1 + object-file.c | 1 + object-name.c | 1 + path.c | 1 + pathspec.c | 1 + refs.c | 1 + refs/files-backend.c | 1 + remote-curl.c | 1 + remote.c | 1 + repository.c | 1 + revision.c | 1 + scalar.c | 1 + setup.c | 1 + setup.h | 168 +++++++++++++++++++ submodule.c | 1 + symlinks.c | 1 + t/helper/test-advise.c | 1 + t/helper/test-bitmap.c | 1 + t/helper/test-bloom.c | 1 + t/helper/test-cache-tree.c | 1 + t/helper/test-config.c | 1 + t/helper/test-dump-cache-tree.c | 2 +- t/helper/test-dump-fsmonitor.c | 1 + t/helper/test-dump-split-index.c | 1 + t/helper/test-dump-untracked-cache.c | 1 + t/helper/test-fast-rebase.c | 1 + t/helper/test-fsmonitor-client.c | 1 + t/helper/test-lazy-init-name-hash.c | 1 + t/helper/test-match-trees.c | 1 + t/helper/test-oid-array.c | 1 + t/helper/test-oidmap.c | 1 + t/helper/test-oidtree.c | 1 + t/helper/test-pack-mtimes.c | 1 + t/helper/test-partial-clone.c | 1 + t/helper/test-path-utils.c | 1 + t/helper/test-proc-receive.c | 1 + t/helper/test-reach.c | 1 + t/helper/test-read-cache.c | 1 + t/helper/test-read-graph.c | 1 + t/helper/test-read-midx.c | 1 + t/helper/test-ref-store.c | 1 + t/helper/test-repository.c | 1 + t/helper/test-revision-walking.c | 1 + t/helper/test-scrap-cache-tree.c | 1 + t/helper/test-serve-v2.c | 1 + t/helper/test-submodule-config.c | 1 + t/helper/test-submodule-nested-repo-config.c | 1 + t/helper/test-submodule.c | 1 + t/helper/test-subprocess.c | 1 + t/helper/test-userdiff.c | 1 + t/helper/test-write-cache.c | 1 + trace.c | 1 + unpack-trees.c | 1 + worktree.c | 1 + wt-status.c | 1 + 105 files changed, 271 insertions(+), 164 deletions(-) create mode 100644 setup.h
apply.c +1 -0
@@ -27,6 +27,7 @@#include "rerere.h" #include "apply.h" #include "entry.h" +#include "setup.h" #include "wrapper.h" struct gitdiff_data {
archive.c +1 -0
@@ -5,6 +5,7 @@#include "environment.h" #include "gettext.h" #include "hex.h" +#include "setup.h" #include "refs.h" #include "object-store.h" #include "commit.h"
attr.c +1 -0
@@ -18,6 +18,7 @@#include "quote.h" #include "revision.h" #include "object-store.h" +#include "setup.h" #include "thread-utils.h" const char git_attr__true[] ="(builtin)true" ;
blame.c +1 -0
@@ -7,6 +7,7 @@#include "diffcore.h" #include "gettext.h" #include "hex.h" +#include "setup.h" #include "tag.h" #include "blame.h" #include "alloc.h"
builtin/blame.c +1 -0
@@ -31,6 +31,7 @@#include "object-store.h" #include "blame.h" #include "refs.h" +#include "setup.h" #include "tag.h" static char blame_usage[] =N_ ("git blame [<options>] [<rev-opts>] [<rev>] [--] <file>" );
builtin/bugreport.c +1 -0
@@ -8,6 +8,7 @@#include "hook.h" #include "hook-list.h" #include "diagnose.h" +#include "setup.h" #include "wrapper.h" static void get_system_info (struct strbuf *sys_info)
builtin/bundle.c +1 -0
@@ -1,6 +1,7 @@#include "builtin.h" #include "abspath.h" #include "gettext.h" +#include "setup.h" #include "strvec.h" #include "parse-options.h" #include "cache.h"
builtin/check-attr.c +1 -0
@@ -6,6 +6,7 @@#include "environment.h" #include "gettext.h" #include "quote.h" +#include "setup.h" #include "parse-options.h" static int all_attrs;
builtin/check-ref-format.c +1 -0
@@ -5,6 +5,7 @@#include "cache.h" #include "refs.h" #include "builtin.h" +#include "setup.h" #include "strbuf.h" static const char builtin_check_ref_format_usage[] =
builtin/checkout-index.c +1 -0
@@ -15,6 +15,7 @@#include "parse-options.h" #include "entry.h" #include "parallel-checkout.h" +#include "setup.h" #define CHECKOUT_ALL 4static int nul_term_line;
builtin/checkout.c +1 -0
@@ -23,6 +23,7 @@#include "resolve-undo.h" #include "revision.h" #include "run-command.h" +#include "setup.h" #include "submodule.h" #include "submodule-config.h" #include "tree.h"
builtin/clean.c +1 -0
@@ -14,6 +14,7 @@#include "dir.h" #include "gettext.h" #include "parse-options.h" +#include "setup.h" #include "string-list.h" #include "quote.h" #include "column.h"
builtin/clone.c +1 -0
@@ -33,6 +33,7 @@#include "branch.h" #include "remote.h" #include "run-command.h" +#include "setup.h" #include "connected.h" #include "packfile.h" #include "list-objects-filter-options.h"
builtin/config.c +1 -0
@@ -9,6 +9,7 @@#include "parse-options.h" #include "urlmatch.h" #include "quote.h" +#include "setup.h" #include "worktree.h" #include "wrapper.h"
builtin/describe.c +1 -0
@@ -15,6 +15,7 @@#include "revision.h" #include "diff.h" #include "hashmap.h" +#include "setup.h" #include "strvec.h" #include "run-command.h" #include "object-store.h"
builtin/diff-index.c +1 -0
@@ -5,6 +5,7 @@#include "commit.h" #include "revision.h" #include "builtin.h" +#include "setup.h" #include "submodule.h" static const char diff_cache_usage[] =
builtin/diff.c +1 -0
@@ -19,6 +19,7 @@#include "revision.h" #include "log-tree.h" #include "builtin.h" +#include "setup.h" #include "submodule.h" #include "oid-array.h"
builtin/difftool.c +1 -0
@@ -28,6 +28,7 @@#include "object-store.h" #include "dir.h" #include "entry.h" +#include "setup.h" #include "wrapper.h" static int trust_exit_code;
builtin/gc.c +1 -0
@@ -36,6 +36,7 @@#include "exec-cmd.h" #include "gettext.h" #include "hook.h" +#include "setup.h" #include "wrapper.h" #define FAILED_RUN "failed to run %s"
builtin/grep.c +1 -0
@@ -23,6 +23,7 @@#include "quote.h" #include "dir.h" #include "pathspec.h" +#include "setup.h" #include "submodule.h" #include "submodule-config.h" #include "object-store.h"
builtin/hash-object.c +1 -0
@@ -14,6 +14,7 @@#include "quote.h" #include "parse-options.h" #include "exec-cmd.h" +#include "setup.h" /* * This is to create corrupt objects for debugging and as such it
builtin/help.c +1 -0
@@ -11,6 +11,7 @@#include "config-list.h" #include "help.h" #include "alias.h" +#include "setup.h" #ifndef DEFAULT_HELP_FORMAT #define DEFAULT_HELP_FORMAT "man"
builtin/index-pack.c +1 -0
@@ -20,6 +20,7 @@#include "object-store.h" #include "replace-object.h" #include "promisor-remote.h" +#include "setup.h" #include "wrapper.h" static const char index_pack_usage[] =
builtin/init-db.c +1 -0
@@ -12,6 +12,7 @@#include "builtin.h" #include "exec-cmd.h" #include "parse-options.h" +#include "setup.h" #include "worktree.h" #include "wrapper.h"
builtin/ls-files.c +1 -0
@@ -20,6 +20,7 @@#include "string-list.h" #include "pathspec.h" #include "run-command.h" +#include "setup.h" #include "submodule.h" #include "submodule-config.h"
builtin/merge-file.c +1 -0
@@ -3,6 +3,7 @@#include "cache.h" #include "config.h" #include "gettext.h" +#include "setup.h" #include "xdiff/xdiff.h" #include "xdiff-interface.h" #include "parse-options.h"
builtin/mv.c +1 -0
@@ -16,6 +16,7 @@#include "cache-tree.h" #include "string-list.h" #include "parse-options.h" +#include "setup.h" #include "submodule.h" #include "entry.h"
builtin/read-tree.c +1 -0
@@ -19,6 +19,7 @@#include "builtin.h" #include "parse-options.h" #include "resolve-undo.h" +#include "setup.h" #include "submodule.h" #include "submodule-config.h"
builtin/reset.c +1 -0
@@ -26,6 +26,7 @@#include "parse-options.h" #include "unpack-trees.h" #include "cache-tree.h" +#include "setup.h" #include "submodule.h" #include "submodule-config.h" #include "dir.h"
builtin/rev-parse.c +1 -0
@@ -18,6 +18,7 @@#include "parse-options.h" #include "diff.h" #include "revision.h" +#include "setup.h" #include "split-index.h" #include "submodule.h" #include "commit-reach.h"
builtin/rm.c +1 -0
@@ -15,6 +15,7 @@#include "tree-walk.h" #include "parse-options.h" #include "string-list.h" +#include "setup.h" #include "submodule.h" #include "pathspec.h"
builtin/shortlog.c +1 -0
@@ -9,6 +9,7 @@#include "revision.h" #include "utf8.h" #include "mailmap.h" +#include "setup.h" #include "shortlog.h" #include "parse-options.h" #include "trailer.h"
builtin/sparse-checkout.c +1 -0
@@ -16,6 +16,7 @@#include "unpack-trees.h" #include "wt-status.h" #include "quote.h" +#include "setup.h" #include "sparse-index.h" #include "worktree.h"
builtin/stash.c +1 -0
@@ -18,6 +18,7 @@#include "entry.h" #include "rerere.h" #include "revision.h" +#include "setup.h" #include "log-tree.h" #include "diffcore.h" #include "exec-cmd.h"
builtin/stripspace.c +1 -0
@@ -3,6 +3,7 @@#include "config.h" #include "gettext.h" #include "parse-options.h" +#include "setup.h" #include "strbuf.h" static void comment_lines (struct strbuf *buf)
builtin/submodule--helper.c +1 -0
@@ -12,6 +12,7 @@#include "quote.h" #include "pathspec.h" #include "dir.h" +#include "setup.h" #include "submodule.h" #include "submodule-config.h" #include "string-list.h"
builtin/update-index.c +1 -0
@@ -20,6 +20,7 @@#include "parse-options.h" #include "pathspec.h" #include "dir.h" +#include "setup.h" #include "split-index.h" #include "fsmonitor.h"
cache.h +0 -163
193 lines not on this page · raw message
commit.c +1 -0
@@ -23,6 +23,7 @@#include "refs.h" #include "commit-reach.h" #include "run-command.h" +#include "setup.h" #include "shallow.h" #include "hook.h"
common-main.c +1 -0
@@ -2,6 +2,7 @@#include "exec-cmd.h" #include "gettext.h" #include "attr.h" +#include "setup.h" /* * Many parts of Git have subprograms communicate via pipe, expect the
config.c +1 -0
@@ -27,6 +27,7 @@#include "color.h" #include "replace-object.h" #include "refs.h" +#include "setup.h" #include "worktree.h" #include "wrapper.h"
daemon.c +1 -0
@@ -5,6 +5,7 @@#include "environment.h" #include "pkt-line.h" #include "run-command.h" +#include "setup.h" #include "strbuf.h" #include "string-list.h" #include "wrapper.h"
diff.c +1 -0
@@ -33,6 +33,7 @@#include "help.h" #include "promisor-remote.h" #include "dir.h" +#include "setup.h" #include "strmap.h" #include "wrapper.h"
dir.c +1 -0
@@ -21,6 +21,7 @@#include "varint.h" #include "ewah/ewok.h" #include "fsmonitor.h" +#include "setup.h" #include "submodule-config.h" #include "wrapper.h"
environment.c +1 -0
@@ -22,6 +22,7 @@#include "replace-object.h" #include "tmp-objdir.h" #include "chdir-notify.h" +#include "setup.h" #include "shallow.h" #include "wrapper.h"
git.c +1 -0
@@ -7,6 +7,7 @@#include "run-command.h" #include "alias.h" #include "replace-object.h" +#include "setup.h" #include "shallow.h" #define RUN_SETUP (1<<0)
http-fetch.c +1 -0
@@ -5,6 +5,7 @@#include "hex.h" #include "http.h" #include "walker.h" +#include "setup.h" #include "strvec.h" #include "urlmatch.h" #include "trace2.h"
http-push.c +1 -0
@@ -12,6 +12,7 @@#include "exec-cmd.h" #include "remote.h" #include "list-objects.h" +#include "setup.h" #include "sigchain.h" #include "strvec.h" #include "packfile.h"
imap-send.c +1 -0
@@ -28,6 +28,7 @@#include "gettext.h" #include "run-command.h" #include "parse-options.h" +#include "setup.h" #include "wrapper.h" #if defined(NO_OPENSSL ) && !defined(HAVE_OPENSSL_CSPRNG )typedef void *SSL ;
line-log.c +1 -0
@@ -16,6 +16,7 @@#include "graph.h" #include "userdiff.h" #include "line-log.h" +#include "setup.h" #include "strvec.h" #include "bloom.h"
mailmap.c +1 -0
@@ -3,6 +3,7 @@#include "string-list.h" #include "mailmap.h" #include "object-store.h" +#include "setup.h" #define DEBUG_MAILMAP 0#if DEBUG_MAILMAP
object-file.c +1 -0
@@ -37,6 +37,7 @@#include "packfile.h" #include "object-store.h" #include "promisor-remote.h" +#include "setup.h" #include "submodule.h" #include "fsck.h" #include "wrapper.h"
object-name.c +1 -0
@@ -15,6 +15,7 @@#include "packfile.h" #include "object-store.h" #include "repository.h" +#include "setup.h" #include "submodule.h" #include "midx.h" #include "commit-reach.h"
path.c +1 -0
@@ -11,6 +11,7 @@#include "string-list.h" #include "dir.h" #include "worktree.h" +#include "setup.h" #include "submodule-config.h" #include "path.h" #include "packfile.h"
pathspec.c +1 -0
@@ -6,6 +6,7 @@#include "gettext.h" #include "pathspec.h" #include "attr.h" +#include "setup.h" #include "strvec.h" #include "quote.h"
refs.c +1 -0
@@ -22,6 +22,7 @@#include "worktree.h" #include "strvec.h" #include "repository.h" +#include "setup.h" #include "sigchain.h" #include "date.h" #include "commit.h"
refs/files-backend.c +1 -0
@@ -14,6 +14,7 @@#include "../object.h" #include "../dir.h" #include "../chdir-notify.h" +#include "../setup.h" #include "../worktree.h" #include "../wrapper.h"
remote-curl.c +1 -0
@@ -18,6 +18,7 @@#include "credential.h" #include "oid-array.h" #include "send-pack.h" +#include "setup.h" #include "protocol.h" #include "quote.h" #include "transport.h"
remote.c +1 -0
@@ -15,6 +15,7 @@#include "revision.h" #include "dir.h" #include "tag.h" +#include "setup.h" #include "string-list.h" #include "strvec.h" #include "commit-reach.h"
repository.c +1 -0
@@ -11,6 +11,7 @@#include "object.h" #include "lockfile.h" #include "remote.h" +#include "setup.h" #include "submodule-config.h" #include "sparse-index.h" #include "promisor-remote.h"
revision.c +1 -0
@@ -29,6 +29,7 @@#include "bisect.h" #include "packfile.h" #include "worktree.h" +#include "setup.h" #include "strvec.h" #include "commit-reach.h" #include "commit-graph.h"
scalar.c +1 -0
@@ -15,6 +15,7 @@#include "dir.h" #include "packfile.h" #include "help.h" +#include "setup.h" static void setup_enlistment_directory(int argc, const char **argv, const char * const *usagestr,
setup.c +1 -0
@@ -5,6 +5,7 @@#include "repository.h" #include "config.h" #include "dir.h" +#include "setup.h" #include "string-list.h" #include "chdir-notify.h" #include "promisor-remote.h"
setup.h new file +168 -0
168 lines not on this page · raw message
submodule.c +1 -0
@@ -26,6 +26,7 @@#include "parse-options.h" #include "object-store.h" #include "commit-reach.h" +#include "setup.h" #include "shallow.h" static int config_update_recurse_submodules =RECURSE_SUBMODULES_OFF ;
symlinks.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "gettext.h" +#include "setup.h" static int threaded_check_leading_path (struct cache_def *cache,const char *name,int len,int warn_on_lstat_err);
t/helper/test-advise.c +1 -0
@@ -2,6 +2,7 @@#include "cache.h" #include "advice.h" #include "config.h" +#include "setup.h" int cmd__advise_if_enabled (int argc,const char **argv) {
t/helper/test-bitmap.c +1 -0
@@ -1,6 +1,7 @@#include "test-tool.h" #include "git-compat-util.h" #include "pack-bitmap.h" +#include "setup.h" static int bitmap_list_commits (void ) {
t/helper/test-bloom.c +1 -0
@@ -3,6 +3,7 @@#include "hex.h" #include "test-tool.h" #include "commit.h" +#include "setup.h" static struct bloom_filter_settings settings =DEFAULT_BLOOM_FILTER_SETTINGS ;
t/helper/test-cache-tree.c +1 -0
@@ -6,6 +6,7 @@#include "tree.h" #include "cache-tree.h" #include "parse-options.h" +#include "setup.h" static char const *const test_cache_tree_usage[] = {N_ ("test-tool cache-tree <options> (control|prime|update)" ),
t/helper/test-config.c +1 -0
@@ -1,6 +1,7 @@#include "test-tool.h" #include "cache.h" #include "config.h" +#include "setup.h" #include "string-list.h" /*
t/helper/test-dump-cache-tree.c +1 -1
@@ -4,7 +4,7 @@#include "hex.h" #include "tree.h" #include "cache-tree.h" - +#include "setup.h" static void dump_one (struct cache_tree *it,const char *pfx,const char *x) {
t/helper/test-dump-fsmonitor.c +1 -0
@@ -1,5 +1,6 @@#include "test-tool.h" #include "cache.h" +#include "setup.h" int cmd__dump_fsmonitor (int ac,const char **av) {
t/helper/test-dump-split-index.c +1 -0
@@ -2,6 +2,7 @@#include "test-tool.h" #include "cache.h" #include "hex.h" +#include "setup.h" #include "split-index.h" #include "ewah/ewok.h"
t/helper/test-dump-untracked-cache.c +1 -0
@@ -3,6 +3,7 @@#include "cache.h" #include "dir.h" #include "hex.h" +#include "setup.h" static int compare_untracked (const void *a_,const void *b_) {
t/helper/test-fast-rebase.c +1 -0
@@ -23,6 +23,7 @@#include "refs.h" #include "revision.h" #include "sequencer.h" +#include "setup.h" #include "strvec.h" #include "tree.h"
t/helper/test-fsmonitor-client.c +1 -0
@@ -7,6 +7,7 @@#include "cache.h" #include "parse-options.h" #include "fsmonitor-ipc.h" +#include "setup.h" #include "thread-utils.h" #include "trace2.h" #include "wrapper.h"
t/helper/test-lazy-init-name-hash.c +1 -0
@@ -3,6 +3,7 @@#include "cache.h" #include "environment.h" #include "parse-options.h" +#include "setup.h" static int single;static int multi;
t/helper/test-match-trees.c +1 -0
@@ -1,6 +1,7 @@#include "test-tool.h" #include "cache.h" #include "hex.h" +#include "setup.h" #include "tree.h" int cmd__match_trees (int ac,const char **av)
t/helper/test-oid-array.c +1 -0
@@ -2,6 +2,7 @@#include "cache.h" #include "hex.h" #include "oid-array.h" +#include "setup.h" static int print_oid (const struct object_id *oid,void *data) {
t/helper/test-oidmap.c +1 -0
@@ -2,6 +2,7 @@#include "cache.h" #include "hex.h" #include "oidmap.h" +#include "setup.h" #include "strbuf.h" /* key is an oid and value is a name (could be a refname for example) */
t/helper/test-oidtree.c +1 -0
@@ -2,6 +2,7 @@#include "cache.h" #include "hex.h" #include "oidtree.h" +#include "setup.h" static enum cb_next print_oid (const struct object_id *oid,void *data) {
t/helper/test-pack-mtimes.c +1 -0
@@ -5,6 +5,7 @@#include "object-store.h" #include "packfile.h" #include "pack-mtimes.h" +#include "setup.h" static void dump_mtimes (struct packed_git *p) {
t/helper/test-partial-clone.c +1 -0
@@ -3,6 +3,7 @@#include "test-tool.h" #include "repository.h" #include "object-store.h" +#include "setup.h" /* * Prints the size of the object corresponding to the given hash in a specific
t/helper/test-path-utils.c +1 -0
@@ -2,6 +2,7 @@#include "cache.h" #include "abspath.h" #include "environment.h" +#include "setup.h" #include "string-list.h" #include "utf8.h"
t/helper/test-proc-receive.c +1 -0
@@ -3,6 +3,7 @@#include "hex.h" #include "parse-options.h" #include "pkt-line.h" +#include "setup.h" #include "sigchain.h" #include "test-tool.h"
t/helper/test-reach.c +1 -0
@@ -8,6 +8,7 @@#include "hex.h" #include "parse-options.h" #include "ref-filter.h" +#include "setup.h" #include "string-list.h" #include "tag.h"
t/helper/test-read-cache.c +1 -0
@@ -2,6 +2,7 @@#include "test-tool.h" #include "cache.h" #include "config.h" +#include "setup.h" #include "wrapper.h" int cmd__read_cache (int argc,const char **argv)
t/helper/test-read-graph.c +1 -0
@@ -4,6 +4,7 @@#include "repository.h" #include "object-store.h" #include "bloom.h" +#include "setup.h" int cmd__read_graph (int argc,const char **argv) {
t/helper/test-read-midx.c +1 -0
@@ -5,6 +5,7 @@#include "repository.h" #include "object-store.h" #include "pack-bitmap.h" +#include "setup.h" static int read_midx_file (const char *object_dir,int show_objects) {
t/helper/test-ref-store.c +1 -0
@@ -2,6 +2,7 @@#include "cache.h" #include "hex.h" #include "refs.h" +#include "setup.h" #include "worktree.h" #include "object-store.h" #include "repository.h"
t/helper/test-repository.c +1 -0
@@ -8,6 +8,7 @@#include "object-store.h" #include "object.h" #include "repository.h" +#include "setup.h" #include "tree.h" static void test_parse_commit_in_graph(const char *gitdir, const char *worktree,
t/helper/test-revision-walking.c +1 -0
@@ -13,6 +13,7 @@#include "commit.h" #include "diff.h" #include "revision.h" +#include "setup.h" static void print_commit (struct commit *commit) {
t/helper/test-scrap-cache-tree.c +1 -0
@@ -2,6 +2,7 @@#include "test-tool.h" #include "cache.h" #include "lockfile.h" +#include "setup.h" #include "tree.h" #include "cache-tree.h"
t/helper/test-serve-v2.c +1 -0
@@ -3,6 +3,7 @@#include "gettext.h" #include "parse-options.h" #include "serve.h" +#include "setup.h" static char const *const serve_usage[] = {N_ ("test-tool serve-v2 [<options>]" ),
t/helper/test-submodule-config.c +1 -0
@@ -1,6 +1,7 @@#include "test-tool.h" #include "cache.h" #include "config.h" +#include "setup.h" #include "submodule-config.h" #include "submodule.h"
t/helper/test-submodule-nested-repo-config.c +1 -0
@@ -1,5 +1,6 @@#include "test-tool.h" #include "cache.h" +#include "setup.h" #include "submodule-config.h" static void die_usage (const char **argv,const char *msg)
t/helper/test-submodule.c +1 -0
@@ -3,6 +3,7 @@#include "cache.h" #include "parse-options.h" #include "remote.h" +#include "setup.h" #include "submodule-config.h" #include "submodule.h"
t/helper/test-subprocess.c +1 -0
@@ -1,6 +1,7 @@#include "test-tool.h" #include "cache.h" #include "run-command.h" +#include "setup.h" int cmd__subprocess (int argc,const char **argv) {
t/helper/test-userdiff.c +1 -0
@@ -1,5 +1,6 @@#include "test-tool.h" #include "cache.h" +#include "setup.h" #include "userdiff.h" #include "config.h"
t/helper/test-write-cache.c +1 -0
@@ -2,6 +2,7 @@#include "test-tool.h" #include "cache.h" #include "lockfile.h" +#include "setup.h" int cmd__write_cache (int argc,const char **argv) {
trace.c +1 -0
@@ -25,6 +25,7 @@#include "abspath.h" #include "environment.h" #include "quote.h" +#include "setup.h" #include "wrapper.h" struct trace_key trace_default_key = {"GIT_TRACE" ,0 ,0 ,0 };
unpack-trees.c +1 -0
@@ -22,6 +22,7 @@#include "promisor-remote.h" #include "entry.h" #include "parallel-checkout.h" +#include "setup.h" /* * Error messages expected by scripts out of plumbing commands such as
worktree.c +1 -0
@@ -5,6 +5,7 @@#include "gettext.h" #include "repository.h" #include "refs.h" +#include "setup.h" #include "strbuf.h" #include "worktree.h" #include "dir.h"
wt-status.c +1 -0
@@ -16,6 +16,7 @@#include "refs.h" #include "submodule.h" #include "column.h" +#include "setup.h" #include "strbuf.h" #include "utf8.h" #include "worktree.h"
Signature · 1 line
gitgitgadget
Quoted 10 lines · Elijah Newren via GitGitGadget
This series picks up where en/header-cleanups leaves off and does more header cleanups, trying to reduce the number of files depending on
cache.h. (There are still more that could be done, but again, this is a good chunk for now.)Elijah Newren (16):
treewide: remove unnecessarycache.hinclusion from a few headers
treewide: be explicit about dependence ongettext.h
treewide: remove unnecessary inclusion ofgettext.h
treewide: remove unnecessarycache.hinclusion from several sources
I couldn't seem to square what you were doing in 2/16 with what 4/16 does, but I think the "issue" is that the commit message for 4/6 doesn't match at least one change it's making, i.e.:
By making those files explicitly include gettext.h, we can already drop the include of cache.h in these files.
But in fact compat/linux/procinfo.c at least (I didn't do more than skim the others) isn't like the rest, in that it doesn't need gettext.h at all.
I also find the ordering hard to follow, but it's ultimately correct in the cases I looked at. E.g. for ref-filter.c your 1/16 does:
-#include "git-compat-util.h" +#include "cache.h"
Then 2/16 does:
+#include "gettext.h"
So I wondered, wait a minute, didn't we just end up over-including cache.h because we needed gettext.h, which the later commit adds?
But no, that's not the case, because as 1/16 notes ("on things from cache.h[...]") we need *other* things from cache.h, so this is ultimately correct.
Still, given that, I for one would have found this easier to follow if commits like 2/16 came before the 1/16, i.e. let's first be explicit about e.g. gettext.h, and then change git-compat-util.h inclusions to cache.h, to clearly note in the progression that the two are distinct.
But this is also fine with me if you don't agree, or can't be bothered to re-roll it.
As a more general note on the direction here: I have some old WIP patches to do similar split-ups of cache.h, but in doing those I was trying to first identify cases where we had a function in cache.h that was used by the low tens of our ~500 *.c source files.
E.g. advice.h is such a case[1], ditto wildmatch.h. Then we have case like ws.c[3], base85.c[4] and pager.c[5] where there's no corresponding header, but we should probably create one (which those WIP commits of mine do).
Whereas this approach feels like the opposite of that, i.e. at the end of this series we're including gettext.h in more than 250 files.
Stepping back a bit, I think our use of cache.h falls into a few broad categories:
A. Things to do with the index (we should probably create an index.h
for those).
B. Used almost everywhere, i.e. "cache.h" can be though of as "git.h",
or "common-utils.h" or whatever.
C. Things used almost nowhere, or only a handful of places,
e.g. wildmatch.h and others noted above.
Part of this series is a frontal assault on the "B" part of that. I think if we're going to include gettext.h explicitly everywhere we're probably saying by extension that no such thing as a "common header" should exist.
Which I'd be fine with, I just personally never thought it was much of a practical problem, i.e. to have the gettext.h's in our tree included "everywhere", ditto "strbuf.h", and even "enum object_file" and other "mostly everyone wants these".
Whereas it is rather annoying that we over-include things in cache.h, or even have cache.h include other headers, as often minor changes to related libraries result in a full re-build.
But maybe "B" isn't sustainable at all, and I'm just fooling myself thinking we could have such a thing.
A nice thing I hadn't considered is that after your topic e.g. removing the gettext.h inclusion from parse-options.h will compile *most* of git, but we'll fail e.g. in:
t/helper/test-parse-pathspec-file.c: In function ‘cmd__parse_pathspec_file’:
./parse-options.h:209:40: error: implicit declaration of function ‘N_’ [-Werror=implicit-function-declaration]
209 | N_("file"), (h) }
So as we don't want gettext in t/helper/* it's nice to get *an* error about that.
So, in the end I think I've convinced myself that even the "B" in that "A..C" is a bad idea.
1. https://github.com/avar/git/commit/17366c2b7b4
2. https://github.com/avar/git/commit/ffb226fb6e6
3. https://github.com/avar/git/commit/1d023e554bf
4. https://github.com/avar/git/commit/e7d5b511090
5. https://github.com/avar/git/commit/0054eea1a1a
Hi Ævar,
Quoted 19 lines · Ævar Arnfjörð Bjarmason
Quoted 10 lines · Elijah Newren via GitGitGadget
This series picks up where en/header-cleanups leaves off and does more header cleanups, trying to reduce the number of files depending on
cache.h. (There are still more that could be done, but again, this is a good chunk for now.)Elijah Newren (16):
treewide: remove unnecessarycache.hinclusion from a few headers
treewide: be explicit about dependence ongettext.h
treewide: remove unnecessary inclusion ofgettext.h
treewide: remove unnecessarycache.hinclusion from several sourcesI couldn't seem to square what you were doing in 2/16 with what 4/16 does, but I think the "issue" is that the commit message for 4/6 doesn't match at least one change it's making, i.e.:
Quoted 6 lines
By making those files explicitly include
gettext.h, we can already drop the include ofcache.hin these files.But in fact
compat/linux/procinfo.cat least (I didn't do more than skim the others) isn't like the rest, in that it doesn't needgettext.hat all.
Yeah, there were apparently pre-existing headers that did not need cache.h, so my script to find the ones that "no longer need it" after some changes identifies not only the ones that can be cleaned out due to the gettext.h changes but the ones that could have been cleaned up beforehand. Maybe I should do a preliminary patch that removes cache.h from some headers, then do the gettext changes, then this patch becomes clearer.
Or I can tweak the commit message to just spell out we already had some headers that didn't need cache.h, so this patch just combines those cleanups.
Quoted 17 lines
I also find the ordering hard to follow, but it's ultimately correct in the cases I looked at. E.g. for
ref-filter.cyour 1/16 does:-#include "git-compat-util.h" +#include "cache.h"Then 2/16 does:
+#include "
gettext.h"So I wondered, wait a minute, didn't we just end up over-including
cache.hbecause we neededgettext.h, which the later commit adds?But no, that's not the case, because as 1/16 notes ("on things from cache.h[...]") we need *other* things from
cache.h, so this is ultimately correct.
Quoted 7 lines
Still, given that, I for one would have found this easier to follow if commits like 2/16 came before the 1/16, i.e. let's first be explicit about e.g.
gettext.h, and then changegit-compat-util.hinclusions tocache.h, to clearly note in the progression that the two are distinct.But this is also fine with me if you don't agree, or can't be bothered to re-roll it.
In my mind, 1/16 probably belonged in en/header-cleanup that was already merged to master and was an oversight that made other cleanups I was trying to do harder. The gettext stuff was new stuff I was doing to make other things in this series easier, so I placed it right after 1/16.
But, I can see your point of view, and I don't feel strongly about the order of these patches. I'm happy to switch them around.
Quoted 9 lines
As a more general note on the direction here: I have some old WIP patches to do similar split-ups of
cache.h, but in doing those I was trying to first identify cases where we had a function incache.hthat was used by the low tens of our ~500 *.c source files.E.g.
advice.his such a case[1], dittowildmatch.h. Then we have case like ws.c[3], base85.c[4] and pager.c[5] where there's no corresponding header, but we should probably create one (which those WIP commits of mine do).
Here was my approach:
* Identify a *single* file that I know that makes no sense to include cache.h.
* Try to figure out why and fix it...but also fix *all* other files
that have the same nonsensical dependencies throughout the entire tree.
* (And maybe also fix a few extra things you find along the way that
repeatedly turn up).
For my first series (en/header-cleanup which is now in master), I was looking at diffcore-rename.c. 17 patches later it was clean.
For this series, I was looking at strbuf.c. It would have been clean at the end, but while waiting for my first series to merge to master, you submitted your series which conflicts. So I dropped some of the changes, but submitted the rest. (And the gettext.h changes originally weren't at the beginning of my series, but then I noticed they repeatedly were additional squashed-in changes that made things harder for others to review, AND harder for me to figure out (see below), so I went back and made the gettext changes into a preliminary big cleanup.)
Your approach also makes sense, I've considered it before and still have it in my backlog, but this series focused on making strbuf.c clean and was already long enough, so I'm deferring those other changes to later.
Quoted 2 lines
Whereas this approach feels like the opposite of that, i.e. at the end of this series we're including
gettext.hin more than 250 files.
The idea to "fix all other files with the same nonsensical dependencies" was heavily impeded by gettext.h. I had scripts to optimistically change "cache.h" to "git-compat-util.h" and try to compile. For those that only gave warnings rather than errors, I needed to wade through pages of gettext-related undeclared warnings, to see the other dependencies in the file. So, making gettext dependencies explicit just made it vastly easier to do all the subsequent cleanups.
Quoted 10 lines
Stepping back a bit, I think our use of
cache.hfalls into a few broad categories:A. Things to do with the index (we should probably create an
index.h
for those).
B. Used almost everywhere, i.e. "cache.h" can be though of as "git.h",
or "common-utils.h" or whatever.
C. Things used almost nowhere, or only a handful of places,
e.g.wildmatch.hand others noted above.
Quoted 4 lines
Part of this series is a frontal assault on the "B" part of that. I think if we're going to include
gettext.hexplicitly everywhere we're probably saying by extension that no such thing as a "common header" should exist.
There might be a way to have a common header that doesn't devolve into a dumping ground of all dependencies the way cache.h has become, but I think we'd need to be really careful. I think git-compat-util.h would obviously make sense to include in such a thing. You might be able to convince me that gettext.h should be in such a thing, but I'm not even sure about that: we have more C files that do not use stuff from gettext (321) than those that do (245).
I think cache.h is really far from what we want. It has often tripped me up in trying to understand the code, often results in needless compile-everything loops when making simple changes, is an impediment to any potential libifying or code-sharing exercise (I was hoping that e.g. merge-ort could be shared with other projects instead of being reinvented), and makes other interesting exploratory hacking harder (e.g. I've toyed with the idea of speeding up merge-ort or other parts of the code by rust-rewrites for self-educational purposes and wondered why the code depended on so many things).
The focus of this series was not B; it was just "remove the cache.h header from strbuf.c, and from any files that depend on cache.h for the same dumb reasons". However, even though it wasn't the focus of my series, I would have to say that you are right that I don't believe in having a dumping ground of "common" includes as I think it just gets littered with things that aren't actually common. I may well submit future series explicitly assaulting part "B".
Quoted 8 lines
Which I'd be fine with, I just personally never thought it was much of a practical problem, i.e. to have the gettext.h's in our tree included "everywhere", ditto "
strbuf.h", and even "enumobject_file" and other "mostly everyone wants these".Whereas it is rather annoying that we over-include things in
cache.h, or even havecache.hinclude other headers, as often minor changes to related libraries result in a full re-build.
The time to rebuild the code is one concern, but wasn't even my primary concern.
Quoted 7 lines
But maybe "B" isn't sustainable at all, and I'm just fooling myself thinking we could have such a thing.
A nice thing I hadn't considered is that after your topic e.g. removing the
gettext.hinclusion fromparse-options.hwill compile *most* of git, but we'll fail e.g. in:
Quoted 7 lines
t/helper/test-parse-pathspec-file.c: In function ‘cmd__parse_pathspec_file’:
./parse-options.h:209:40: error: implicit declaration of function ‘N_’ [-Werror=implicit-function-declaration]
209 |N_("file"), (h) }So as we don't want gettext in t/helper/* it's nice to get *an* error about that.
I don't see why that's a "nice thing"; it doesn't even make sense to me as being a useful thing to try. parse-options.h has several macros that explicitly call N_(). Even if the code compiled with that proposed change (because no one used those particular macros), it'd be a bad idea unless those macros were first deleted or modified to not depend upon gettext.h. Since the file clearly depends upon gettext.h, I think it should explicitly include it.
(In general, I believe if you depend upon something, you should explicitly include it. I was convinced otherwise for git-compat-util.h and header files[1], but I hold that as the only exception until others have solid reasons for other headers being special. In fact, I'd like to change the coding guidelines to state that you should directly include any headers you use, with the exception of git-compat-util.h in other header files. We're just too far away from that right now for it to be realistic.)
[1] https://lore.kernel.org/git/CABPp-BHizCj2e454w3vtHrDNip3Rm-gUMT0oJiAsbkAvr_QvVA@mail.gmail.com/
Quoted 2 lines
So, in the end I think I've convinced myself that even the "B" in that "A..C" is a bad idea.
Was this based only on the mistaken idea of removing gettext.h from parse-options.h, or on other factors?
PATCH v2 1/16 treewide: remove unnecessary cache.h inclusion from a few headers
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
Ever since a64215b6cd ("object.h: stop depending on cache.h; make cache.h depend on object.h", 2023-02-24), we have a few headers that could have replaced their include of cache.h with an include of object.h. Make that change now.
Some C files had to start including cache.h after this change (or some smaller header it had brought in), because the C files were depending on things from cache.h but were only formerly implicitly getting cache.h through one of these headers being modified in this patch.
--- bulk-checkin.h | 2 +- bundle.h | 1 - cache-tree.c | 2 +- config.c | 2 +- fmt-merge-msg.c | 2 +- fsck.c | 2 +- http-backend.c | 2 +- pack-mtimes.c | 2 +- packfile.h | 4 +++- prune-packed.c | 2 +- ref-filter.c | 2 +- refs.c | 2 +- refs.h | 1 - refs/packed-backend.c | 2 +- refspec.c | 1 + remote.c | 2 +- server-info.c | 2 +- shallow.c | 2 +- strbuf.c | 2 +- streaming.h | 4 +++- submodule.c | 2 +- t/helper/test-bundle-uri.c | 1 + t/helper/test-fast-rebase.c | 2 +- t/helper/test-pack-mtimes.c | 2 +- t/helper/test-reach.c | 1 + transport.c | 2 +- transport.h | 1 - worktree.c | 2 +- 28 files changed, 29 insertions(+), 25 deletions(-)
bulk-checkin.h +1 -1
@@ -4,7 +4,7 @@#ifndef BULK_CHECKIN_H #define BULK_CHECKIN_H -#include "cache.h" +#include "object.h" void prepare_loose_object_bulk_checkin (void );void fsync_loose_object_bulk_checkin (int fd,const char *filename);
bundle.h +0 -1
@@ -2,7 +2,6 @@#define BUNDLE_H #include "strvec.h" -#include "cache.h" #include "string-list.h" #include "list-objects-filter-options.h"
cache-tree.c +1 -1
@@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "alloc.h" #include "hex.h" #include "lockfile.h"
config.c +1 -1
@@ -5,7 +5,7 @@* Copyright (C) Johannes Schindelin, 2005 * */ -#include "git-compat-util.h" +#include "cache.h" #include "alloc.h" #include "date.h" #include "branch.h"
fmt-merge-msg.c +1 -1
@@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "alloc.h" #include "config.h" #include "refs.h"
fsck.c +1 -1
@@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "alloc.h" #include "hex.h" #include "object-store.h"
http-backend.c +1 -1
@@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "alloc.h" #include "config.h" #include "hex.h"
pack-mtimes.c +1 -1
@@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "pack-mtimes.h" #include "object-store.h" #include "packfile.h"
packfile.h +3 -1
@@ -1,11 +1,13 @@#ifndef PACKFILE_H #define PACKFILE_H -#include "cache.h" +#include "object.h" #include "oidset.h" /* in object-store.h */ struct packed_git ; +struct pack_entry ; +struct pack_window ;struct object_info ;/*
prune-packed.c +1 -1
@@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "object-store.h" #include "packfile.h" #include "progress.h"
ref-filter.c +1 -1
@@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "alloc.h" #include "hex.h" #include "parse-options.h"
refs.c +1 -1
@@ -2,7 +2,7 @@* The backend-independent part of the reference module. */ -#include "git-compat-util.h" +#include "cache.h" #include "alloc.h" #include "config.h" #include "hashmap.h"
refs.h +0 -1
@@ -1,7 +1,6 @@#ifndef REFS_H #define REFS_H -#include "cache.h" #include "commit.h" struct object_id ;
refs/packed-backend.c +1 -1
@@ -1,4 +1,4 @@ -#include "../git-compat-util.h" +#include "../cache.h" #include "../alloc.h" #include "../config.h" #include "../hex.h"
refspec.c +1 -0
@@ -1,5 +1,6 @@#include "git-compat-util.h" #include "alloc.h" +#include "gettext.h" #include "hex.h" #include "strvec.h" #include "refs.h"
remote.c +1 -1
@@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "alloc.h" #include "config.h" #include "hex.h"
server-info.c +1 -1
@@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "alloc.h" #include "dir.h" #include "hex.h"
shallow.c +1 -1
@@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "alloc.h" #include "hex.h" #include "repository.h"
strbuf.c +1 -1
@@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "alloc.h" #include "hex.h" #include "refs.h"
streaming.h +3 -1
@@ -3,10 +3,12 @@*/ #ifndef STREAMING_H #define STREAMING_H 1 -#include "cache.h" + +#include "object.h" /* opaque */ struct git_istream ; +struct stream_filter ; struct git_istream *open_istream(struct repository *, const struct object_id *, enum object_type *, unsigned long *,
submodule.c +1 -1
@@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "alloc.h" #include "repository.h" #include "config.h"
t/helper/test-bundle-uri.c +1 -0
@@ -1,6 +1,7 @@#include "test-tool.h" #include "parse-options.h" #include "bundle-uri.h" +#include "gettext.h" #include "strbuf.h" #include "string-list.h" #include "transport.h"
t/helper/test-fast-rebase.c +1 -1
@@ -12,7 +12,7 @@#define USE_THE_INDEX_VARIABLE #include "test-tool.h" - +#include "cache.h" #include "cache-tree.h" #include "commit.h" #include "hex.h"
t/helper/test-pack-mtimes.c +1 -1
@@ -1,5 +1,5 @@ -#include "git-compat-util.h" #include "test-tool.h" +#include "cache.h" #include "hex.h" #include "strbuf.h" #include "object-store.h"
t/helper/test-reach.c +1 -0
@@ -1,4 +1,5 @@#include "test-tool.h" +#include "cache.h" #include "alloc.h" #include "commit.h" #include "commit-reach.h"
transport.c +1 -1
@@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "alloc.h" #include "config.h" #include "hex.h"
transport.h +0 -1
@@ -1,7 +1,6 @@#ifndef TRANSPORT_H #define TRANSPORT_H -#include "cache.h" #include "run-command.h" #include "remote.h" #include "list-objects-filter-options.h"
worktree.c +1 -1
@@ -1,4 +1,4 @@ -#include "git-compat-util.h" +#include "cache.h" #include "alloc.h" #include "repository.h" #include "refs.h"
Signature · 1 line
gitgitgadget
PATCH v2 3/16 treewide: remove unnecessary inclusion of gettext.h
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
Looking at things from the opposite angle of the last patch, we had a few files that were including gettext.h and perhaps needed it at some point in history, but no longer require it. Remove the include.
--- progress.c | 1 - t/helper/test-parse-pathspec-file.c | 1 - t/helper/test-progress.c | 1 - t/helper/test-run-command.c | 1 - 4 files changed, 4 deletions(-)
progress.c +0 -1
@@ -10,7 +10,6 @@#define GIT_TEST_PROGRESS_ONLY #include "cache.h" -#include "gettext.h" #include "progress.h" #include "strbuf.h" #include "trace.h"
t/helper/test-parse-pathspec-file.c +0 -1
@@ -1,7 +1,6 @@#include "test-tool.h" #include "parse-options.h" #include "pathspec.h" -#include "gettext.h" int cmd__parse_pathspec_file (int argc,const char **argv) {
t/helper/test-progress.c +0 -1
@@ -19,7 +19,6 @@*/ #define GIT_TEST_PROGRESS_ONLY #include "test-tool.h" -#include "gettext.h" #include "parse-options.h" #include "progress.h" #include "strbuf.h"
t/helper/test-run-command.c +0 -1
@@ -16,7 +16,6 @@#include "string-list.h" #include "thread-utils.h" #include "wildmatch.h" -#include "gettext.h" static int number_callbacks; static int parallel_next(struct child_process *cp,
Signature · 1 line
gitgitgadget
PATCH v2 4/16 treewide: remove unnecessary cache.h inclusion from several sources
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
A number of files were apparently including cache.h solely to get gettext.h. By making those files explicitly include gettext.h, we can already drop the include of cache.h in these files. On top of that, there were some files using cache.h that didn't need to for any reason. Remove these unnecessary includes.
--- compat/linux/procinfo.c | 2 +- compat/simple-ipc/ipc-shared.c | 2 +- connected.c | 2 +- grep.c | 2 +- negotiator/default.c | 2 +- negotiator/skipping.c | 2 +- notes-cache.c | 2 +- patch-ids.c | 2 +- reflog.c | 2 +- refs/iterator.c | 2 +- replace-object.c | 2 +- t/helper/test-hash.c | 1 - xdiff-interface.c | 2 +- 13 files changed, 12 insertions(+), 13 deletions(-)
compat/linux/procinfo.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "strbuf.h" #include "strvec.h"
compat/simple-ipc/ipc-shared.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "simple-ipc.h" #include "strbuf.h" #include "pkt-line.h"
connected.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"
grep.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "config.h" #include "gettext.h" #include "grep.h"
negotiator/default.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "default.h" #include "../commit.h" #include "../fetch-negotiator.h"
negotiator/skipping.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "skipping.h" #include "../commit.h" #include "../fetch-negotiator.h"
notes-cache.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "notes-cache.h" #include "object-store.h" #include "repository.h"
patch-ids.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "diff.h" #include "commit.h" #include "hash-lookup.h"
reflog.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "gettext.h" #include "object-store.h" #include "reflog.h"
refs/iterator.c +1 -1
@@ -3,7 +3,7 @@* documentation about the design and use of reference iterators. */ -#include "cache.h" +#include "git-compat-util.h" #include "refs.h" #include "refs/refs-internal.h" #include "iterator.h"
replace-object.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "gettext.h" #include "hex.h" #include "oidmap.h"
t/helper/test-hash.c +0 -1
@@ -1,5 +1,4 @@#include "test-tool.h" -#include "cache.h" #include "hex.h" int cmd_hash_impl (int ac,const char **av,int algo)
xdiff-interface.c +1 -1
@@ -1,4 +1,4 @@ -#include "cache.h" +#include "git-compat-util.h" #include "config.h" #include "hex.h" #include "object-store.h"
Signature · 1 line
gitgitgadget
v2 cover Header cleanups
In reply to Elijah Newren via GitGitGadgetMaintainer note: I dropped multiple changes from this series to avoid conflicts with other in-flight series, but has some small conflicts with
seen: one semantic conflict with ed/fsmonitor-inotify (correct resolution:
include abspath.h in the new file compat/fsmonitor/fsm-path-utils-linux.c) and a few conflicts with sg/parse-options-h-users (which was submitted after my series; correct resolution: just make sure all the headers are included from both sides).
The motivating thrust of this series was trying to remove the inclusion of cache.h from strbuf.c. This series doesn't quite achieve that, because I dropped some changes to avoid conflicting with ed/fsmonitor-inotify, and to avoid conflicting with Ævar's series on the_repository cleanup.
Overview of the series:
* Patch 1: leftover cleanup from en/header-cleanups (now in master) that should have been included in that series
* Patches 2-4: cleanups around gettext.h. Without these patches, many gettext inclusions would have to be squashed into later patches and make them harder to review. Also, the implicit dependency on gettext.h was making it much harder to find other dependencies.
* Patch 5: move some global var declarations from cache.h into the header associated with where the vars are declared
* Patches 6-16: move header declarations from cache.h into a header named the same as the source file containing the actual functions (e.g. move declarations for abspath.c functions from cache.h into abspath.h), and reduce the dependencies on cache.h accordingly.
Changes since v1:
* rebased on main (to avoid conflict with jk/bundle-use-dash-for-stdfiles; no more conflicts with next!)
* cleaned up the wording in patch 4
* added more detail to this cover letter giving an overview of the series, and updating about conflicts
Changes not incorporated:
* I left patch 1 before patches 2-4, since it's purpose (leftover cleanup from en/header-cleanups) just means it makes more sense there for me. I don't know how to explain it in a way that makes sense if I move it.
Notes:
* As I mentioned in my last series, Dscho's gitgitgadget is super helpful for a series like this.
* As with my previous series (en/header-cleanup), I used the scripts at my header-cleanup-scripts branch
[https://github.com/newren/git/commit/db81c8d7fb554b3edf04320e218bddeb98bb6194],
and some tweaks thereof, repeatedly while making this series (though they are prone to produce both false positive and false negatives, so if you use them, only use them to generate hints about which files to look at).
Elijah Newren (16):
treewide: remove unnecessary cache.h inclusion from a few headers
treewide: be explicit about dependence on gettext.h
treewide: remove unnecessary inclusion of gettext.h
treewide: remove unnecessary cache.h inclusion from several sources
environment: move comment_line_char from cache.h abspath.h: move absolute path functions from cache.h cache.h: remove expand_user_path()
path.h: move function declarations for path.c functions from cache.h wrapper.h: move declarations for wrapper.c functions from cache.h
treewide: remove unnecessary includes of cache.h environment.h: move declarations for environment.c functions from
cache.h
treewide: remove cache.h inclusion due to environment.h changes setup.h: move declarations for setup.c functions from cache.h
treewide: remove cache.h inclusion due to setup.h changes write-or-die.h: move declarations for write-or-die.c functions from
cache.h
csum-file.h: remove unnecessary inclusion of cache.h
abspath.c | 4 +- abspath.h | 33 ++ add-interactive.c | 1 + add-patch.c | 2 + apply.c | 5 + archive-tar.c | 2 + archive-zip.c | 2 + archive.c | 4 + attr.c | 3 + bisect.c | 2 + blame.c | 2 + branch.c | 2 + builtin/add.c | 1 + builtin/am.c | 4 + builtin/apply.c | 1 + builtin/archive.c | 1 + builtin/bisect.c | 3 + builtin/blame.c | 4 + builtin/branch.c | 3 + builtin/bugreport.c | 5 +- builtin/bundle.c | 3 + builtin/cat-file.c | 3 + builtin/check-attr.c | 4 + builtin/check-ignore.c | 2 + builtin/check-mailmap.c | 2 + builtin/check-ref-format.c | 1 + builtin/checkout--worker.c | 1 + builtin/checkout-index.c | 2 + builtin/checkout.c | 3 + builtin/clean.c | 3 + builtin/clone.c | 4 + builtin/column.c | 1 + builtin/commit-graph.c | 2 + builtin/commit-tree.c | 1 + builtin/commit.c | 2 + builtin/config.c | 5 + builtin/count-objects.c | 2 + builtin/credential-cache--daemon.c | 2 + builtin/credential-cache.c | 3 + builtin/credential-store.c | 2 + builtin/describe.c | 3 + builtin/diagnose.c | 2 + builtin/diff-index.c | 1 + builtin/diff-tree.c | 1 + builtin/diff.c | 2 + builtin/difftool.c | 5 + builtin/fast-export.c | 1 + builtin/fast-import.c | 4 + builtin/fetch-pack.c | 1 + builtin/fetch.c | 2 + builtin/fmt-merge-msg.c | 2 + builtin/for-each-ref.c | 1 + builtin/for-each-repo.c | 1 + builtin/fsck.c | 1 + builtin/fsmonitor--daemon.c | 3 + builtin/gc.c | 5 + builtin/get-tar-commit-id.c | 1 + builtin/grep.c | 3 + builtin/hash-object.c | 4 + builtin/help.c | 2 + builtin/hook.c | 1 + builtin/index-pack.c | 4 + builtin/init-db.c | 5 + builtin/interpret-trailers.c | 1 + builtin/log.c | 4 + builtin/ls-files.c | 2 + builtin/ls-remote.c | 1 + builtin/ls-tree.c | 1 + builtin/mailinfo.c | 3 + builtin/mailsplit.c | 1 + builtin/merge-base.c | 1 + builtin/merge-file.c | 3 + builtin/merge-recursive.c | 1 + builtin/merge-tree.c | 1 + builtin/merge.c | 4 + builtin/mktag.c | 1 + builtin/mktree.c | 1 + builtin/multi-pack-index.c | 3 + builtin/mv.c | 4 + builtin/name-rev.c | 2 + builtin/notes.c | 2 + builtin/pack-objects.c | 3 + builtin/pack-redundant.c | 1 + builtin/pack-refs.c | 1 + builtin/patch-id.c | 1 + builtin/prune-packed.c | 1 + builtin/prune.c | 2 + builtin/pull.c | 1 + builtin/push.c | 2 + builtin/range-diff.c | 1 + builtin/read-tree.c | 2 + builtin/rebase.c | 4 + builtin/receive-pack.c | 4 + builtin/reflog.c | 1 + builtin/remote.c | 1 + builtin/repack.c | 2 + builtin/replace.c | 2 + builtin/rerere.c | 2 + builtin/reset.c | 3 + builtin/rev-list.c | 2 + builtin/rev-parse.c | 4 + builtin/revert.c | 1 + builtin/rm.c | 2 + builtin/send-pack.c | 1 + builtin/shortlog.c | 3 + builtin/show-branch.c | 2 + builtin/show-index.c | 1 + builtin/show-ref.c | 1 + builtin/sparse-checkout.c | 3 + builtin/stash.c | 4 + builtin/stripspace.c | 3 + builtin/submodule--helper.c | 4 + builtin/symbolic-ref.c | 1 + builtin/tag.c | 3 + builtin/unpack-file.c | 1 + builtin/unpack-objects.c | 2 + builtin/update-index.c | 4 + builtin/update-ref.c | 1 + builtin/update-server-info.c | 1 + builtin/upload-pack.c | 1 + builtin/verify-commit.c | 1 + builtin/verify-pack.c | 1 + builtin/verify-tag.c | 1 + builtin/worktree.c | 4 + builtin/write-tree.c | 2 + bulk-checkin.c | 4 +- bulk-checkin.h | 2 +- bundle-uri.c | 2 + bundle.c | 3 + bundle.h | 1 - cache-tree.c | 3 +- cache.h | 571 ------------------- chdir-notify.c | 1 + chunk-format.c | 2 + color.c | 1 + combine-diff.c | 1 + commit-graph.c | 4 +- commit.c | 3 + common-main.c | 2 + compat/disk.h | 2 + compat/fsmonitor/fsm-health-win32.c | 1 + compat/fsmonitor/fsm-listen-darwin.c | 1 + compat/fsmonitor/fsm-listen-win32.c | 1 + compat/fsmonitor/fsm-path-utils-darwin.c | 1 + compat/fsmonitor/fsm-path-utils-win32.c | 1 + compat/linux/procinfo.c | 2 +- compat/mingw.c | 4 + compat/precompose_utf8.c | 2 + compat/simple-ipc/ipc-shared.c | 2 +- compat/simple-ipc/ipc-unix-socket.c | 1 + compat/simple-ipc/ipc-win32.c | 2 + compat/terminal.c | 4 +- config.c | 7 +- connect.c | 2 + connected.c | 3 +- convert.c | 2 + copy.c | 1 + credential.c | 2 + csum-file.c | 3 +- csum-file.h | 2 +- daemon.c | 4 + date.c | 1 + delta-islands.c | 3 +- diagnose.c | 2 + diff-lib.c | 1 + diff-no-index.c | 2 + diff.c | 5 + dir.c | 5 + editor.c | 3 + entry.c | 3 + environment.c | 5 + environment.h | 220 +++++++ exec-cmd.c | 3 + fetch-pack.c | 5 +- fmt-merge-msg.c | 3 +- fsck.c | 2 +- fsmonitor-ipc.c | 1 + fsmonitor.c | 1 + gettext.c | 4 +- git.c | 3 + gpg-interface.c | 6 +- grep.c | 3 +- http-backend.c | 5 +- http-fetch.c | 2 + http-push.c | 2 + imap-send.c | 3 + line-log.c | 2 +- list-objects-filter-options.h | 1 + list-objects-filter.c | 1 + list-objects.c | 1 + ll-merge.c | 1 + lockfile.c | 4 +- log-tree.c | 2 + ls-refs.c | 4 +- mailmap.c | 2 + merge-ort-wrappers.c | 1 + merge-ort.c | 2 + merge-recursive.c | 3 + merge.c | 1 + midx.c | 4 +- name-hash.c | 2 + negotiator/default.c | 2 +- negotiator/skipping.c | 2 +- notes-cache.c | 2 +- notes-merge.c | 2 + notes-utils.c | 4 +- notes.c | 1 + object-file.c | 7 +- object-name.c | 3 + object.c | 1 + pack-bitmap-write.c | 5 +- pack-bitmap.c | 3 +- pack-check.c | 1 + pack-mtimes.c | 3 +- pack-revindex.c | 1 + pack-write.c | 2 + pack.h | 2 + packfile.c | 5 +- packfile.h | 4 +- parallel-checkout.c | 2 + parse-options-cb.c | 2 + parse-options.c | 3 +- parse-options.h | 2 + patch-ids.c | 2 +- path.c | 6 +- path.h | 62 +- pathspec.c | 4 + pkt-line.c | 3 + preload-index.c | 2 + pretty.c | 2 + progress.c | 1 - promisor-remote.c | 1 + prompt.c | 3 +- protocol.c | 1 + prune-packed.c | 2 + range-diff.c | 2 + reachable.c | 3 +- read-cache.c | 3 + rebase-interactive.c | 3 + ref-filter.c | 4 +- ref-filter.h | 1 + reflog.c | 3 +- refs.c | 6 +- refs.h | 1 - refs/files-backend.c | 7 +- refs/iterator.c | 2 +- refs/packed-backend.c | 4 +- refspec.c | 1 + remote-curl.c | 4 + remote.c | 6 +- replace-object.c | 3 +- repository.c | 2 + rerere.c | 3 + rerere.h | 1 + reset.c | 1 + revision.c | 3 + run-command.c | 2 + scalar.c | 2 + send-pack.c | 4 +- sequencer.c | 4 + server-info.c | 4 +- setup.c | 4 + setup.h | 168 ++++++ shallow.c | 3 +- sideband.c | 2 + sparse-index.c | 2 + split-index.c | 1 + strbuf.c | 6 +- streaming.c | 2 + streaming.h | 4 +- submodule-config.c | 2 + submodule.c | 6 +- symlinks.c | 2 + t/helper/test-advise.c | 2 +- t/helper/test-bitmap.c | 3 +- t/helper/test-bloom.c | 4 +- t/helper/test-bundle-uri.c | 1 + t/helper/test-cache-tree.c | 2 + t/helper/test-config.c | 2 +- t/helper/test-delta.c | 2 +- t/helper/test-dump-cache-tree.c | 2 +- t/helper/test-dump-fsmonitor.c | 1 + t/helper/test-dump-split-index.c | 1 + t/helper/test-dump-untracked-cache.c | 1 + t/helper/test-fast-rebase.c | 5 +- t/helper/test-fsmonitor-client.c | 2 + t/helper/test-hash.c | 1 - t/helper/test-lazy-init-name-hash.c | 2 + t/helper/test-match-trees.c | 1 + t/helper/test-oid-array.c | 1 + t/helper/test-oidmap.c | 1 + t/helper/test-oidtree.c | 1 + t/helper/test-pack-mtimes.c | 2 +- t/helper/test-parse-pathspec-file.c | 1 - t/helper/test-partial-clone.c | 4 +- t/helper/test-path-utils.c | 3 + t/helper/test-pkt-line.c | 3 +- t/helper/test-proc-receive.c | 4 +- t/helper/test-progress.c | 1 - t/helper/test-reach.c | 3 + t/helper/test-read-cache.c | 2 + t/helper/test-read-graph.c | 2 +- t/helper/test-read-midx.c | 1 + t/helper/test-ref-store.c | 2 +- t/helper/test-repository.c | 3 +- t/helper/test-revision-walking.c | 2 +- t/helper/test-run-command.c | 1 - t/helper/test-scrap-cache-tree.c | 1 + t/helper/test-serve-v2.c | 3 +- t/helper/test-submodule-config.c | 1 + t/helper/test-submodule-nested-repo-config.c | 2 +- t/helper/test-submodule.c | 2 +- t/helper/test-subprocess.c | 2 +- t/helper/test-trace2.c | 2 +- t/helper/test-userdiff.c | 2 +- t/helper/test-write-cache.c | 1 + tag.c | 2 + tempfile.c | 4 +- tmp-objdir.c | 2 + trace.c | 4 + trace2/tr2_cfg.c | 4 +- trace2/tr2_cmd_name.c | 3 +- trace2/tr2_dst.c | 4 +- trace2/tr2_sid.c | 3 +- trailer.c | 4 +- transport-helper.c | 3 + transport.c | 4 +- transport.h | 1 - tree-walk.c | 1 + unpack-trees.c | 3 + upload-pack.c | 3 + usage.c | 4 +- walker.c | 1 + worktree.c | 5 + wrapper.c | 3 + wrapper.h | 36 ++ write-or-die.c | 4 +- write-or-die.h | 78 +++ wt-status.c | 3 + xdiff-interface.c | 2 +- 340 files changed, 1311 insertions(+), 669 deletions(-) create mode 100644 abspath.h create mode 100644 setup.h create mode 100644 wrapper.h create mode 100644 write-or-die.h
base-commit: e25cabbf6b34e4a6e903d65102d87055cc994778
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1493%2Fnewren%2Fheader-cleanup-2-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1493/newren/header-cleanup-2-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/1493
Range-diff vs v1:
1: 88959aba6f1 = 1: a1be63930c4 treewide: remove unnecessary cache.h inclusion from a few headers 2: b771199fae3 = 2: 6e80396e861 treewide: be explicit about dependence on gettext.h 3: a31269a26b3 = 3: 644d305c669 treewide: remove unnecessary inclusion of gettext.h 4: 3c193bef1d0 ! 4: 95b86aecb43 treewide: remove unnecessary cache.h inclusion from several sources
@@ Commit message
A number of files were apparently including cache.h solely to get gettext.h. By making those files explicitly include gettext.h, we can
- already drop the include of cache.h in these files. Remove those now
- unnecessary includes.
+ already drop the include of cache.h in these files. On top of that,
+ there were some files using cache.h that didn't need to for any reason.
+ Remove these unnecessary includes.
5: 43457e44b4e = 5: 417b2ffa999 environment: move comment_line_char from cache.h
6: a0bbd2c9b48 ! 6: 1fbd957047d abspath.h: move absolute path functions from cache.h
@@ abspath.h (new)
+ */
+char *prefix_filename(const char *prefix, const char *path);
+
++/* Likewise, but path=="-" always yields "-" */
++char *prefix_filename_except_for_dash(const char *prefix, const char *path);
++
+static inline int is_absolute_path(const char *path)
+{
+ return is_dir_sep(path[0]) || has_dos_drive_prefix(path);
@@ cache.h: const char *setup_git_directory(void);
- * prefix was empty).
- */
-char *prefix_filename(const char *prefix, const char *path);
+-
+-/* Likewise, but path=="-" always yields "-" */
+-char *prefix_filename_except_for_dash(const char *prefix, const char *path);
-
int check_filename(const char *prefix, const char *name);
void verify_filename(const char *prefix,
7: a0fc4aa2470 = 7: 805d0a86951 cache.h: remove expand_user_path()
8: 0f48e561b79 = 8: b0bfbe7f38c path.h: move function declarations for path.c functions from cache.h
9: 66f06731cab = 9: 43a61845240 wrapper.h: move declarations for wrapper.c functions from cache.h
10: f4e15c9e5c2 = 10: a6c7245219a treewide: remove unnecessary includes of cache.h
11: fa7449b5b99 = 11: 5ef1a4f1d6c environment.h: move declarations for environment.c functions from cache.h
12: 4e6a4030b1e = 12: 496d36e4fd0 treewide: remove cache.h inclusion due to environment.h changes
13: 9722988e537 = 13: 1d5cd115161 setup.h: move declarations for setup.c functions from cache.h
14: 0e84202da90 = 14: 30b21691265 treewide: remove cache.h inclusion due to setup.h changes
15: 626d089f10b = 15: 6e40d1d783d write-or-die.h: move declarations for write-or-die.c functions from cache.h
16: 38af06f55bc = 16: 72d58b391a1 csum-file.h: remove unnecessary inclusion of cache.hSignature · 1 line
gitgitgadget
PATCH v2 5/16 environment: move comment_line_char from cache.h
From: Elijah Newren <[email protected]>
This is one step towards making strbuf.c not depend upon cache.h. Additional steps will follow in subsequent commits.
--- add-patch.c | 1 + builtin/branch.c | 1 + builtin/commit.c | 1 + builtin/merge.c | 1 + builtin/tag.c | 1 + cache.h | 7 ------- commit.c | 1 + environment.h | 7 +++++++ fmt-merge-msg.c | 1 + sequencer.c | 1 + strbuf.c | 1 + trailer.c | 1 + wt-status.c | 1 + 13 files changed, 18 insertions(+), 7 deletions(-)
add-patch.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "add-interactive.h" #include "alloc.h" +#include "environment.h" #include "gettext.h" #include "strbuf.h" #include "run-command.h"
builtin/branch.c +1 -0
@@ -8,6 +8,7 @@#include "cache.h" #include "config.h" #include "color.h" +#include "environment.h" #include "refs.h" #include "commit.h" #include "builtin.h"
builtin/commit.c +1 -0
@@ -12,6 +12,7 @@#include "cache-tree.h" #include "color.h" #include "dir.h" +#include "environment.h" #include "builtin.h" #include "diff.h" #include "diffcore.h"
builtin/merge.c +1 -0
@@ -10,6 +10,7 @@#include "cache.h" #include "alloc.h" #include "config.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "parse-options.h"
builtin/tag.c +1 -0
@@ -9,6 +9,7 @@#include "cache.h" #include "config.h" #include "builtin.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "refs.h"
cache.h +0 -7
@@ -959,13 +959,6 @@ extern int sparse_expect_files_outside_of_patterns;*/ int use_optional_locks (void ); -/* -* The character that begins a commented line in user-editable file -* that is subject to stripspace. -*/ -extern char comment_line_char; -extern int auto_comment_line_char; -enum log_refs_config {LOG_REFS_UNSET =-1 ,LOG_REFS_NONE =0 ,
commit.c +1 -0
@@ -2,6 +2,7 @@#include "tag.h" #include "commit.h" #include "commit-graph.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "repository.h"
environment.h +7 -0
@@ -3,6 +3,13 @@#include "strvec.h" +/* +* The character that begins a commented line in user-editable file +* that is subject to stripspace. +*/ +extern char comment_line_char; +extern int auto_comment_line_char; +/* * Wrapper of getenv() that returns a strdup value. This value is kept * in argv to be freed later.
fmt-merge-msg.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "alloc.h" #include "config.h" +#include "environment.h" #include "refs.h" #include "object-store.h" #include "diff.h"
sequencer.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "alloc.h" #include "config.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "lockfile.h"
strbuf.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "alloc.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "refs.h"
trailer.c +1 -0
@@ -1,6 +1,7 @@#include "cache.h" #include "alloc.h" #include "config.h" +#include "environment.h" #include "gettext.h" #include "string-list.h" #include "run-command.h"
wt-status.c +1 -0
@@ -4,6 +4,7 @@#include "dir.h" #include "commit.h" #include "diff.h" +#include "environment.h" #include "gettext.h" #include "hex.h" #include "revision.h"
Signature · 1 line
gitgitgadget
PATCH v2 7/16 cache.h: remove expand_user_path()
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
expand_user_path() was renamed to interpolate_path() back in mid-2021, but reinstated with a #define and a NEEDSWORK comment that we would eventually want to get rid of it. Do so now.
--- cache.h | 2 -- gpg-interface.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-)
cache.h +0 -2
@@ -1142,8 +1142,6 @@ enum scld_error safe_create_leading_directories_no_share(char *path);int mkdir_in_gitdir (const char *path);char *interpolate_path (const char *path,int real_home); -/* NEEDSWORK: remove this synonym once in-flight topics have migrated */ -#define expand_user_path interpolate_pathconst char *enter_repo (const char *path,int strict);const char *remove_leading_path (const char *in,const char *prefix);const char *relative_path (const char *in,const char *prefix,struct strbuf *sb);
gpg-interface.c +1 -1
@@ -1049,7 +1049,7 @@ static int sign_buffer_ssh(struct strbuf *buffer, struct strbuf *signature, ssh_signing_key_file =strbuf_detach (&key_file->filename,NULL ); }else {/* We assume a file */ - ssh_signing_key_file =expand_user_path (signing_key,1 ); + ssh_signing_key_file =interpolate_path (signing_key,1 ); } buffer_file =mks_tempfile_t (".git_signing_buffer_tmpXXXXXX" );
Signature · 1 line
gitgitgadget
PATCH v2 6/16 abspath.h: move absolute path functions from cache.h
In reply to Elijah Newren via GitGitGadgetFrom: Elijah Newren <[email protected]>
This is another step towards letting us remove the include of cache.h in strbuf.c. It does mean that we also need to add includes of abspath.h in a number of C files.
--- abspath.c | 4 +++- abspath.h | 33 ++++++++++++++++++++++++++++++ apply.c | 1 + archive.c | 1 + builtin/am.c | 1 + builtin/bugreport.c | 1 + builtin/bundle.c | 1 + builtin/clean.c | 1 + builtin/clone.c | 1 + builtin/config.c | 1 + builtin/credential-cache--daemon.c | 1 + builtin/diagnose.c | 1 + builtin/difftool.c | 1 + builtin/fast-import.c | 1 + builtin/fsmonitor--daemon.c | 1 + builtin/gc.c | 1 + builtin/hash-object.c | 1 + builtin/init-db.c | 1 + builtin/log.c | 1 + builtin/mailinfo.c | 1 + builtin/merge-file.c | 1 + builtin/merge.c | 1 + builtin/multi-pack-index.c | 1 + builtin/mv.c | 1 + builtin/rebase.c | 1 + builtin/receive-pack.c | 1 + builtin/rev-parse.c | 1 + builtin/stash.c | 1 + builtin/submodule--helper.c | 1 + builtin/worktree.c | 1 + cache.h | 27 ------------------------ chdir-notify.c | 1 + compat/disk.h | 1 + compat/mingw.c | 1 + compat/simple-ipc/ipc-win32.c | 1 + config.c | 1 + credential.c | 1 + daemon.c | 1 + diff-no-index.c | 1 + diff.c | 1 + dir.c | 1 + editor.c | 1 + environment.c | 1 + exec-cmd.c | 1 + gettext.c | 1 + lockfile.c | 1 + midx.c | 1 + object-file.c | 1 + parse-options.c | 1 + path.c | 1 + pathspec.c | 1 + remote.c | 1 + repository.c | 1 + rerere.c | 1 + scalar.c | 1 + sequencer.c | 1 + setup.c | 1 + strbuf.c | 1 + submodule.c | 1 + t/helper/test-path-utils.c | 1 + tmp-objdir.c | 1 + trace.c | 1 + trace2/tr2_dst.c | 1 + worktree.c | 1 + wrapper.c | 1 + 65 files changed, 98 insertions(+), 28 deletions(-) create mode 100644 abspath.h
abspath.c +3 -1
@@ -1,4 +1,6 @@ -#include "cache.h" +#include "git-compat-util.h" +#include "abspath.h" +#include "strbuf.h" /* * Do not use this for inspecting *tracked* content. When path is a
abspath.h new file +33 -0
@@ -0,0 +1,33 @@ +#ifndef ABSPATH_H +#define ABSPATH_H + +int is_directory (const char *); +char *strbuf_realpath (struct strbuf *resolved,const char *path, +int die_on_error); +char *strbuf_realpath_forgiving (struct strbuf *resolved,const char *path, +int die_on_error); +char *real_pathdup (const char *path,int die_on_error); +const char *absolute_path (const char *path); +char *absolute_pathdup (const char *path); + +/* +* Concatenate "prefix" (if len is non-zero) and "path", with no +* connecting characters (so "prefix" should end with a "/"). +* Unlike prefix_path, this should be used if the named file does +* not have to interact with index entry; i.e. name of a random file +* on the filesystem. +* +* The return value is always a newly allocated string (even if the +* prefix was empty). +*/ +char *prefix_filename (const char *prefix,const char *path); + +/* Likewise, but path=="-" always yields "-" */ +char *prefix_filename_except_for_dash (const char *prefix,const char *path); + +static inline int is_absolute_path (const char *path) +{ +return is_dir_sep (path[0 ]) ||has_dos_drive_prefix (path); +} + +#endif /* ABSPATH_H */
apply.c +1 -0
@@ -8,6 +8,7 @@*/ #include "cache.h" +#include "abspath.h" #include "alloc.h" #include "config.h" #include "object-store.h"
archive.c +1 -0
@@ -1,4 +1,5 @@#include "git-compat-util.h" +#include "abspath.h" #include "alloc.h" #include "config.h" #include "gettext.h"
builtin/am.c +1 -0
@@ -5,6 +5,7 @@*/ #define USE_THE_INDEX_VARIABLE #include "cache.h" +#include "abspath.h" #include "config.h" #include "builtin.h" #include "exec-cmd.h"
builtin/bugreport.c +1 -0
@@ -1,4 +1,5 @@#include "builtin.h" +#include "abspath.h" #include "gettext.h" #include "parse-options.h" #include "strbuf.h"
builtin/bundle.c +1 -0
@@ -1,4 +1,5 @@#include "builtin.h" +#include "abspath.h" #include "gettext.h" #include "strvec.h" #include "parse-options.h"
builtin/clean.c +1 -0
@@ -8,6 +8,7 @@#define USE_THE_INDEX_VARIABLE #include "builtin.h" +#include "abspath.h" #include "cache.h" #include "config.h" #include "dir.h"
builtin/clone.c +1 -0
@@ -10,6 +10,7 @@#define USE_THE_INDEX_VARIABLE #include "builtin.h" +#include "abspath.h" #include "config.h" #include "gettext.h" #include "hex.h"
builtin/config.c +1 -0
@@ -1,4 +1,5 @@#include "builtin.h" +#include "abspath.h" #include "alloc.h" #include "config.h" #include "color.h"
builtin/credential-cache--daemon.c +1 -0
@@ -1,4 +1,5 @@#include "builtin.h" +#include "abspath.h" #include "alloc.h" #include "gettext.h" #include "parse-options.h"
builtin/diagnose.c +1 -0
@@ -1,4 +1,5 @@#include "builtin.h" +#include "abspath.h" #include "gettext.h" #include "parse-options.h" #include "diagnose.h"
builtin/difftool.c +1 -0
@@ -13,6 +13,7 @@*/ #define USE_THE_INDEX_VARIABLE #include "cache.h" +#include "abspath.h" #include "config.h" #include "builtin.h" #include "run-command.h"
builtin/fast-import.c +1 -0
@@ -1,4 +1,5 @@#include "builtin.h" +#include "abspath.h" #include "cache.h" #include "gettext.h" #include "hex.h"
builtin/fsmonitor--daemon.c +1 -0
@@ -1,4 +1,5 @@#include "builtin.h" +#include "abspath.h" #include "alloc.h" #include "config.h" #include "gettext.h"
builtin/gc.c +1 -0
@@ -11,6 +11,7 @@*/ #include "builtin.h" +#include "abspath.h" #include "hex.h" #include "repository.h" #include "config.h"
builtin/hash-object.c +1 -0
@@ -5,6 +5,7 @@* Copyright (C) Junio C Hamano, 2005 */ #include "builtin.h" +#include "abspath.h" #include "config.h" #include "gettext.h" #include "hex.h"
builtin/init-db.c +1 -0
@@ -4,6 +4,7 @@* Copyright (C) Linus Torvalds, 2005 */ #include "cache.h" +#include "abspath.h" #include "config.h" #include "gettext.h" #include "refs.h"
builtin/log.c +1 -0
@@ -5,6 +5,7 @@* 2006 Junio Hamano */ #include "git-compat-util.h" +#include "abspath.h" #include "alloc.h" #include "config.h" #include "gettext.h"
builtin/mailinfo.c +1 -0
@@ -3,6 +3,7 @@* email to figure out authorship and subject */ #include "cache.h" +#include "abspath.h" #include "builtin.h" #include "gettext.h" #include "utf8.h"
builtin/merge-file.c +1 -0
@@ -1,4 +1,5 @@#include "builtin.h" +#include "abspath.h" #include "cache.h" #include "config.h" #include "gettext.h"
builtin/merge.c +1 -0
@@ -8,6 +8,7 @@#define USE_THE_INDEX_VARIABLE #include "cache.h" +#include "abspath.h" #include "alloc.h" #include "config.h" #include "environment.h"
builtin/multi-pack-index.c +1 -0
@@ -1,4 +1,5 @@#include "builtin.h" +#include "abspath.h" #include "cache.h" #include "config.h" #include "gettext.h"
builtin/mv.c +1 -0
@@ -5,6 +5,7 @@*/ #define USE_THE_INDEX_VARIABLE #include "builtin.h" +#include "abspath.h" #include "alloc.h" #include "config.h" #include "gettext.h"
builtin/rebase.c +1 -0
@@ -6,6 +6,7 @@#define USE_THE_INDEX_VARIABLE #include "builtin.h" +#include "abspath.h" #include "gettext.h" #include "hex.h" #include "run-command.h"
builtin/receive-pack.c +1 -0
@@ -1,4 +1,5 @@#include "builtin.h" +#include "abspath.h" #include "repository.h" #include "config.h" #include "gettext.h"
builtin/rev-parse.c +1 -0
@@ -5,6 +5,7 @@*/ #define USE_THE_INDEX_VARIABLE #include "cache.h" +#include "abspath.h" #include "alloc.h" #include "config.h" #include "commit.h"
builtin/stash.c +1 -0
@@ -1,5 +1,6 @@#define USE_THE_INDEX_VARIABLE #include "builtin.h" +#include "abspath.h" #include "config.h" #include "gettext.h" #include "hex.h"
builtin/submodule--helper.c +1 -0
@@ -1,5 +1,6 @@#define USE_THE_INDEX_VARIABLE #include "builtin.h" +#include "abspath.h" #include "alloc.h" #include "gettext.h" #include "hex.h"
builtin/worktree.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "abspath.h" #include "checkout.h" #include "config.h" #include "builtin.h"
cache.h +0 -27
@@ -598,21 +598,6 @@ const char *setup_git_directory(void);char *prefix_path (const char *prefix,int len,const char *path);char *prefix_path_gently (const char *prefix,int len,int *remaining,const char *path); -/* -* Concatenate "prefix" (if len is non-zero) and "path", with no -* connecting characters (so "prefix" should end with a "/"). -* Unlike prefix_path, this should be used if the named file does -* not have to interact with index entry; i.e. name of a random file -* on the filesystem. -* -* The return value is always a newly allocated string (even if the -* prefix was empty). -*/ -char *prefix_filename (const char *prefix,const char *path); - -/* Likewise, but path=="-" always yields "-" */ -char *prefix_filename_except_for_dash (const char *prefix,const char *path); -int check_filename (const char *prefix,const char *name); void verify_filename(const char *prefix, const char *name,
@@ -1160,18 +1145,6 @@ char *interpolate_path(const char *path, int real_home);/* NEEDSWORK: remove this synonym once in-flight topics have migrated */ #define expand_user_path interpolate_pathconst char *enter_repo (const char *path,int strict); -static inline int is_absolute_path (const char *path) -{ -return is_dir_sep (path[0 ]) ||has_dos_drive_prefix (path); -} -int is_directory (const char *); -char *strbuf_realpath (struct strbuf *resolved,const char *path, -int die_on_error); -char *strbuf_realpath_forgiving (struct strbuf *resolved,const char *path, -int die_on_error); -char *real_pathdup (const char *path,int die_on_error); -const char *absolute_path (const char *path); -char *absolute_pathdup (const char *path);const char *remove_leading_path (const char *in,const char *prefix);const char *relative_path (const char *in,const char *prefix,struct strbuf *sb);int normalize_path_copy_len (char *dst,const char *src,int *prefix_len);
chdir-notify.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "abspath.h" #include "chdir-notify.h" #include "list.h" #include "strbuf.h"
compat/disk.h +1 -0
@@ -2,6 +2,7 @@#define COMPAT_DISK_H #include "git-compat-util.h" +#include "abspath.h" #include "gettext.h" static int get_disk_info (struct strbuf *out)
compat/mingw.c +1 -0
@@ -7,6 +7,7 @@#include "../strbuf.h" #include "../run-command.h" #include "../cache.h" +#include "../abspath.h" #include "../alloc.h" #include "win32/lazyload.h" #include "../config.h"
compat/simple-ipc/ipc-win32.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "abspath.h" #include "gettext.h" #include "simple-ipc.h" #include "strbuf.h"
config.c +1 -0
@@ -6,6 +6,7 @@* */ #include "cache.h" +#include "abspath.h" #include "alloc.h" #include "date.h" #include "branch.h"
credential.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "abspath.h" #include "config.h" #include "credential.h" #include "gettext.h"
daemon.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "abspath.h" #include "alloc.h" #include "config.h" #include "pkt-line.h"
diff-no-index.c +1 -0
@@ -5,6 +5,7 @@*/ #include "cache.h" +#include "abspath.h" #include "color.h" #include "commit.h" #include "blob.h"
diff.c +1 -0
@@ -2,6 +2,7 @@* Copyright (C) 2005 Junio C Hamano */ #include "cache.h" +#include "abspath.h" #include "alloc.h" #include "config.h" #include "gettext.h"
dir.c +1 -0
@@ -6,6 +6,7 @@* Junio Hamano, 2005-2006 */ #include "git-compat-util.h" +#include "abspath.h" #include "alloc.h" #include "config.h" #include "dir.h"
editor.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "abspath.h" #include "config.h" #include "gettext.h" #include "strbuf.h"
environment.c +1 -0
@@ -8,6 +8,7 @@* are. */ #include "cache.h" +#include "abspath.h" #include "branch.h" #include "environment.h" #include "gettext.h"
exec-cmd.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "abspath.h" #include "exec-cmd.h" #include "gettext.h" #include "quote.h"
gettext.c +1 -0
@@ -3,6 +3,7 @@*/ #include "cache.h" +#include "abspath.h" #include "exec-cmd.h" #include "gettext.h" #include "strbuf.h"
lockfile.c +1 -0
@@ -3,6 +3,7 @@*/ #include "cache.h" +#include "abspath.h" #include "gettext.h" #include "lockfile.h"
midx.c +1 -0
@@ -1,4 +1,5 @@#include "git-compat-util.h" +#include "abspath.h" #include "alloc.h" #include "config.h" #include "csum-file.h"
object-file.c +1 -0
@@ -7,6 +7,7 @@* creation etc. */ #include "git-compat-util.h" +#include "abspath.h" #include "alloc.h" #include "config.h" #include "gettext.h"
parse-options.c +1 -0
@@ -1,5 +1,6 @@#include "git-compat-util.h" #include "parse-options.h" +#include "abspath.h" #include "cache.h" #include "config.h" #include "commit.h"
path.c +1 -0
@@ -2,6 +2,7 @@* Utilities for paths and pathnames */ #include "cache.h" +#include "abspath.h" #include "gettext.h" #include "hex.h" #include "repository.h"
pathspec.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "abspath.h" #include "config.h" #include "dir.h" #include "gettext.h"
remote.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "abspath.h" #include "alloc.h" #include "config.h" #include "gettext.h"
repository.c +1 -0
@@ -4,6 +4,7 @@*/ #define USE_THE_INDEX_VARIABLE #include "cache.h" +#include "abspath.h" #include "repository.h" #include "object-store.h" #include "config.h"
rerere.c +1 -0
@@ -1,4 +1,5 @@#include "git-compat-util.h" +#include "abspath.h" #include "alloc.h" #include "config.h" #include "gettext.h"
scalar.c +1 -0
@@ -3,6 +3,7 @@*/ #include "cache.h" +#include "abspath.h" #include "gettext.h" #include "parse-options.h" #include "config.h"
sequencer.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "abspath.h" #include "alloc.h" #include "config.h" #include "environment.h"
setup.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "abspath.h" #include "gettext.h" #include "repository.h" #include "config.h"
strbuf.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "abspath.h" #include "alloc.h" #include "environment.h" #include "gettext.h"
submodule.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "abspath.h" #include "alloc.h" #include "repository.h" #include "config.h"
t/helper/test-path-utils.c +1 -0
@@ -1,5 +1,6 @@#include "test-tool.h" #include "cache.h" +#include "abspath.h" #include "string-list.h" #include "utf8.h"
tmp-objdir.c +1 -0
@@ -1,5 +1,6 @@#include "cache.h" #include "tmp-objdir.h" +#include "abspath.h" #include "chdir-notify.h" #include "dir.h" #include "sigchain.h"
trace.c +1 -0
@@ -22,6 +22,7 @@*/ #include "cache.h" +#include "abspath.h" #include "quote.h" struct trace_key trace_default_key = {"GIT_TRACE" ,0 ,0 ,0 };
trace2/tr2_dst.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "abspath.h" #include "sigchain.h" #include "trace2/tr2_dst.h" #include "trace2/tr2_sid.h"
worktree.c +1 -0
@@ -1,4 +1,5 @@#include "cache.h" +#include "abspath.h" #include "alloc.h" #include "gettext.h" #include "repository.h"
wrapper.c +1 -0
@@ -2,6 +2,7 @@* Various trivial helper wrappers around standard functions */ #include "cache.h" +#include "abspath.h" #include "config.h" #include "gettext.h"
Signature · 1 line
gitgitgadget