git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 00/17] cocci: remove "the_index" wrapper macros

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Mar 17, 2023, 15:35 UTC
Message-ID
<cover-00.17-00000000000-20230317T152724Z-avarab@gmail.com>

In 2.40 the last use of "USE_THE_INDEX_COMPATIBILITY_MACROS" went away, this series does the same for our long-standing migration of "NO_THE_REPOSITORY_COMPATIBILITY_MACROS".

For review the only interesting patches here are 01-04/17 and 16-17/17, the rest are all a result of mechanically applying the coccinelle rules incrementally on a header-by-header basis.

For 3x of those I made minor tweaks to the coccille output, because:
 * For whatever reason, it sometimes emits output that would fail
   "diff --check".
 * It would produce very long lines in some cases, which have been
   manually wrapped.
 * For the few that needed casts it wanted to add whitespace between
   the closing ")" and the function name, but the pre-image didn't use
   that, so I adjusted it back.
When merging this to "seen" there's a very trivial conflict in
commit.h, the resolution is to delete both sides:
	
	diff --cc commit.h
	index d4adf111019,d65f1e00145..00000000000
	--- a/commit.h
	+++ b/commit.h
	@@@ -193,7 -207,9 +195,13 @@@ void free_commit_list(struct commit_lis
	  
	  struct rev_info; /* in revision.h, it circularly uses enum cmit_fmt */
	  
	++<<<<<<< HEAD
	 +int has_non_ascii(const char *text);
	++=======
	+ const char *logmsg_reencode(const struct commit *commit,
	+                           char **commit_encoding,
	+                           const char *output_encoding);
	++>>>>>>> origin/seen
	  const char *repo_logmsg_reencode(struct repository *r,
	                                 const struct commit *commit,
	                                 char **commit_encoding,

Branch & CI for this at: https://github.com/avar/git/tree/avar/cocci-the-repository-from-pending

Ævar Arnfjörð Bjarmason (17):
  cocci: remove dead rule from "the_repository.pending.cocci"
  cocci: fix incorrect & verbose "the_repository" rules
  cocci: sort "the_repository" rules by header
  cocci: add missing "the_repository" macros to "pending"
  cocci: apply the "cache.h" part of "the_repository.pending"
  cocci: apply the "commit-reach.h" part of "the_repository.pending"
  cocci: apply the "commit.h" part of "the_repository.pending"
  cocci: apply the "diff.h" part of "the_repository.pending"
  cocci: apply the "object-store.h" part of "the_repository.pending"
  cocci: apply the "pretty.h" part of "the_repository.pending"
  cocci: apply the "packfile.h" part of "the_repository.pending"
  cocci: apply the "promisor-remote.h" part of "the_repository.pending"
  cocci: apply the "refs.h" part of "the_repository.pending"
  cocci: apply the "rerere.h" part of "the_repository.pending"
  cocci: apply the "revision.h" part of "the_repository.pending"
  post-cocci: adjust comments for recent repo_* migration
  libs: use "struct repository *" argument, not "the_repository"
 add-interactive.c                             |   2 +-
 add-patch.c                                   |   2 +-
 apply.c                                       |  13 +-
 archive.c                                     |  12 +-
 bisect.c                                      |  11 +-
 blame.c                                       |  15 +-
 branch.c                                      |   7 +-
 builtin/am.c                                  |  23 +--
 builtin/bisect.c                              |  33 ++--
 builtin/blame.c                               |  15 +-
 builtin/branch.c                              |   9 +-
 builtin/cat-file.c                            |  25 +--
 builtin/checkout.c                            |  35 ++--
 builtin/clone.c                               |   6 +-
 builtin/commit-tree.c                         |   4 +-
 builtin/commit.c                              |  29 ++--
 builtin/describe.c                            |   9 +-
 builtin/diff.c                                |   3 +-
 builtin/difftool.c                            |   3 +-
 builtin/fast-export.c                         |  12 +-
 builtin/fast-import.c                         |  17 +-
 builtin/fetch.c                               |  21 +--
 builtin/fsck.c                                |   2 +-
 builtin/gc.c                                  |   8 +-
 builtin/grep.c                                |   6 +-
 builtin/index-pack.c                          |  11 +-
 builtin/log.c                                 |  30 ++--
 builtin/ls-files.c                            |   4 +-
 builtin/ls-tree.c                             |   9 +-
 builtin/merge-base.c                          |   9 +-
 builtin/merge-recursive.c                     |   6 +-
 builtin/merge-tree.c                          |  18 ++-
 builtin/merge.c                               |  23 +--
 builtin/mktag.c                               |   3 +-
 builtin/name-rev.c                            |  11 +-
 builtin/notes.c                               |  34 ++--
 builtin/pack-objects.c                        |  24 ++-
 builtin/prune.c                               |   2 +-
 builtin/pull.c                                |   4 +-
 builtin/range-diff.c                          |  12 +-
 builtin/read-tree.c                           |   2 +-
 builtin/rebase.c                              |  21 +--
 builtin/receive-pack.c                        |  14 +-
 builtin/remote.c                              |   2 +-
 builtin/repack.c                              |   2 +-
 builtin/replace.c                             |  20 +--
 builtin/reset.c                               |  22 +--
 builtin/rev-list.c                            |   2 +-
 builtin/rev-parse.c                           |  18 ++-
 builtin/rm.c                                  |   2 +-
 builtin/shortlog.c                            |  13 +-
 builtin/show-branch.c                         |  19 +--
 builtin/show-ref.c                            |   6 +-
 builtin/sparse-checkout.c                     |   2 +-
 builtin/stash.c                               |  26 +--
 builtin/submodule--helper.c                   |   6 +-
 builtin/tag.c                                 |  10 +-
 builtin/unpack-file.c                         |   4 +-
 builtin/unpack-objects.c                      |   5 +-
 builtin/update-ref.c                          |   8 +-
 builtin/verify-commit.c                       |   2 +-
 builtin/verify-tag.c                          |   2 +-
 builtin/worktree.c                            |   8 +-
 bulk-checkin.c                                |   2 +-
 bundle.c                                      |   5 +-
 cache-tree.c                                  |  16 +-
 cache.h                                       |  19 +--
 checkout.c                                    |   2 +-
 combine-diff.c                                |   8 +-
 commit-graph.c                                |   4 +-
 commit-reach.c                                |  21 +--
 commit-reach.h                                |   9 --
 commit.c                                      |  44 ++---
 commit.h                                      |  22 +--
 connected.c                                   |   4 +-
 contrib/coccinelle/the_repository.cocci       | 123 ++++++++++++++
 .../coccinelle/the_repository.pending.cocci   | 128 ---------------
 delta-islands.c                               |   5 +-
 diff-lib.c                                    |   2 +-
 diff.c                                        |   6 +-
 diff.h                                        |   5 +-
 diffcore-break.c                              |   2 +-
 diffcore-rename.c                             |   4 +-
 dir.c                                         |   2 +-
 entry.c                                       |   3 +-
 fetch-pack.c                                  |   8 +-
 fmt-merge-msg.c                               |  15 +-
 fsck.c                                        |   6 +-
 http-push.c                                   |  16 +-
 http-walker.c                                 |   4 +-
 list-objects-filter-options.c                 |   7 +-
 list-objects.c                                |  20 ++-
 log-tree.c                                    |  28 ++--
 mailmap.c                                     |   4 +-
 match-trees.c                                 |   4 +-
 merge-blobs.c                                 |   6 +-
 merge-ort.c                                   |   6 +-
 merge-recursive.c                             |   9 +-
 negotiator/default.c                          |   6 +-
 negotiator/skipping.c                         |   2 +-
 notes-cache.c                                 |   5 +-
 notes-merge.c                                 |  11 +-
 notes-utils.c                                 |   2 +-
 notes.c                                       |  18 ++-
 object-file.c                                 |   4 +-
 object-name.c                                 |  19 ++-
 object-store.h                                |  11 +-
 pack-bitmap-write.c                           |   3 +-
 packfile.c                                    |   2 +-
 packfile.h                                    |   1 -
 parse-options-cb.c                            |   8 +-
 pretty.c                                      |  10 +-
 pretty.h                                      |   4 -
 promisor-remote.h                             |  15 --
 range-diff.c                                  |  12 +-
 read-cache.c                                  |   9 +-
 rebase-interactive.c                          |   2 +-
 ref-filter.c                                  |   8 +-
 reflog.c                                      |   7 +-
 refs.c                                        |   2 +-
 refs.h                                        |   6 -
 remote.c                                      |  15 +-
 rerere.c                                      |   5 +-
 rerere.h                                      |   3 -
 reset.c                                       |   4 +-
 revision.c                                    |  27 ++--
 revision.h                                    |   3 -
 send-pack.c                                   |   6 +-
 sequencer.c                                   | 150 ++++++++++--------
 shallow.c                                     |  21 +--
 strbuf.h                                      |   6 +-
 submodule-config.c                            |   5 +-
 submodule.c                                   |   8 +-
 t/helper/test-fast-rebase.c                   |  19 ++-
 t/helper/test-match-trees.c                   |   4 +-
 t/helper/test-oidmap.c                        |   6 +-
 t/helper/test-reach.c                         |  12 +-
 t/helper/test-revision-walking.c              |   3 +-
 t/helper/test-submodule-config.c              |   2 +-
 tag.c                                         |   9 +-
 transport-helper.c                            |   2 +-
 transport.c                                   |   3 +-
 tree.c                                        |   5 +-
 unpack-trees.c                                |   2 +-
 upload-pack.c                                 |   8 +-
 walker.c                                      |   6 +-
 wt-status.c                                   |  21 +--
 xdiff-interface.c                             |   2 +-
 148 files changed, 958 insertions(+), 873 deletions(-)
 create mode 100644 contrib/coccinelle/the_repository.cocci
 delete mode 100644 contrib/coccinelle/the_repository.pending.cocci
-- 
2.40.0.rc1.1034.g5867a1b10c5
Next: Ævar Arnfjörð Bjarmason
Message 1 of 60 in “cocci: remove "the_index" wrapper macros”
  1. 00/17 cocci: remove "the_index" wrapper macrosÆvar Arnfjörð Bjarmason, Mar 17, 2023
  2. 02/17 cocci: fix incorrect & verbose "the_repository" rulesÆvar Arnfjörð Bjarmason, Mar 17, 2023
  3. Elijah NewrenMar 19, 2023
  4. Glen ChooMar 22, 2023
  5. Ævar Arnfjörð BjarmasonMar 26, 2023
  6. 01/17 cocci: remove dead rule from "the_repository.pending.cocci"Ævar Arnfjörð Bjarmason, Mar 17, 2023
  7. Eric SunshineMar 17, 2023
  8. Elijah NewrenMar 19, 2023
  9. 03/17 cocci: sort "the_repository" rules by headerÆvar Arnfjörð Bjarmason, Mar 17, 2023
  10. Elijah NewrenMar 19, 2023
  11. 04/17 cocci: add missing "the_repository" macros to "pending"Ævar Arnfjörð Bjarmason, Mar 17, 2023
  12. Elijah NewrenMar 19, 2023
  13. 08/17 cocci: apply the "diff.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 17, 2023
  14. 06/17 cocci: apply the "commit-reach.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 17, 2023
  15. 10/17 cocci: apply the "pretty.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 17, 2023
  16. 05/17 cocci: apply the "cache.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 17, 2023
  17. Elijah NewrenMar 19, 2023
  18. Glen ChooMar 22, 2023
  19. 07/17 cocci: apply the "commit.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 17, 2023
  20. 11/17 cocci: apply the "packfile.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 17, 2023
  21. 12/17 cocci: apply the "promisor-remote.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 17, 2023
  22. 14/17 cocci: apply the "rerere.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 17, 2023
  23. 09/17 cocci: apply the "object-store.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 17, 2023
  24. 13/17 cocci: apply the "refs.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 17, 2023
  25. 15/17 cocci: apply the "revision.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 17, 2023
  26. Glen ChooMar 22, 2023
  27. Glen ChooMar 22, 2023
  28. Ævar Arnfjörð BjarmasonMar 26, 2023
  29. 16/17 post-cocci: adjust comments for recent repo_* migrationÆvar Arnfjörð Bjarmason, Mar 17, 2023
  30. Elijah NewrenMar 19, 2023
  31. 17/17 libs: use "struct repository *" argument, not "the_repository"Ævar Arnfjörð Bjarmason, Mar 17, 2023
  32. Elijah NewrenMar 19, 2023
  33. Ævar Arnfjörð BjarmasonMar 28, 2023
  34. Junio C HamanoMar 17, 2023
  35. 00/17 cocci: remove "the_repository" wrapper macrosÆvar Arnfjörð Bjarmason, Mar 28, 2023
  36. 01/17 cocci: remove dead rule from "the_repository.pending.cocci"Ævar Arnfjörð Bjarmason, Mar 28, 2023
  37. 02/17 cocci: fix incorrect & verbose "the_repository" rulesÆvar Arnfjörð Bjarmason, Mar 28, 2023
  38. Taylor BlauMar 29, 2023
  39. 03/17 cocci: sort "the_repository" rules by headerÆvar Arnfjörð Bjarmason, Mar 28, 2023
  40. 04/17 cocci: add missing "the_repository" macros to "pending"Ævar Arnfjörð Bjarmason, Mar 28, 2023
  41. 06/17 cocci: apply the "commit-reach.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 28, 2023
  42. 05/17 cocci: apply the "cache.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 28, 2023
  43. 08/17 cocci: apply the "diff.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 28, 2023
  44. 07/17 cocci: apply the "commit.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 28, 2023
  45. 10/17 cocci: apply the "pretty.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 28, 2023
  46. 11/17 cocci: apply the "packfile.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 28, 2023
  47. 09/17 cocci: apply the "object-store.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 28, 2023
  48. 12/17 cocci: apply the "promisor-remote.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 28, 2023
  49. 13/17 cocci: apply the "refs.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 28, 2023
  50. 14/17 cocci: apply the "rerere.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 28, 2023
  51. 15/17 cocci: apply the "revision.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 28, 2023
  52. 16/17 post-cocci: adjust comments for recent repo_* migrationÆvar Arnfjörð Bjarmason, Mar 28, 2023
  53. Taylor BlauMar 29, 2023
  54. 17/17 libs: use "struct repository *" argument, not "the_repository"Ævar Arnfjörð Bjarmason, Mar 28, 2023
  55. Junio C HamanoMar 28, 2023
  56. Junio C HamanoMar 28, 2023
  57. Junio C HamanoMar 29, 2023
  58. Taylor BlauMar 29, 2023
  59. Elijah NewrenMar 30, 2023
  60. Glen ChooMar 30, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.