Git Mailing List Archive mirror
 help / color / mirror / Atom feed
From: "Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Calvin Wan <calvinwan@google.com>, Elijah Newren <newren@gmail.com>
Subject: [PATCH 00/23] Header cleanups (more splitting of cache.h and simplifying a few other deps)
Date: Sun, 16 Apr 2023 03:03:02 +0000	[thread overview]
Message-ID: <pull.1517.git.1681614205.gitgitgadget@gmail.com> (raw)

Maintainer notes: (1) This series is based on en/header-split-cache-h (now
in next). (2) Although I've tweaked the series to minimize conflicts, there
is a semantic conflict with sl/sparse-write-tree in next; to resolve, add an
include of repository.h in builtin/write-tree.c.

This series continues to focus on splitting declarations from cache.h to
separate headers. This series also untangles some dependencies between
hash.h and repository.h, and between read-cache.c and tree.[ch], and cleans
up a few other headers. At the end of this series the number of cache.h
includes drops from 189 down to 149.

The series may appear to be long at first glance, but is filled with mostly
repetitive and simple changes similar to those from earlier series. An
overview:

 * Patch 1: files depending on strbuf.h should be explicit about it
 * Patches 2-13: move stuff out of cache.h into other more logical headers
 * Patch 14-16: move functions between hash<->repository and
   read-cache<->tree to simplify dependencies
 * Patch 17: remove includes of cache.h permitted by the previous 16 patches
 * Patches 18-22: clean up now-unnecessary includes in other headers
 * Patch 23: start enforcing git-compat-util.h is first include for reftable
   files as well.

And thanks once again to Dscho for gitgitgadget. Getting multiple platform
testing + all the special tests (sparse, cocci, hdr-check, etc.) really
helps clean out all the issues that would otherwise hit a series like this.

Elijah Newren (23):
  treewide: be explicit about dependence on strbuf.h
  symlinks.h: move declarations for symlinks.c functions from cache.h
  protocol.h: move definition of DEFAULT_GIT_PORT from cache.h
  packfile.h: move pack_window and pack_entry from cache.h
  server-info.h: move declarations for server-info.c functions from
    cache.h
  copy.h: move declarations for copy.c functions from cache.h
  base85.h: move declarations for base85.c functions from cache.h
  pkt-line.h: move declarations for pkt-line.c functions from cache.h
  match-trees.h: move declarations for match-trees.c functions from
    cache.h
  ws.h: move declarations for ws.c functions from cache.h
  versioncmp.h: move declarations for versioncmp.c functions from
    cache.h
  dir.h: move DTYPE defines from cache.h
  tree-diff.c: move S_DIFFTREE_IFXMIN_NEQ define from cache.h
  hash.h, repository.h: reverse the order of these dependencies
  cache,tree: move cmp_cache_name_compare from tree.[ch] to read-cache.c
  cache,tree: move basic name compare functions from read-cache to tree
  treewide: remove cache.h inclusion due to previous changes
  cache.h: remove unnecessary headers
  fsmonitor: reduce includes of cache.h
  commit.h: reduce unnecessary includes
  object-store.h: reduce unnecessary includes
  diff.h: reduce unnecessary includes
  reftable: ensure git-compat-util.h is the first (indirect) include

 add-interactive.c                            |   1 +
 alloc.c                                      |   1 +
 apply.c                                      |   3 +
 archive-zip.c                                |   2 +-
 archive.c                                    |   2 +
 attr.c                                       |   1 +
 base85.c                                     |   3 +-
 base85.h                                     |   7 +
 bloom.c                                      |   1 +
 branch.c                                     |   1 +
 builtin/apply.c                              |   1 +
 builtin/archive.c                            |   1 +
 builtin/bisect.c                             |   1 +
 builtin/bundle.c                             |   2 +
 builtin/check-attr.c                         |   1 +
 builtin/check-ignore.c                       |   1 +
 builtin/checkout-index.c                     |   1 +
 builtin/checkout.c                           |   1 +
 builtin/clean.c                              |   1 +
 builtin/clone.c                              |   2 +
 builtin/config.c                             |   1 +
 builtin/credential-cache.c                   |   1 +
 builtin/credential-store.c                   |   1 +
 builtin/diff-tree.c                          |   1 +
 builtin/diff.c                               |   1 +
 builtin/difftool.c                           |   1 +
 builtin/fetch.c                              |   1 +
 builtin/for-each-repo.c                      |   2 +
 builtin/gc.c                                 |   1 +
 builtin/help.c                               |   1 +
 builtin/init-db.c                            |   2 +
 builtin/log.c                                |   1 +
 builtin/ls-remote.c                          |   1 +
 builtin/merge-index.c                        |   1 +
 builtin/merge-recursive.c                    |   1 +
 builtin/merge-tree.c                         |   1 +
 builtin/mv.c                                 |   1 +
 builtin/push.c                               |   2 +
 builtin/read-tree.c                          |   1 +
 builtin/receive-pack.c                       |   1 +
 builtin/repack.c                             |   1 +
 builtin/rerere.c                             |   1 +
 builtin/rm.c                                 |   1 +
 builtin/show-branch.c                        |   1 +
 builtin/show-index.c                         |   1 +
 builtin/update-index.c                       |   2 +
 builtin/update-ref.c                         |   1 +
 builtin/update-server-info.c                 |   1 +
 builtin/upload-archive.c                     |   1 +
 builtin/worktree.c                           |   2 +
 bundle-uri.c                                 |   3 +-
 cache.h                                      | 143 +------------------
 checkout.c                                   |   1 +
 chunk-format.c                               |   1 +
 color.c                                      |   3 +-
 combine-diff.c                               |   3 +-
 commit-graph.c                               |   1 +
 commit.c                                     |   1 +
 commit.h                                     |  11 +-
 common-main.c                                |   4 +-
 compat/fsmonitor/fsm-health-darwin.c         |   2 +-
 compat/fsmonitor/fsm-ipc-darwin.c            |   4 +-
 compat/fsmonitor/fsm-ipc-win32.c             |   1 +
 compat/fsmonitor/fsm-listen-darwin.c         |   3 +-
 compat/mingw.c                               |   1 +
 compat/precompose_utf8.c                     |   1 +
 compat/win32/trace2_win32_process_info.c     |   1 +
 config.c                                     |   3 +-
 convert.c                                    |   1 +
 copy.c                                       |   4 +-
 copy.h                                       |  10 ++
 credential.c                                 |   3 +-
 csum-file.c                                  |   1 +
 daemon.c                                     |   4 +-
 date.c                                       |   3 +-
 diagnose.c                                   |   2 +-
 diff-lib.c                                   |   1 +
 diff.c                                       |   2 +
 diff.h                                       |   1 -
 dir.c                                        |   2 +
 dir.h                                        |  15 ++
 editor.c                                     |   1 +
 entry.c                                      |   1 +
 environment.c                                |   3 +-
 exec-cmd.c                                   |   1 +
 fetch-pack.c                                 |   1 +
 fsck.c                                       |   1 +
 fsmonitor--daemon.h                          |   1 -
 fsmonitor-ipc.c                              |   1 +
 gpg-interface.c                              |   2 +
 grep.c                                       |   1 +
 hash-lookup.c                                |   1 +
 hash.h                                       |  97 -------------
 hex.c                                        |   1 +
 hook.c                                       |   1 +
 http-push.c                                  |   2 +
 khash.h                                      |   1 +
 line-log.c                                   |   1 +
 ll-merge.c                                   |   3 +-
 log-tree.c                                   |   1 +
 match-trees.c                                |   3 +-
 match-trees.h                                |  10 ++
 merge-ort-wrappers.c                         |   2 +
 merge-ort.c                                  |   1 +
 merge-recursive.c                            |   2 +
 merge.c                                      |   1 +
 midx.c                                       |   2 +-
 negotiator/default.c                         |   1 +
 negotiator/skipping.c                        |   1 +
 notes-cache.c                                |   1 +
 notes-utils.c                                |   1 +
 object-file.c                                |   3 +-
 object-file.h                                |   2 +
 object-name.c                                |   2 +
 object-store.h                               |   8 +-
 object.h                                     |   1 +
 oid-array.h                                  |   1 +
 oidmap.c                                     |   1 +
 oidtree.c                                    |   1 +
 pack-bitmap-write.c                          |   2 +
 packfile.c                                   |   2 +-
 packfile.h                                   |  16 ++-
 parallel-checkout.c                          |   2 +
 parse-options-cb.c                           |   1 +
 parse-options.c                              |   1 +
 pathspec.c                                   |   2 +
 pkt-line.c                                   |   3 +-
 pkt-line.h                                   |   2 +
 preload-index.c                              |   1 +
 progress.c                                   |   1 +
 protocol.h                                   |  21 +++
 range-diff.c                                 |   2 +-
 read-cache.c                                 |  81 ++---------
 rebase-interactive.c                         |   1 +
 ref-filter.c                                 |   4 +-
 reflog.c                                     |   2 +
 refs/debug.c                                 |   1 +
 refs/files-backend.c                         |   2 +
 refs/packed-backend.c                        |   1 +
 refs/ref-cache.c                             |   1 +
 refs/ref-cache.h                             |   1 +
 refspec.c                                    |   2 +
 reftable/error.c                             |   1 +
 reftable/publicbasics.c                      |   2 +-
 reftable/tree.c                              |   2 +-
 reftable/tree_test.c                         |   1 +
 repository.h                                 |  96 +++++++++++++
 rerere.c                                     |   1 +
 resolve-undo.c                               |   1 +
 revision.h                                   |   1 +
 run-command.c                                |   1 +
 send-pack.c                                  |   1 +
 sequencer.c                                  |   1 +
 server-info.c                                |   3 +-
 server-info.h                                |   7 +
 split-index.c                                |   2 +
 strbuf.c                                     |   1 +
 submodule-config.c                           |   1 +
 symlinks.c                                   |   3 +-
 symlinks.h                                   |  28 ++++
 t/helper/test-bloom.c                        |   1 +
 t/helper/test-cache-tree.c                   |   1 +
 t/helper/test-dump-cache-tree.c              |   1 +
 t/helper/test-dump-fsmonitor.c               |   1 +
 t/helper/test-dump-untracked-cache.c         |   1 +
 t/helper/test-example-decorate.c             |   1 +
 t/helper/test-fsmonitor-client.c             |   1 +
 t/helper/test-lazy-init-name-hash.c          |   1 +
 t/helper/test-match-trees.c                  |   3 +-
 t/helper/test-mergesort.c                    |   2 +-
 t/helper/test-oid-array.c                    |   2 +-
 t/helper/test-oidmap.c                       |   1 +
 t/helper/test-oidtree.c                      |   2 +-
 t/helper/test-parse-options.c                |   2 +-
 t/helper/test-path-utils.c                   |   1 +
 t/helper/test-read-cache.c                   |   1 +
 t/helper/test-read-midx.c                    |   2 +-
 t/helper/test-reftable.c                     |   1 +
 t/helper/test-scrap-cache-tree.c             |   1 +
 t/helper/test-string-list.c                  |   2 +-
 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-trace2.c                       |   1 +
 t/helper/test-write-cache.c                  |   1 +
 trace2.c                                     |   1 +
 trace2/tr2_tgt_event.c                       |   1 +
 trace2/tr2_tgt_normal.c                      |   1 +
 trace2/tr2_tgt_perf.c                        |   1 +
 tree-diff.c                                  |  16 ++-
 tree-walk.c                                  |   2 +-
 tree-walk.h                                  |   1 +
 tree.c                                       |  72 +++++++++-
 tree.h                                       |  11 +-
 unpack-trees.c                               |   1 +
 versioncmp.c                                 |   3 +-
 versioncmp.h                                 |   6 +
 wrapper.c                                    |   5 +-
 ws.c                                         |   6 +-
 ws.h                                         |  33 +++++
 wt-status.c                                  |   1 +
 201 files changed, 598 insertions(+), 371 deletions(-)
 create mode 100644 base85.h
 create mode 100644 copy.h
 create mode 100644 match-trees.h
 create mode 100644 server-info.h
 create mode 100644 symlinks.h
 create mode 100644 versioncmp.h
 create mode 100644 ws.h


base-commit: 4711556905f381c01f1fbae205f67cfa673ab44a
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1517%2Fnewren%2Fheader-cleanup-4-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1517/newren/header-cleanup-4-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1517
-- 
gitgitgadget

             reply	other threads:[~2023-04-16  3:03 UTC|newest]

Thread overview: 81+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-16  3:03 Elijah Newren via GitGitGadget [this message]
2023-04-16  3:03 ` [PATCH 01/23] treewide: be explicit about dependence on strbuf.h Elijah Newren via GitGitGadget
2023-04-16  3:03 ` [PATCH 02/23] symlinks.h: move declarations for symlinks.c functions from cache.h Elijah Newren via GitGitGadget
2023-04-16  3:03 ` [PATCH 03/23] protocol.h: move definition of DEFAULT_GIT_PORT " Elijah Newren via GitGitGadget
2023-04-16  3:03 ` [PATCH 04/23] packfile.h: move pack_window and pack_entry " Elijah Newren via GitGitGadget
2023-04-16  3:03 ` [PATCH 05/23] server-info.h: move declarations for server-info.c functions " Elijah Newren via GitGitGadget
2023-04-16  3:03 ` [PATCH 06/23] copy.h: move declarations for copy.c " Elijah Newren via GitGitGadget
2023-04-16  3:03 ` [PATCH 07/23] base85.h: move declarations for base85.c " Elijah Newren via GitGitGadget
2023-04-16  3:03 ` [PATCH 08/23] pkt-line.h: move declarations for pkt-line.c " Elijah Newren via GitGitGadget
2023-04-16  3:03 ` [PATCH 09/23] match-trees.h: move declarations for match-trees.c " Elijah Newren via GitGitGadget
2023-04-16  3:03 ` [PATCH 10/23] ws.h: move declarations for ws.c " Elijah Newren via GitGitGadget
2023-04-16  3:03 ` [PATCH 11/23] versioncmp.h: move declarations for versioncmp.c " Elijah Newren via GitGitGadget
2023-04-16  3:03 ` [PATCH 12/23] dir.h: move DTYPE defines " Elijah Newren via GitGitGadget
2023-04-16  3:03 ` [PATCH 13/23] tree-diff.c: move S_DIFFTREE_IFXMIN_NEQ define " Elijah Newren via GitGitGadget
2023-04-16  3:03 ` [PATCH 14/23] hash.h, repository.h: reverse the order of these dependencies Elijah Newren via GitGitGadget
2023-04-17 20:59   ` Derrick Stolee
2023-04-18  2:36     ` Elijah Newren
2023-04-18 23:29     ` Junio C Hamano
2023-04-20  5:06       ` Elijah Newren
2023-04-20 13:14         ` Derrick Stolee
2023-04-20 15:54           ` Junio C Hamano
2023-04-20 19:54             ` Glen Choo
2023-04-16  3:03 ` [PATCH 15/23] cache,tree: move cmp_cache_name_compare from tree.[ch] to read-cache.c Elijah Newren via GitGitGadget
2023-04-16  3:03 ` [PATCH 16/23] cache,tree: move basic name compare functions from read-cache to tree Elijah Newren via GitGitGadget
2023-04-16  3:03 ` [PATCH 17/23] treewide: remove cache.h inclusion due to previous changes Elijah Newren via GitGitGadget
2023-04-16  3:03 ` [PATCH 18/23] cache.h: remove unnecessary headers Elijah Newren via GitGitGadget
2023-04-16  3:03 ` [PATCH 19/23] fsmonitor: reduce includes of cache.h Elijah Newren via GitGitGadget
2023-04-16  3:03 ` [PATCH 20/23] commit.h: reduce unnecessary includes Elijah Newren via GitGitGadget
2023-04-16  3:03 ` [PATCH 21/23] object-store.h: " Elijah Newren via GitGitGadget
2023-04-16  3:03 ` [PATCH 22/23] diff.h: " Elijah Newren via GitGitGadget
2023-04-16  3:03 ` [PATCH 23/23] reftable: ensure git-compat-util.h is the first (indirect) include Elijah Newren via GitGitGadget
2023-04-17 21:07 ` [PATCH 00/23] Header cleanups (more splitting of cache.h and simplifying a few other deps) Derrick Stolee
2023-04-18  2:41   ` Elijah Newren
2023-04-22 20:17 ` [PATCH v2 00/22] " Elijah Newren via GitGitGadget
2023-04-22 20:17   ` [PATCH v2 01/22] treewide: be explicit about dependence on strbuf.h Elijah Newren via GitGitGadget
2023-04-22 20:17   ` [PATCH v2 02/22] symlinks.h: move declarations for symlinks.c functions from cache.h Elijah Newren via GitGitGadget
2023-04-22 20:17   ` [PATCH v2 03/22] packfile.h: move pack_window and pack_entry " Elijah Newren via GitGitGadget
2023-04-22 20:17   ` [PATCH v2 04/22] server-info.h: move declarations for server-info.c functions " Elijah Newren via GitGitGadget
2023-04-22 20:17   ` [PATCH v2 05/22] copy.h: move declarations for copy.c " Elijah Newren via GitGitGadget
2023-04-22 20:17   ` [PATCH v2 06/22] base85.h: move declarations for base85.c " Elijah Newren via GitGitGadget
2023-04-22 20:17   ` [PATCH v2 07/22] pkt-line.h: move declarations for pkt-line.c " Elijah Newren via GitGitGadget
2023-04-22 20:17   ` [PATCH v2 08/22] match-trees.h: move declarations for match-trees.c " Elijah Newren via GitGitGadget
2023-04-22 20:17   ` [PATCH v2 09/22] ws.h: move declarations for ws.c " Elijah Newren via GitGitGadget
2023-04-22 20:17   ` [PATCH v2 10/22] versioncmp.h: move declarations for versioncmp.c " Elijah Newren via GitGitGadget
2023-04-22 20:17   ` [PATCH v2 11/22] dir.h: move DTYPE defines " Elijah Newren via GitGitGadget
2023-04-22 20:17   ` [PATCH v2 12/22] tree-diff.c: move S_DIFFTREE_IFXMIN_NEQ define " Elijah Newren via GitGitGadget
2023-05-01 16:33     ` Ævar Arnfjörð Bjarmason
2023-05-01 16:46       ` Junio C Hamano
2023-05-02  1:06       ` Elijah Newren
2023-05-02  5:00         ` Elijah Newren
2023-05-02 15:56           ` Junio C Hamano
2023-05-02 15:59             ` Elijah Newren
2023-04-22 20:17   ` [PATCH v2 13/22] hash-ll.h: split out of hash.h to remove dependency on repository.h Elijah Newren via GitGitGadget
2023-04-24 18:51     ` Glen Choo
2023-04-26  3:54       ` Elijah Newren
2023-04-26 17:50         ` Glen Choo
2023-04-24 19:52     ` Junio C Hamano
2023-05-01 17:17     ` Ævar Arnfjörð Bjarmason
2023-05-02  2:53       ` Elijah Newren
2023-04-22 20:17   ` [PATCH v2 14/22] cache,tree: move cmp_cache_name_compare from tree.[ch] to read-cache.c Elijah Newren via GitGitGadget
2023-04-22 20:17   ` [PATCH v2 15/22] cache,tree: move basic name compare functions from read-cache to tree Elijah Newren via GitGitGadget
2023-04-22 20:17   ` [PATCH v2 16/22] treewide: remove cache.h inclusion due to previous changes Elijah Newren via GitGitGadget
2023-05-01 16:44     ` Ævar Arnfjörð Bjarmason
2023-05-02  1:25       ` Elijah Newren
2023-04-22 20:17   ` [PATCH v2 17/22] cache.h: remove unnecessary headers Elijah Newren via GitGitGadget
2023-05-01 16:49     ` Ævar Arnfjörð Bjarmason
2023-05-02  1:43       ` Elijah Newren
2023-04-22 20:17   ` [PATCH v2 18/22] fsmonitor: reduce includes of cache.h Elijah Newren via GitGitGadget
2023-04-22 20:17   ` [PATCH v2 19/22] commit.h: reduce unnecessary includes Elijah Newren via GitGitGadget
2023-05-01 16:52     ` Ævar Arnfjörð Bjarmason
2023-05-02  1:53       ` Elijah Newren
2023-04-22 20:17   ` [PATCH v2 20/22] object-store.h: " Elijah Newren via GitGitGadget
2023-05-01 17:00     ` Ævar Arnfjörð Bjarmason
2023-05-02  2:28       ` Elijah Newren
2023-04-22 20:17   ` [PATCH v2 21/22] diff.h: " Elijah Newren via GitGitGadget
2023-05-01 17:11     ` Ævar Arnfjörð Bjarmason
2023-04-22 20:17   ` [PATCH v2 22/22] reftable: ensure git-compat-util.h is the first (indirect) include Elijah Newren via GitGitGadget
2023-04-24 15:19   ` [PATCH v2 00/22] Header cleanups (more splitting of cache.h and simplifying a few other deps) Derrick Stolee
2023-04-24 19:49   ` Junio C Hamano
2023-04-26 17:54   ` Glen Choo
2023-04-26 18:14     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pull.1517.git.1681614205.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=calvinwan@google.com \
    --cc=git@vger.kernel.org \
    --cc=newren@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).