@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "add-interactive.h"
#include "color.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "add-interactive.h"
#include "advice.h"
@@ -7,6 +7,8 @@
*
*/
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "abspath.h"
#include "base85.h"
@@ -1,6 +1,9 @@
/*
* Copyright (c) 2005, 2006 Rene Scharfe
*/
+
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "config.h"
#include "gettext.h"
@@ -1,6 +1,9 @@
/*
* Copyright (c) 2006 Rene Scharfe
*/
+
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "config.h"
#include "archive.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "abspath.h"
#include "config.h"
@@ -6,6 +6,8 @@
* an insanely large number of attributes.
*/
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "config.h"
#include "environment.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "config.h"
#include "commit.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "refs.h"
#include "object-store-ll.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "advice.h"
#include "config.h"
@@ -1,6 +1,14 @@
#ifndef BUILTIN_H
#define BUILTIN_H
+/*
+ * TODO: Almost all of our builtins access `the_repository` by necessity
+ * because they do not get passed a pointer to it. We should adapt the function
+ * signature of those main functions to accept a `struct repository *` and then
+ * remove the macro here.
+ */
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
/*
@@ -5,7 +5,7 @@
* See COPYING for licensing conditions
*/
-#include "git-compat-util.h"
+#include "builtin.h"
#include "config.h"
#include "color.h"
#include "builtin.h"
@@ -4,7 +4,7 @@
* (C) Copyright 2006 Linus Torvalds
* 2006 Junio Hamano
*/
-#include "git-compat-util.h"
+#include "builtin.h"
#include "abspath.h"
#include "config.h"
#include "environment.h"
@@ -1,6 +1,9 @@
/*
* Copyright (c) 2011, Google Inc.
*/
+
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "bulk-checkin.h"
#include "environment.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "bundle-uri.h"
#include "bundle.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "lockfile.h"
#include "bundle.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "environment.h"
#include "hex.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "object-name.h"
#include "remote.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "chunk-format.h"
#include "csum-file.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "object-store-ll.h"
#include "commit.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "config.h"
#include "csum-file.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "commit.h"
#include "commit-graph.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "tag.h"
#include "commit.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "exec-cmd.h"
#include "gettext.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "../../git-compat-util.h"
#include "../../json-writer.h"
#include "../../repository.h"
@@ -5,6 +5,9 @@
* Copyright (C) Johannes Schindelin, 2005
*
*/
+
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "abspath.h"
#include "advice.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "gettext.h"
#include "hex.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "advice.h"
#include "config.h"
@@ -7,6 +7,9 @@
* files. Useful when you write a file that you want to be
* able to verify hasn't been messed with afterwards.
*/
+
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "progress.h"
#include "csum-file.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "object.h"
#include "commit.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "diagnose.h"
#include "compat/disk.h"
@@ -1,6 +1,9 @@
/*
* Copyright (C) 2005 Junio C Hamano
*/
+
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "commit.h"
#include "diff.h"
@@ -1,6 +1,9 @@
/*
* Copyright (C) 2005 Junio C Hamano
*/
+
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "abspath.h"
#include "base85.h"
@@ -1,6 +1,9 @@
/*
* Copyright (C) 2005 Junio C Hamano
*/
+
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "diffcore.h"
#include "hash.h"
@@ -2,6 +2,9 @@
*
* Copyright (C) 2005 Junio C Hamano
*/
+
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "diff.h"
#include "diffcore.h"
@@ -5,6 +5,9 @@
* Copyright (C) Linus Torvalds, 2005-2006
* Junio Hamano, 2005-2006
*/
+
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "abspath.h"
#include "config.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "object-store-ll.h"
#include "dir.h"
@@ -7,6 +7,9 @@
* even if you might want to know where the git directory etc
* are.
*/
+
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "abspath.h"
#include "branch.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "repository.h"
#include "config.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "config.h"
#include "environment.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "date.h"
#include "dir.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "gettext.h"
#include "simple-ipc.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "builtin.h"
#include "config.h"
#include "environment.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "hash.h"
#include "hash-lookup.h"
@@ -4,6 +4,8 @@
#include "hash-ll.h"
#include "repository.h"
-#define the_hash_algo the_repository->hash_algo
+#ifdef USE_THE_REPOSITORY_VARIABLE
+# define the_hash_algo the_repository->hash_algo
+#endif
#endif
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "config.h"
#include "builtin.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "hash.h"
#include "hex.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "config.h"
#include "environment.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "environment.h"
#include "hex.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "repository.h"
#include "hex.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "git-curl-compat.h"
#include "hex.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "config.h"
#include "gettext.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "dir.h"
#include "gettext.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "tag.h"
#include "commit.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "commit-reach.h"
#include "config.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "hash.h"
#include "path.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "environment.h"
#include "gettext.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "environment.h"
#include "string-list.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "hex.h"
#include "match-trees.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "merge-ll.h"
#include "blob.h"
@@ -14,6 +14,8 @@
* "cale", "peedy", or "ins" instead of "ort"?)
*/
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "merge-ort.h"
@@ -3,6 +3,9 @@
* Fredrik Kuivinen.
* The thieves were Alex Riesen and Johannes Schindelin, in June/July 2006
*/
+
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "merge-recursive.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "gettext.h"
#include "hash.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "abspath.h"
#include "config.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "config.h"
#include "dir.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "default.h"
#include "../commit.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "skipping.h"
#include "../commit.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "notes-cache.h"
#include "object-store-ll.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "advice.h"
#include "commit.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "config.h"
#include "commit.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "config.h"
#include "environment.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "gettext.h"
#include "strbuf.h"
@@ -6,6 +6,9 @@
* This handles basic git object files - packing, unpacking,
* creation etc.
*/
+
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "abspath.h"
#include "config.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "object-name.h"
#include "advice.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "gettext.h"
#include "hex.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "oid-array.h"
#include "hash-lookup.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "commit-graph.h"
#include "repository.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "environment.h"
#include "gettext.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "commit.h"
#include "gettext.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "environment.h"
#include "hex.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "gettext.h"
#include "pack-revindex.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "environment.h"
#include "gettext.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "environment.h"
#include "gettext.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "parse-options.h"
#include "branch.h"
@@ -1,6 +1,9 @@
/*
* Utilities for paths and pathnames
*/
+
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "abspath.h"
#include "environment.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "abspath.h"
#include "parse.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "config.h"
#include "commit.h"
@@ -9,6 +9,8 @@
*/
#define GIT_TEST_PROGRESS_ONLY
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "pager.h"
#include "progress.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "gettext.h"
#include "hex.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "environment.h"
#include "gettext.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "gettext.h"
#include "hex.h"
@@ -3,6 +3,9 @@
*
* Copyright (C) Linus Torvalds, 2005
*/
+
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "bulk-checkin.h"
#include "config.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "commit.h"
#include "editor.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "environment.h"
#include "gettext.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "commit.h"
#include "refs.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "gettext.h"
#include "object-store-ll.h"
@@ -2,6 +2,8 @@
* The backend-independent part of the reference module.
*/
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "advice.h"
#include "config.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "../git-compat-util.h"
#include "../copy.h"
#include "../environment.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "../git-compat-util.h"
#include "../config.h"
#include "../dir.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "../git-compat-util.h"
#include "../abspath.h"
#include "../chdir-notify.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "gettext.h"
#include "hash.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "git-curl-compat.h"
#include "config.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "abspath.h"
#include "config.h"
@@ -197,7 +197,9 @@ struct repository {
unsigned different_commondir:1;
};
+#ifdef USE_THE_REPOSITORY_VARIABLE
extern struct repository *the_repository;
+#endif
/*
* Define a custom repository layout. Any field can be NULL, which
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "abspath.h"
#include "config.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "cache-tree.h"
#include "gettext.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "dir.h"
#include "hash.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "config.h"
#include "environment.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "run-command.h"
#include "environment.h"
@@ -2,6 +2,8 @@
* The Scalar command-line interface.
*/
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "abspath.h"
#include "gettext.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "config.h"
#include "commit.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "abspath.h"
#include "advice.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "repository.h"
#include "config.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "dir.h"
#include "environment.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "abspath.h"
#include "copy.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "hex.h"
#include "repository.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "gettext.h"
#include "hash.h"
@@ -1,6 +1,9 @@
/*
* Copyright (c) 2011, Google Inc.
*/
+
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "convert.h"
#include "environment.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "dir.h"
#include "environment.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "abspath.h"
#include "repository.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "test-tool.h"
#include "git-compat-util.h"
#include "pack-bitmap.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "test-tool.h"
#include "bloom.h"
#include "hex.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "test-tool.h"
#include "gettext.h"
#include "hex.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "test-tool.h"
#include "hash.h"
#include "hex.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "test-tool.h"
#include "read-cache-ll.h"
#include "repository.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "test-tool.h"
#include "hex.h"
#include "read-cache-ll.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "test-tool.h"
#include "dir.h"
#include "hex.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "test-tool.h"
#include "git-compat-util.h"
#include "object.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "test-tool.h"
#include "object-name.h"
#include "object-store.h"
@@ -3,6 +3,8 @@
* a `git fsmonitor--daemon` daemon.
*/
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "test-tool.h"
#include "parse-options.h"
#include "fsmonitor-ipc.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "test-tool.h"
#include "environment.h"
#include "name-hash.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "test-tool.h"
#include "hex.h"
#include "match-trees.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "test-tool.h"
#include "hex.h"
#include "object-name.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "test-tool.h"
#include "hex.h"
#include "strbuf.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "test-tool.h"
#include "commit.h"
#include "commit-reach.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "test-tool.h"
#include "config.h"
#include "read-cache-ll.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "test-tool.h"
#include "commit-graph.h"
#include "repository.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "test-tool.h"
#include "hex.h"
#include "midx.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "test-tool.h"
#include "hex.h"
#include "refs.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "test-tool.h"
#include "commit-graph.h"
#include "commit.h"
@@ -8,6 +8,8 @@
* published by the Free Software Foundation.
*/
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "test-tool.h"
#include "commit.h"
#include "diff.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "test-tool.h"
#include "lockfile.h"
#include "read-cache-ll.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "test-tool.h"
#include "config.h"
#include "hash.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "test-tool.h"
#include "repository.h"
#include "setup.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "test-tool.h"
#include "test-tool-utils.h"
#include "parse-options.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "test-tool.h"
#include "strvec.h"
#include "run-command.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "test-tool.h"
#include "lockfile.h"
#include "read-cache-ll.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "environment.h"
#include "tag.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "tmp-objdir.h"
#include "abspath.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "transport.h"
#include "quote.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "advice.h"
#include "config.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "tree-walk.h"
#include "dir.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "hex.h"
#include "tree.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "advice.h"
#include "strvec.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "config.h"
#include "environment.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "gettext.h"
#include "hex.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "abspath.h"
#include "environment.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "advice.h"
#include "wt-status.h"
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "gettext.h"
#include "config.h"
Use of the `the_repository` variable is deprecated nowadays, and we slowly but steadily convert the codebase to not use it anymore. Instead, callers should be passing down the repository to work on via parameters. It is hard though to prove that a given code unit does not use this variable anymore. The most trivial case, merely demonstrating that there is no direct use of `the_repository`, is already a bit of a pain during code reviews as the reviewer needs to manually verify claims made by the patch author. The bigger problem though is that we have many interfaces that implicitly rely on `the_repository`. Introduce a new `USE_THE_REPOSITORY_VARIABLE` macro that allows code units to opt into usage of `the_repository`. The intent of this macro is to demonstrate that a certain code unit does not use this variable anymore, and to keep it from new dependencies on it in future changes, be it explicit or implicit For now, the macro only guards `the_repository` itself as well as `the_hash_algo`. There are many more known interfaces where we have an implicit dependency on `the_repository`, but those are not guarded at the current point in time. Over time though, we should start to add guards as required (or even better, just remove them). Define the macro as required in our code units. As expected, most of our code still relies on the global variable. Nearly all of our builtins rely on the variable as there is no way yet to pass `the_repository` to their entry point. For now, declare the macro in "biultin.h" to keep the required changes at least a little bit more contained. Signed-off-by: Patrick Steinhardt <ps@pks.im> --- add-interactive.c | 2 ++ add-patch.c | 2 ++ apply.c | 2 ++ archive-tar.c | 3 +++ archive-zip.c | 3 +++ archive.c | 2 ++ attr.c | 2 ++ bisect.c | 2 ++ blame.c | 2 ++ branch.c | 2 ++ builtin.h | 8 ++++++++ builtin/blame.c | 2 +- builtin/log.c | 2 +- bulk-checkin.c | 3 +++ bundle-uri.c | 2 ++ bundle.c | 2 ++ cache-tree.c | 2 ++ checkout.c | 2 ++ chunk-format.c | 2 ++ combine-diff.c | 2 ++ commit-graph.c | 2 ++ commit-reach.c | 2 ++ commit.c | 2 ++ common-main.c | 2 ++ compat/win32/trace2_win32_process_info.c | 2 ++ config.c | 3 +++ connected.c | 2 ++ convert.c | 2 ++ csum-file.c | 3 +++ delta-islands.c | 2 ++ diagnose.c | 2 ++ diff-lib.c | 3 +++ diff.c | 3 +++ diffcore-break.c | 3 +++ diffcore-rename.c | 3 +++ dir.c | 3 +++ entry.c | 2 ++ environment.c | 3 +++ fetch-pack.c | 2 ++ fmt-merge-msg.c | 2 ++ fsck.c | 2 ++ fsmonitor-ipc.c | 2 ++ git.c | 2 ++ hash-lookup.c | 2 ++ hash.h | 4 +++- help.c | 2 ++ hex.c | 2 ++ http-backend.c | 2 ++ http-push.c | 2 ++ http-walker.c | 2 ++ http.c | 2 ++ list-objects-filter-options.c | 2 ++ list-objects-filter.c | 2 ++ list-objects.c | 2 ++ log-tree.c | 2 ++ loose.c | 2 ++ ls-refs.c | 2 ++ mailmap.c | 2 ++ match-trees.c | 2 ++ merge-blobs.c | 2 ++ merge-ort.c | 2 ++ merge-recursive.c | 3 +++ merge.c | 2 ++ midx-write.c | 2 ++ midx.c | 2 ++ negotiator/default.c | 2 ++ negotiator/skipping.c | 2 ++ notes-cache.c | 2 ++ notes-merge.c | 2 ++ notes-utils.c | 2 ++ notes.c | 2 ++ object-file-convert.c | 2 ++ object-file.c | 3 +++ object-name.c | 2 ++ object.c | 2 ++ oid-array.c | 2 ++ oss-fuzz/fuzz-commit-graph.c | 2 ++ pack-bitmap-write.c | 2 ++ pack-bitmap.c | 2 ++ pack-check.c | 2 ++ pack-revindex.c | 2 ++ pack-write.c | 2 ++ packfile.c | 2 ++ parse-options-cb.c | 2 ++ path.c | 3 +++ pathspec.c | 2 ++ pretty.c | 2 ++ progress.c | 2 ++ promisor-remote.c | 2 ++ range-diff.c | 2 ++ reachable.c | 2 ++ read-cache.c | 3 +++ rebase-interactive.c | 2 ++ ref-filter.c | 2 ++ reflog-walk.c | 2 ++ reflog.c | 2 ++ refs.c | 2 ++ refs/files-backend.c | 2 ++ refs/packed-backend.c | 2 ++ refs/reftable-backend.c | 2 ++ refspec.c | 2 ++ remote-curl.c | 2 ++ remote.c | 2 ++ repository.h | 2 ++ rerere.c | 2 ++ reset.c | 2 ++ resolve-undo.c | 2 ++ revision.c | 2 ++ run-command.c | 2 ++ scalar.c | 2 ++ send-pack.c | 2 ++ sequencer.c | 2 ++ serve.c | 2 ++ server-info.c | 2 ++ setup.c | 2 ++ shallow.c | 2 ++ split-index.c | 2 ++ streaming.c | 3 +++ submodule-config.c | 2 ++ submodule.c | 2 ++ t/helper/test-bitmap.c | 2 ++ t/helper/test-bloom.c | 2 ++ t/helper/test-cache-tree.c | 2 ++ t/helper/test-dump-cache-tree.c | 2 ++ t/helper/test-dump-fsmonitor.c | 2 ++ t/helper/test-dump-split-index.c | 2 ++ t/helper/test-dump-untracked-cache.c | 2 ++ t/helper/test-example-decorate.c | 2 ++ t/helper/test-find-pack.c | 2 ++ t/helper/test-fsmonitor-client.c | 2 ++ t/helper/test-lazy-init-name-hash.c | 2 ++ t/helper/test-match-trees.c | 2 ++ t/helper/test-oidmap.c | 2 ++ t/helper/test-pack-mtimes.c | 2 ++ t/helper/test-reach.c | 2 ++ t/helper/test-read-cache.c | 2 ++ t/helper/test-read-graph.c | 2 ++ t/helper/test-read-midx.c | 2 ++ t/helper/test-ref-store.c | 2 ++ t/helper/test-repository.c | 2 ++ t/helper/test-revision-walking.c | 2 ++ t/helper/test-scrap-cache-tree.c | 2 ++ t/helper/test-submodule-config.c | 2 ++ t/helper/test-submodule-nested-repo-config.c | 2 ++ t/helper/test-submodule.c | 2 ++ t/helper/test-trace2.c | 2 ++ t/helper/test-write-cache.c | 2 ++ tag.c | 2 ++ tmp-objdir.c | 2 ++ transport-helper.c | 2 ++ transport.c | 2 ++ tree-walk.c | 2 ++ tree.c | 2 ++ unpack-trees.c | 2 ++ upload-pack.c | 2 ++ walker.c | 2 ++ worktree.c | 2 ++ wt-status.c | 2 ++ xdiff-interface.c | 2 ++ 159 files changed, 339 insertions(+), 3 deletions(-)