git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 00/12] Remove more index compatibility macros
@ 2021-01-01 13:06 Derrick Stolee via GitGitGadget
  2021-01-01 13:06 ` [PATCH 01/12] merge-index: drop " Derrick Stolee via GitGitGadget
                   ` (15 more replies)
  0 siblings, 16 replies; 65+ messages in thread
From: Derrick Stolee via GitGitGadget @ 2021-01-01 13:06 UTC (permalink / raw)
  To: git; +Cc: pclouds, gitster, Derrick Stolee

I noticed that Duy's project around USE_THE_INDEX_COMPATIBILITY_MACROS has
been on pause for a while. Here is my attempt to continue that project a
little.

I started going through the builtins that still use cache_name_pos() and the
first few were easy: merge-inex, mv, rm.

Then I hit update-index and it was a bit bigger. It's included here as well.

My strategy for update-index was to create static globals "repo" and
"istate" that point to the_repository and the_index, respectively. Then, I
was able to remove macros one-by-one without changing method prototypes
within the file.

I had started trying to keep everything local to the method signatures, but
I hit a snag when reaching the command-line parsing callbacks, which I could
not modify their call signature. At that point, I had something that was
already much more complicated than what I present now. Outside of the first
update-index commit, everything was a mechanical find/replace.

In total, this allows us to remove four of the compatibility macros because
they are no longer used.

Thanks, -Stolee

Derrick Stolee (12):
  merge-index: drop index compatibility macros
  mv: remove index compatibility macros
  rm: remove compatilibity macros
  update-index: drop the_index, the_repository
  update-index: use istate->cache over active_cache
  update-index: use index->cache_nr over active_nr
  update-index: use istate->cache_changed
  update-index: use index_name_pos() over cache_name_pos()
  update-index: use remove_file_from_index()
  update-index: use add_index_entry()
  update-index: replace several compatibility macros
  update-index: remove ce_match_stat(), all macros

 Documentation/technical/racy-git.txt |   6 +-
 builtin/merge-index.c                |  33 +++---
 builtin/mv.c                         |  42 ++++----
 builtin/rm.c                         |  56 ++++++-----
 builtin/update-index.c               | 145 ++++++++++++++-------------
 cache.h                              |   4 -
 6 files changed, 149 insertions(+), 137 deletions(-)


base-commit: 71ca53e8125e36efbda17293c50027d31681a41f
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-830%2Fderrickstolee%2Findex-compatibility-1-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-830/derrickstolee/index-compatibility-1-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/830
-- 
gitgitgadget

^ permalink raw reply	[flat|nested] 65+ messages in thread

end of thread, other threads:[~2021-01-26 21:06 UTC | newest]

Thread overview: 65+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-01 13:06 [PATCH 00/12] Remove more index compatibility macros Derrick Stolee via GitGitGadget
2021-01-01 13:06 ` [PATCH 01/12] merge-index: drop " Derrick Stolee via GitGitGadget
2021-01-03 23:31   ` Alban Gruin
2021-01-04 11:08     ` Derrick Stolee
2021-01-01 13:06 ` [PATCH 02/12] mv: remove " Derrick Stolee via GitGitGadget
2021-01-01 13:06 ` [PATCH 03/12] rm: remove compatilibity macros Derrick Stolee via GitGitGadget
2021-01-01 13:07 ` [PATCH 04/12] update-index: drop the_index, the_repository Derrick Stolee via GitGitGadget
2021-01-01 21:05   ` Elijah Newren
2021-01-04  0:56     ` Derrick Stolee
2021-01-01 13:07 ` [PATCH 05/12] update-index: use istate->cache over active_cache Derrick Stolee via GitGitGadget
2021-01-01 13:07 ` [PATCH 06/12] update-index: use index->cache_nr over active_nr Derrick Stolee via GitGitGadget
2021-01-01 13:07 ` [PATCH 07/12] update-index: use istate->cache_changed Derrick Stolee via GitGitGadget
2021-01-01 13:07 ` [PATCH 08/12] update-index: use index_name_pos() over cache_name_pos() Derrick Stolee via GitGitGadget
2021-01-01 13:07 ` [PATCH 09/12] update-index: use remove_file_from_index() Derrick Stolee via GitGitGadget
2021-01-01 13:07 ` [PATCH 10/12] update-index: use add_index_entry() Derrick Stolee via GitGitGadget
2021-01-01 13:07 ` [PATCH 11/12] update-index: replace several compatibility macros Derrick Stolee via GitGitGadget
2021-01-01 13:07 ` [PATCH 12/12] update-index: remove ce_match_stat(), all macros Derrick Stolee via GitGitGadget
2021-01-01 21:12   ` Elijah Newren
2021-01-01 21:16 ` [PATCH 00/12] Remove more index compatibility macros Elijah Newren
2021-01-02  6:12 ` Eric Sunshine
2021-01-04  1:01   ` Derrick Stolee
2021-01-04  6:22     ` Eric Sunshine
2021-01-05  4:41       ` Derrick Stolee
2021-01-05  4:42 ` [PATCH v2 00/14] " Derrick Stolee via GitGitGadget
2021-01-05  4:42   ` [PATCH v2 01/14] mv: remove " Derrick Stolee via GitGitGadget
2021-01-05  4:42   ` [PATCH v2 02/14] rm: remove compatilibity macros Derrick Stolee via GitGitGadget
2021-01-05  4:42   ` [PATCH v2 03/14] update-index: drop the_index, the_repository Derrick Stolee via GitGitGadget
2021-01-05  4:42   ` [PATCH v2 04/14] update-index: use istate->cache over active_cache Derrick Stolee via GitGitGadget
2021-01-05  4:42   ` [PATCH v2 05/14] update-index: use index->cache_nr over active_nr Derrick Stolee via GitGitGadget
2021-01-05  4:42   ` [PATCH v2 06/14] update-index: use istate->cache_changed Derrick Stolee via GitGitGadget
2021-01-05  4:42   ` [PATCH v2 07/14] update-index: use index_name_pos() over cache_name_pos() Derrick Stolee via GitGitGadget
2021-01-05  4:42   ` [PATCH v2 08/14] update-index: use remove_file_from_index() Derrick Stolee via GitGitGadget
2021-01-05  4:42   ` [PATCH v2 09/14] update-index: use add_index_entry() Derrick Stolee via GitGitGadget
2021-01-05  4:42   ` [PATCH v2 10/14] update-index: replace several compatibility macros Derrick Stolee via GitGitGadget
2021-01-05  4:43   ` [PATCH v2 11/14] update-index: remove ce_match_stat(), all macros Derrick Stolee via GitGitGadget
2021-01-05  4:43   ` [PATCH v2 12/14] update-index: reduce static globals, part 1 Derrick Stolee via GitGitGadget
2021-01-05  4:43   ` [PATCH v2 13/14] update-index: reduce static globals, part 2 Derrick Stolee via GitGitGadget
2021-01-05  4:43   ` [PATCH v2 14/14] update-index: remove static globals from callbacks Derrick Stolee via GitGitGadget
2021-01-07  5:09     ` Eric Sunshine
2021-01-07 11:19       ` Derrick Stolee
2021-01-07 18:53         ` Eric Sunshine
2021-01-07 19:57           ` Junio C Hamano
2021-01-08  1:52             ` Derrick Stolee
2021-01-08 20:02   ` [PATCH v3 00/14] Remove more index compatibility macros Derrick Stolee via GitGitGadget
2021-01-08 20:02     ` [PATCH v3 01/14] mv: remove " Derrick Stolee via GitGitGadget
2021-01-08 20:02     ` [PATCH v3 02/14] rm: remove compatilibity macros Derrick Stolee via GitGitGadget
2021-01-08 20:02     ` [PATCH v3 03/14] update-index: drop the_index, the_repository Derrick Stolee via GitGitGadget
2021-01-08 20:02     ` [PATCH v3 04/14] update-index: use istate->cache over active_cache Derrick Stolee via GitGitGadget
2021-01-08 20:02     ` [PATCH v3 05/14] update-index: use istate->cache_nr over active_nr Derrick Stolee via GitGitGadget
2021-01-08 20:02     ` [PATCH v3 06/14] update-index: use istate->cache_changed Derrick Stolee via GitGitGadget
2021-01-08 20:02     ` [PATCH v3 07/14] update-index: use index_name_pos() over cache_name_pos() Derrick Stolee via GitGitGadget
2021-01-08 20:02     ` [PATCH v3 08/14] update-index: use remove_file_from_index() Derrick Stolee via GitGitGadget
2021-01-08 20:02     ` [PATCH v3 09/14] update-index: use add_index_entry() Derrick Stolee via GitGitGadget
2021-01-08 20:02     ` [PATCH v3 10/14] update-index: replace several compatibility macros Derrick Stolee via GitGitGadget
2021-01-08 20:02     ` [PATCH v3 11/14] update-index: remove ce_match_stat(), all macros Derrick Stolee via GitGitGadget
2021-01-08 20:02     ` [PATCH v3 12/14] update-index: reduce static globals, part 1 Derrick Stolee via GitGitGadget
2021-01-08 20:02     ` [PATCH v3 13/14] update-index: reduce static globals, part 2 Derrick Stolee via GitGitGadget
2021-01-08 20:02     ` [PATCH v3 14/14] update-index: remove static globals from callbacks Derrick Stolee via GitGitGadget
2021-01-10  7:03     ` [PATCH v3 00/14] Remove more index compatibility macros Junio C Hamano
2021-01-10  7:32       ` Eric Sunshine
2021-01-10 11:57       ` Derrick Stolee
2021-01-25 13:04       ` Derrick Stolee
2021-01-06  3:55 ` [PATCH 00/12] " Junio C Hamano
2021-01-06 11:35   ` Derrick Stolee
2021-01-06 20:52     ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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).