{"thread":{"id":"61888","subject":"[PATCH] refs: drop `ref_store`-less functions","startedAt":"2024-08-02T05:38:24Z","lastAt":"2024-08-04T16:25:50Z","messageCount":3,"participants":["Patrick Steinhardt","Junio C Hamano","Taylor Blau"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"499933","messageId":"1d9add71065dabb3d7bf81529d04afbcf91e3a69.1722577074.git.ps@pks.im","threadId":"61888","inReplyTo":null,"subject":"[PATCH] refs: drop `ref_store`-less functions","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-08-02T05:38:19Z","receivedAt":"2024-08-02T05:38:24Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"In c8f815c208 (refs: remove functions without ref store, 2024-05-07), we\nhave removed functions of the refs subsystem that do not take a ref\nstore as input parameter. In order to make it easier for folks to figure\nout how to replace calls to such functions in in-flight patch series, we\nkept their definitions around in an ifdeffed block.\n\nNow that Git v2.46 is out, it is rather unlikely that anybody still has\nreferences to these old functions in their unreleased patches. Let's\nthus drop them.\n\nSigned-off-by: Patrick Steinhardt <ps@pks.im>\n---\n refs.h | 207 ---------------------------------------------------------\n 1 file changed, 207 deletions(-)\n\ndiff --git a/refs.h b/refs.h\nindex b3e39bc257..9fbd2cdb2c 100644\n--- a/refs.h\n+++ b/refs.h\n@@ -1086,211 +1086,4 @@ int repo_migrate_ref_storage_format(struct repository *repo,\n \t\t\t\t    unsigned int flags,\n \t\t\t\t    struct strbuf *err);\n \n-/*\n- * The following functions have been removed in Git v2.46 in favor of functions\n- * that receive a `ref_store` as parameter. The intent of this section is\n- * merely to help patch authors of in-flight series to have a reference what\n- * they should be migrating to. The section will be removed in Git v2.47.\n- */\n-#if 0\n-static char *resolve_refdup(const char *refname, int resolve_flags,\n-\t\t\t    struct object_id *oid, int *flags)\n-{\n-\treturn refs_resolve_refdup(get_main_ref_store(the_repository),\n-\t\t\t\t   refname, resolve_flags,\n-\t\t\t\t   oid, flags);\n-}\n-\n-static int read_ref_full(const char *refname, int resolve_flags,\n-\t\t\t struct object_id *oid, int *flags)\n-{\n-\treturn refs_read_ref_full(get_main_ref_store(the_repository), refname,\n-\t\t\t\t  resolve_flags, oid, flags);\n-}\n-\n-static int read_ref(const char *refname, struct object_id *oid)\n-{\n-\treturn refs_read_ref(get_main_ref_store(the_repository), refname, oid);\n-}\n-\n-static int ref_exists(const char *refname)\n-{\n-\treturn refs_ref_exists(get_main_ref_store(the_repository), refname);\n-}\n-\n-static int for_each_tag_ref(each_ref_fn fn, void *cb_data)\n-{\n-\treturn refs_for_each_tag_ref(get_main_ref_store(the_repository), fn, cb_data);\n-}\n-\n-static int for_each_branch_ref(each_ref_fn fn, void *cb_data)\n-{\n-\treturn refs_for_each_branch_ref(get_main_ref_store(the_repository), fn, cb_data);\n-}\n-\n-static int for_each_remote_ref(each_ref_fn fn, void *cb_data)\n-{\n-\treturn refs_for_each_remote_ref(get_main_ref_store(the_repository), fn, cb_data);\n-}\n-\n-static int head_ref_namespaced(each_ref_fn fn, void *cb_data)\n-{\n-\treturn refs_head_ref_namespaced(get_main_ref_store(the_repository),\n-\t\t\t\t\tfn, cb_data);\n-}\n-\n-static int for_each_glob_ref_in(each_ref_fn fn, const char *pattern,\n-\t\t\t\tconst char *prefix, void *cb_data)\n-{\n-\treturn refs_for_each_glob_ref_in(get_main_ref_store(the_repository),\n-\t\t\t\t\t fn, pattern, prefix, cb_data);\n-}\n-\n-static int for_each_glob_ref(each_ref_fn fn, const char *pattern, void *cb_data)\n-{\n-\treturn refs_for_each_glob_ref(get_main_ref_store(the_repository),\n-\t\t\t\t      fn, pattern, cb_data);\n-}\n-\n-static int delete_ref(const char *msg, const char *refname,\n-\t\t      const struct object_id *old_oid, unsigned int flags)\n-{\n-\treturn refs_delete_ref(get_main_ref_store(the_repository), msg, refname,\n-\t\t\t       old_oid, flags);\n-}\n-\n-static struct ref_transaction *ref_transaction_begin(struct strbuf *err)\n-{\n-\treturn ref_store_transaction_begin(get_main_ref_store(the_repository), err);\n-}\n-\n-static int update_ref(const char *msg, const char *refname,\n-\t\t      const struct object_id *new_oid,\n-\t\t      const struct object_id *old_oid,\n-\t\t      unsigned int flags, enum action_on_err onerr)\n-{\n-\treturn refs_update_ref(get_main_ref_store(the_repository), msg, refname, new_oid,\n-\t\t\t       old_oid, flags, onerr);\n-}\n-\n-static char *shorten_unambiguous_ref(const char *refname, int strict)\n-{\n-\treturn refs_shorten_unambiguous_ref(get_main_ref_store(the_repository),\n-\t\t\t\t\t    refname, strict);\n-}\n-\n-static int head_ref(each_ref_fn fn, void *cb_data)\n-{\n-\treturn refs_head_ref(get_main_ref_store(the_repository), fn, cb_data);\n-}\n-\n-static int for_each_ref(each_ref_fn fn, void *cb_data)\n-{\n-\treturn refs_for_each_ref(get_main_ref_store(the_repository), fn, cb_data);\n-}\n-\n-static int for_each_ref_in(const char *prefix, each_ref_fn fn, void *cb_data)\n-{\n-\treturn refs_for_each_ref_in(get_main_ref_store(the_repository), prefix, fn, cb_data);\n-}\n-\n-static int for_each_fullref_in(const char *prefix,\n-\t\t\t       const char **exclude_patterns,\n-\t\t\t       each_ref_fn fn, void *cb_data)\n-{\n-\treturn refs_for_each_fullref_in(get_main_ref_store(the_repository),\n-\t\t\t\t\tprefix, exclude_patterns, fn, cb_data);\n-}\n-\n-static int for_each_namespaced_ref(const char **exclude_patterns,\n-\t\t\t\t   each_ref_fn fn, void *cb_data)\n-{\n-\treturn refs_for_each_namespaced_ref(get_main_ref_store(the_repository),\n-\t\t\t\t\t    exclude_patterns, fn, cb_data);\n-}\n-\n-static int for_each_rawref(each_ref_fn fn, void *cb_data)\n-{\n-\treturn refs_for_each_rawref(get_main_ref_store(the_repository), fn, cb_data);\n-}\n-\n-static const char *resolve_ref_unsafe(const char *refname, int resolve_flags,\n-\t\t\t\t      struct object_id *oid, int *flags)\n-{\n-\treturn refs_resolve_ref_unsafe(get_main_ref_store(the_repository), refname,\n-\t\t\t\t       resolve_flags, oid, flags);\n-}\n-\n-static int create_symref(const char *ref_target, const char *refs_heads_master,\n-\t\t\t const char *logmsg)\n-{\n-\treturn refs_create_symref(get_main_ref_store(the_repository), ref_target,\n-\t\t\t\t  refs_heads_master, logmsg);\n-}\n-\n-static int for_each_reflog(each_reflog_fn fn, void *cb_data)\n-{\n-\treturn refs_for_each_reflog(get_main_ref_store(the_repository), fn, cb_data);\n-}\n-\n-static int for_each_reflog_ent_reverse(const char *refname, each_reflog_ent_fn fn,\n-\t\t\t\t       void *cb_data)\n-{\n-\treturn refs_for_each_reflog_ent_reverse(get_main_ref_store(the_repository),\n-\t\t\t\t\t\trefname, fn, cb_data);\n-}\n-\n-static int for_each_reflog_ent(const char *refname, each_reflog_ent_fn fn,\n-\t\t\t       void *cb_data)\n-{\n-\treturn refs_for_each_reflog_ent(get_main_ref_store(the_repository), refname,\n-\t\t\t\t\tfn, cb_data);\n-}\n-\n-static int reflog_exists(const char *refname)\n-{\n-\treturn refs_reflog_exists(get_main_ref_store(the_repository), refname);\n-}\n-\n-static int safe_create_reflog(const char *refname, struct strbuf *err)\n-{\n-\treturn refs_create_reflog(get_main_ref_store(the_repository), refname,\n-\t\t\t\t  err);\n-}\n-\n-static int delete_reflog(const char *refname)\n-{\n-\treturn refs_delete_reflog(get_main_ref_store(the_repository), refname);\n-}\n-\n-static int reflog_expire(const char *refname,\n-\t\t\t unsigned int flags,\n-\t\t\t reflog_expiry_prepare_fn prepare_fn,\n-\t\t\t reflog_expiry_should_prune_fn should_prune_fn,\n-\t\t\t reflog_expiry_cleanup_fn cleanup_fn,\n-\t\t\t void *policy_cb_data)\n-{\n-\treturn refs_reflog_expire(get_main_ref_store(the_repository),\n-\t\t\t\t  refname, flags,\n-\t\t\t\t  prepare_fn, should_prune_fn,\n-\t\t\t\t  cleanup_fn, policy_cb_data);\n-}\n-\n-static int delete_refs(const char *msg, struct string_list *refnames,\n-\t\t       unsigned int flags)\n-{\n-\treturn refs_delete_refs(get_main_ref_store(the_repository), msg, refnames, flags);\n-}\n-\n-static int rename_ref(const char *oldref, const char *newref, const char *logmsg)\n-{\n-\treturn refs_rename_ref(get_main_ref_store(the_repository), oldref, newref, logmsg);\n-}\n-\n-static int copy_existing_ref(const char *oldref, const char *newref, const char *logmsg)\n-{\n-\treturn refs_copy_existing_ref(get_main_ref_store(the_repository), oldref, newref, logmsg);\n-}\n-#endif\n-\n #endif /* REFS_H */\n-- \n2.46.0.dirty\n\n"},{"id":"499955","messageId":"xmqq34nmgbs1.fsf@gitster.g","threadId":"61888","inReplyTo":"1d9add71065dabb3d7bf81529d04afbcf91e3a69.1722577074.git.ps@pks.im","subject":"Re: [PATCH] refs: drop `ref_store`-less functions","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-08-02T15:55:10Z","receivedAt":"2024-08-02T15:55:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Patrick Steinhardt <ps@pks.im> writes:\n\n> In c8f815c208 (refs: remove functions without ref store, 2024-05-07), we\n> have removed functions of the refs subsystem that do not take a ref\n> store as input parameter. In order to make it easier for folks to figure\n> out how to replace calls to such functions in in-flight patch series, we\n> kept their definitions around in an ifdeffed block.\n\nThanks for not forgetting this.  Will apply.\n"},{"id":"500030","messageId":"Zq+riymYf+oKR4Cl@nand.local","threadId":"61888","inReplyTo":"xmqq34nmgbs1.fsf@gitster.g","subject":"Re: [PATCH] refs: drop `ref_store`-less functions","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2024-08-04T16:25:47Z","receivedAt":"2024-08-04T16:25:50Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Fri, Aug 02, 2024 at 08:55:10AM -0700, Junio C Hamano wrote:\n> Patrick Steinhardt <ps@pks.im> writes:\n>\n> > In c8f815c208 (refs: remove functions without ref store, 2024-05-07), we\n> > have removed functions of the refs subsystem that do not take a ref\n> > store as input parameter. In order to make it easier for folks to figure\n> > out how to replace calls to such functions in in-flight patch series, we\n> > kept their definitions around in an ifdeffed block.\n>\n> Thanks for not forgetting this.  Will apply.\n\nThanks. I agree that it is a fine time to apply this now that we're on\nthe other side of the 2.46 tag.\n\nThanks,\nTaylor\n"}]}