Skip to content

Commit

Permalink
treewide: be explicit about dependence on gettext.h
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
newren authored and gitster committed Mar 21, 2023
1 parent a6dc3d3 commit f394e09
Show file tree
Hide file tree
Showing 235 changed files with 236 additions and 1 deletion.
1 change: 1 addition & 0 deletions add-interactive.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions add-patch.c
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
1 change: 1 addition & 0 deletions apply.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions archive-tar.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions archive-zip.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions archive.c
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
1 change: 1 addition & 0 deletions attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions bisect.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions blame.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions branch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/add.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/am.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/apply.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "cache.h"
#include "builtin.h"
#include "gettext.h"
#include "parse-options.h"
#include "apply.h"

Expand Down
1 change: 1 addition & 0 deletions builtin/archive.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/bisect.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "builtin.h"
#include "cache.h"
#include "gettext.h"
#include "hex.h"
#include "parse-options.h"
#include "bisect.h"
Expand Down
1 change: 1 addition & 0 deletions builtin/blame.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/branch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/bugreport.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "builtin.h"
#include "gettext.h"
#include "parse-options.h"
#include "strbuf.h"
#include "help.h"
Expand Down
1 change: 1 addition & 0 deletions builtin/bundle.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "builtin.h"
#include "gettext.h"
#include "strvec.h"
#include "parse-options.h"
#include "cache.h"
Expand Down
1 change: 1 addition & 0 deletions builtin/cat-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/check-attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "cache.h"
#include "config.h"
#include "attr.h"
#include "gettext.h"
#include "quote.h"
#include "parse-options.h"

Expand Down
1 change: 1 addition & 0 deletions builtin/check-ignore.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/check-mailmap.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "builtin.h"
#include "config.h"
#include "gettext.h"
#include "ident.h"
#include "mailmap.h"
#include "parse-options.h"
Expand Down
1 change: 1 addition & 0 deletions builtin/checkout--worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/checkout-index.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/checkout.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/clean.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/clone.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/column.c
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/commit-graph.c
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/commit-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/
#include "cache.h"
#include "config.h"
#include "gettext.h"
#include "hex.h"
#include "object-store.h"
#include "repository.h"
Expand Down
1 change: 1 addition & 0 deletions builtin/commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/count-objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/credential-cache--daemon.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "builtin.h"
#include "alloc.h"
#include "gettext.h"
#include "parse-options.h"

#ifndef NO_UNIX_SOCKETS
Expand Down
1 change: 1 addition & 0 deletions builtin/credential-cache.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "builtin.h"
#include "gettext.h"
#include "parse-options.h"

#ifndef NO_UNIX_SOCKETS
Expand Down
1 change: 1 addition & 0 deletions builtin/credential-store.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "builtin.h"
#include "config.h"
#include "gettext.h"
#include "lockfile.h"
#include "credential.h"
#include "string-list.h"
Expand Down
1 change: 1 addition & 0 deletions builtin/describe.c
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/diagnose.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "builtin.h"
#include "gettext.h"
#include "parse-options.h"
#include "diagnose.h"

Expand Down
1 change: 1 addition & 0 deletions builtin/diff-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/difftool.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/fast-export.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/fast-import.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "builtin.h"
#include "cache.h"
#include "gettext.h"
#include "hex.h"
#include "repository.h"
#include "config.h"
Expand Down
1 change: 1 addition & 0 deletions builtin/fetch-pack.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "builtin.h"
#include "alloc.h"
#include "gettext.h"
#include "hex.h"
#include "pkt-line.h"
#include "fetch-pack.h"
Expand Down
1 change: 1 addition & 0 deletions builtin/fetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/
#include "cache.h"
#include "config.h"
#include "gettext.h"
#include "hex.h"
#include "repository.h"
#include "refs.h"
Expand Down
1 change: 1 addition & 0 deletions builtin/fmt-merge-msg.c
Original file line number Diff line number Diff line change
@@ -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[] = {
Expand Down
1 change: 1 addition & 0 deletions builtin/for-each-ref.c
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/for-each-repo.c
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/fsck.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "builtin.h"
#include "cache.h"
#include "gettext.h"
#include "hex.h"
#include "repository.h"
#include "config.h"
Expand Down
1 change: 1 addition & 0 deletions builtin/fsmonitor--daemon.c
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading

0 comments on commit f394e09

Please sign in to comment.