]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'en/header-split-cache-h-part-3'
authorJunio C Hamano <gitster@pobox.com>
Thu, 29 Jun 2023 23:43:20 +0000 (16:43 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 29 Jun 2023 23:43:21 +0000 (16:43 -0700)
Header files cleanup.

* en/header-split-cache-h-part-3: (28 commits)
  fsmonitor-ll.h: split this header out of fsmonitor.h
  hash-ll, hashmap: move oidhash() to hash-ll
  object-store-ll.h: split this header out of object-store.h
  khash: name the structs that khash declares
  merge-ll: rename from ll-merge
  git-compat-util.h: remove unneccessary include of wildmatch.h
  builtin.h: remove unneccessary includes
  list-objects-filter-options.h: remove unneccessary include
  diff.h: remove unnecessary include of oidset.h
  repository: remove unnecessary include of path.h
  log-tree: replace include of revision.h with simple forward declaration
  cache.h: remove this no-longer-used header
  read-cache*.h: move declarations for read-cache.c functions from cache.h
  repository.h: move declaration of the_index from cache.h
  merge.h: move declarations for merge.c from cache.h
  diff.h: move declaration for global in diff.c from cache.h
  preload-index.h: move declarations for preload-index.c from elsewhere
  sparse-index.h: move declarations for sparse-index.c from cache.h
  name-hash.h: move declarations for name-hash.c from cache.h
  run-command.h: move declarations for run-command.c from cache.h
  ...

39 files changed:
1  2 
Documentation/CodingGuidelines
branch.c
builtin/add.c
builtin/branch.c
builtin/cat-file.c
builtin/commit-graph.c
builtin/commit.c
builtin/diff-index.c
builtin/fsck.c
builtin/index-pack.c
builtin/pack-objects.c
builtin/prune.c
builtin/repack.c
builtin/replace.c
builtin/rev-parse.c
builtin/unpack-objects.c
builtin/upload-pack.c
builtin/worktree.c
commit-graph.c
config.c
diff-lib.c
dir.h
environment.c
git.c
http.c
log-tree.c
object.c
pack-bitmap.c
packfile.c
reachable.c
remote.c
replace-object.c
replace-object.h
repository.h
run-command.c
setup.c
statinfo.h
strbuf.c
strbuf.h

Simple merge
diff --cc branch.c
Simple merge
diff --cc builtin/add.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index b9a19bb7d38074a907369c74b9cd72c98ac208c7,a8b2c0a4b969b1a22bccfb63182d22dd5093ac84..9db7139b839e46d10cf553fbb3d4a3a8e567735b
@@@ -3,9 -3,10 +3,11 @@@
  #include "diff.h"
  #include "diff-merges.h"
  #include "commit.h"
+ #include "preload-index.h"
+ #include "repository.h"
  #include "revision.h"
- #include "builtin.h"
  #include "setup.h"
++#include "sparse-index.h"
  #include "submodule.h"
  
  static const char diff_cache_usage[] =
diff --cc builtin/fsck.c
Simple merge
Simple merge
Simple merge
diff --cc builtin/prune.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 5a9cf076ad2b52c9163bf356b4557f54285e764d,1a25980eb5127e1ad2ea3098d1fc23c76a173c7c..05dec7e33078d61b83e1dbb28a91058b1bc5219e
@@@ -1,6 -1,5 +1,6 @@@
- #include "cache.h"
+ #include "builtin.h"
  #include "abspath.h"
 +#include "advice.h"
  #include "checkout.h"
  #include "config.h"
  #include "copy.h"
  #include "object-file.h"
  #include "object-name.h"
  #include "parse-options.h"
+ #include "path.h"
  #include "strvec.h"
  #include "branch.h"
+ #include "read-cache-ll.h"
  #include "refs.h"
 +#include "remote.h"
  #include "repository.h"
  #include "run-command.h"
  #include "hook.h"
diff --cc commit-graph.c
Simple merge
diff --cc config.c
Simple merge
diff --cc diff-lib.c
Simple merge
diff --cc dir.h
Simple merge
diff --cc environment.c
Simple merge
diff --cc git.c
Simple merge
diff --cc http.c
Simple merge
diff --cc log-tree.c
Simple merge
diff --cc object.c
Simple merge
diff --cc pack-bitmap.c
Simple merge
diff --cc packfile.c
Simple merge
diff --cc reachable.c
index 60a7336b873747734fa02c2d08f314ee0de18922,434f09e9ebf115f5b2bb5d71f49407744bcb1a78..0ce8f83e56a9b42400b8ec792b19deb3a69ddb6e
  #include "list-objects.h"
  #include "packfile.h"
  #include "worktree.h"
- #include "object-store.h"
+ #include "object-store-ll.h"
  #include "pack-bitmap.h"
  #include "pack-mtimes.h"
 +#include "config.h"
 +#include "run-command.h"
  
  struct connectivity_progress {
        struct progress *progress;
diff --cc remote.c
Simple merge
Simple merge
index ba478eb30c47a639c679ba0cfd3d42a3932b0a1c,a964db1670e9c6011a3f8f243e19bbed68739788..66c41b938b44f4ba0a94521c4344aca0ca19087e
@@@ -3,8 -3,16 +3,8 @@@
  
  #include "oidmap.h"
  #include "repository.h"
- #include "object-store.h"
+ #include "object-store-ll.h"
  
 -/*
 - * Do replace refs need to be checked this run?  This variable is
 - * initialized to true unless --no-replace-object is used or
 - * $GIT_NO_REPLACE_OBJECTS is set, but is set to false by some
 - * commands that do not want replace references to be active.
 - */
 -extern int read_replace_refs;
 -
  struct replace_object {
        struct oidmap_entry original;
        struct object_id replacement;
diff --cc repository.h
Simple merge
diff --cc run-command.c
Simple merge
diff --cc setup.c
Simple merge
diff --cc statinfo.h
index fe8df633a4e159850dea80efc5751b06d085a5c5,bb9b61bc471e2c13873adc05c566643ebb49582d..700f502ac0b3cb938c2f376653dc1e91ac4e6d24
@@@ -21,18 -23,53 +23,67 @@@ struct stat_data 
        unsigned int sd_size;
  };
  
+ /*
+  * A struct to encapsulate the concept of whether a file has changed
+  * since we last checked it. This uses criteria similar to those used
+  * for the index.
+  */
+ struct stat_validity {
+       struct stat_data *sd;
+ };
+ #define MTIME_CHANGED 0x0001
+ #define CTIME_CHANGED 0x0002
+ #define OWNER_CHANGED 0x0004
+ #define MODE_CHANGED    0x0008
+ #define INODE_CHANGED   0x0010
+ #define DATA_CHANGED    0x0020
+ #define TYPE_CHANGED    0x0040
+ /*
+  * Record to sd the data from st that we use to check whether a file
+  * might have changed.
+  */
+ void fill_stat_data(struct stat_data *sd, struct stat *st);
+ /*
+  * Return 0 if st is consistent with a file not having been changed
+  * since sd was filled.  If there are differences, return a
+  * combination of MTIME_CHANGED, CTIME_CHANGED, OWNER_CHANGED,
+  * INODE_CHANGED, and DATA_CHANGED.
+  */
+ int match_stat_data(const struct stat_data *sd, struct stat *st);
+ void stat_validity_clear(struct stat_validity *sv);
+ /*
+  * Returns 1 if the path is a regular file (or a symlink to a regular
+  * file) and matches the saved stat_validity, 0 otherwise.  A missing
+  * or inaccessible file is considered a match if the struct was just
+  * initialized, or if the previous update found an inaccessible file.
+  */
+ int stat_validity_check(struct stat_validity *sv, const char *path);
+ /*
+  * Update the stat_validity from a file opened at descriptor fd. If
+  * the file is missing, inaccessible, or not a regular file, then
+  * future calls to stat_validity_check will match iff one of those
+  * conditions continues to be true.
+  */
+ void stat_validity_update(struct stat_validity *sv, int fd);
 +#if defined(DT_UNKNOWN) && !defined(NO_D_TYPE_IN_DIRENT)
 +#define DTYPE(de)     ((de)->d_type)
 +#else
 +#undef DT_UNKNOWN
 +#undef DT_DIR
 +#undef DT_REG
 +#undef DT_LNK
 +#define DT_UNKNOWN    0
 +#define DT_DIR                1
 +#define DT_REG                2
 +#define DT_LNK                3
 +#define DTYPE(de)     DT_UNKNOWN
 +#endif
 +
  #endif
diff --cc strbuf.c
Simple merge
diff --cc strbuf.h
Simple merge