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

[PATCH 01/12] cache.h: remove unused "the_index" compat macros

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Nov 18, 2022, 11:30 UTC
Message-ID
<patch-01.12-760b4ddf06a-20221118T112205Z-avarab@gmail.com>
In-Reply-To
<cover-00.12-00000000000-20221118T112205Z-avarab@gmail.com>

The "active_alloc" macro added in 228e94f9357 (Move index-related variables into a structure., 2007-04-01) has not been used since 4aab5b46f44 (Make read-cache.c "the_index" free., 2007-04-01). Let's remove it.

The rest of these are likewise unused, so let's not keep them around. E.g. 12cd0bf9b02 (dir: stop using the index compatibility macros, 2017-05-05) is the last use of "cache_dir_exists".

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 cache.h | 5 -----
 1 file changed, 5 deletions(-)
diff --git a/cache.h b/cache.h
index 26ed03bd6de..29bb0ad2b41 100644
--- a/cache.h
+++ b/cache.h
@@ -438,7 +438,6 @@ extern struct index_state the_index;
 
 #define active_cache (the_index.cache)
 #define active_nr (the_index.cache_nr)
-#define active_alloc (the_index.cache_alloc)
 #define active_cache_changed (the_index.cache_changed)
 #define active_cache_tree (the_index.cache_tree)
 
@@ -452,7 +451,6 @@ extern struct index_state the_index;
 #define cache_name_pos(name, namelen) index_name_pos(&the_index,(name),(namelen))
 #define add_cache_entry(ce, option) add_index_entry(&the_index, (ce), (option))
 #define rename_cache_entry_at(pos, new_name) rename_index_entry_at(&the_index, (pos), (new_name))
-#define remove_cache_entry_at(pos) remove_index_entry_at(&the_index, (pos))
 #define remove_file_from_cache(path) remove_file_from_index(&the_index, (path))
 #define add_to_cache(path, st, flags) add_to_index(&the_index, (path), (st), (flags))
 #define add_file_to_cache(path, flags) add_file_to_index(&the_index, (path), (flags))
@@ -461,13 +459,10 @@ extern struct index_state the_index;
 #define refresh_and_write_cache(refresh_flags, write_flags, gentle) repo_refresh_and_write_index(the_repository, (refresh_flags), (write_flags), (gentle), NULL, NULL, NULL)
 #define ce_match_stat(ce, st, options) ie_match_stat(&the_index, (ce), (st), (options))
 #define ce_modified(ce, st, options) ie_modified(&the_index, (ce), (st), (options))
-#define cache_dir_exists(name, namelen) index_dir_exists(&the_index, (name), (namelen))
 #define cache_file_exists(name, namelen, igncase) index_file_exists(&the_index, (name), (namelen), (igncase))
 #define cache_name_is_other(name, namelen) index_name_is_other(&the_index, (name), (namelen))
 #define resolve_undo_clear() resolve_undo_clear_index(&the_index)
 #define unmerge_cache_entry_at(at) unmerge_index_entry_at(&the_index, at)
-#define unmerge_cache(pathspec) unmerge_index(&the_index, pathspec)
-#define read_blob_data_from_cache(path, sz) read_blob_data_from_index(&the_index, (path), (sz))
 #define hold_locked_index(lock_file, flags) repo_hold_locked_index(the_repository, (lock_file), (flags))
 #endif
 
-- 
2.38.0.1511.gcdcff1f1dc2
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 2 of 32 in “tree-wide: chip away at USE_THE_INDEX_COMPATIBILITY_MACROS”
  1. 00/12 tree-wide: chip away at USE_THE_INDEX_COMPATIBILITY_MACROSÆvar Arnfjörð Bjarmason, Nov 18, 2022
  2. 01/12 cache.h: remove unused "the_index" compat macrosÆvar Arnfjörð Bjarmason, Nov 18, 2022
  3. 02/12 builtin/{grep,log}.: don't define "USE_THE_INDEX_COMPATIBILITY_MACROS"Ævar Arnfjörð Bjarmason, Nov 18, 2022
  4. 03/12 cocci & cache.h: remove rarely used "the_index" compat macrosÆvar Arnfjörð Bjarmason, Nov 18, 2022
  5. 04/12 read-cache API & users: make discard_index() return voidÆvar Arnfjörð Bjarmason, Nov 18, 2022
  6. 05/12 cocci: add a index-compatibility.pending.cocciÆvar Arnfjörð Bjarmason, Nov 18, 2022
  7. 06/12 cocci & cache.h: apply a selection of "pending" index-compatibilityÆvar Arnfjörð Bjarmason, Nov 18, 2022
  8. 07/12 cocci & cache.h: apply variable section of "pending" index-compatibilityÆvar Arnfjörð Bjarmason, Nov 18, 2022
  9. 08/12 cocci: apply "pending" index-compatibility to "t/helper/*.c"Ævar Arnfjörð Bjarmason, Nov 18, 2022
  10. 09/12 {builtin/*,repository}.c: add & use "USE_THE_INDEX_VARIABLE"Ævar Arnfjörð Bjarmason, Nov 18, 2022
  11. Taylor BlauNov 18, 2022
  12. 10/12 cache.h & test-tool.h: add & use "USE_THE_INDEX_VARIABLE"Ævar Arnfjörð Bjarmason, Nov 18, 2022
  13. Taylor BlauNov 18, 2022
  14. 12/12 builtin/*: remove or amend "USE_THE_INDEX_COMPATIBILITY_MACROS"Ævar Arnfjörð Bjarmason, Nov 18, 2022
  15. Taylor BlauNov 18, 2022
  16. Ævar Arnfjörð BjarmasonNov 18, 2022
  17. Taylor BlauNov 18, 2022
  18. 11/12 cocci: apply "pending" index-compatibility to some "builtin/*.c"Ævar Arnfjörð Bjarmason, Nov 18, 2022
  19. Phillip WoodNov 18, 2022
  20. Ævar Arnfjörð BjarmasonNov 18, 2022
  21. 00/11 tree-wide: chip away at USE_THE_INDEX_COMPATIBILITY_MACROSÆvar Arnfjörð Bjarmason, Nov 19, 2022
  22. 01/11 cache.h: remove unused "the_index" compat macrosÆvar Arnfjörð Bjarmason, Nov 19, 2022
  23. 02/11 builtin/{grep,log}.: don't define "USE_THE_INDEX_COMPATIBILITY_MACROS"Ævar Arnfjörð Bjarmason, Nov 19, 2022
  24. 03/11 cocci & cache.h: remove rarely used "the_index" compat macrosÆvar Arnfjörð Bjarmason, Nov 19, 2022
  25. 04/11 read-cache API & users: make discard_index() return voidÆvar Arnfjörð Bjarmason, Nov 19, 2022
  26. 05/11 cocci: add a index-compatibility.pending.cocciÆvar Arnfjörð Bjarmason, Nov 19, 2022
  27. 06/11 cocci & cache.h: apply a selection of "pending" index-compatibilityÆvar Arnfjörð Bjarmason, Nov 19, 2022
  28. 08/11 cocci: apply "pending" index-compatibility to "t/helper/*.c"Ævar Arnfjörð Bjarmason, Nov 19, 2022
  29. 07/11 cocci & cache.h: apply variable section of "pending" index-compatibilityÆvar Arnfjörð Bjarmason, Nov 19, 2022
  30. 09/11 {builtin/*,repository}.c: add & use "USE_THE_INDEX_VARIABLE"Ævar Arnfjörð Bjarmason, Nov 19, 2022
  31. 10/11 cache.h & test-tool.h: add & use "USE_THE_INDEX_VARIABLE"Ævar Arnfjörð Bjarmason, Nov 19, 2022
  32. 11/11 cocci: apply "pending" index-compatibility to some "builtin/*.c"Ævar Arnfjörð Bjarmason, Nov 19, 2022

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.