{"thread":{"id":"66177","subject":"[PATCH] chdir-notify.h: Removed unused param 'name'","startedAt":"2026-08-14T19:38:51Z","lastAt":"2026-08-15T05:12:15Z","messageCount":5,"participants":["Colin Hinton","Jeff King","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"550645","messageId":"20260814193849.1538-1-colinlewishinton@gmail.com","threadId":"66177","inReplyTo":null,"subject":"[PATCH] chdir-notify.h: Removed unused param 'name'","fromName":"Colin Hinton","fromEmail":"colinlewishinton@gmail.com","sentAt":"2026-08-14T19:38:49Z","receivedAt":"2026-08-14T19:38:51Z","isPatch":true,"body":"the `name` parameter in `chdir_notify_entry` is only set to NULL.\nDropped to simplify logic in `chdir_notify_unregister`\n\nSigned-off-by: Colin Hinton <colinlewishinton@gmail.com>\n---\n chdir-notify.c          | 12 ++++--------\n chdir-notify.h          |  8 +++-----\n odb/source-files.c      |  7 +++----\n odb/source-loose.c      |  7 +++----\n odb/source-packed.c     |  7 +++----\n refs/files-backend.c    |  7 +++----\n refs/packed-backend.c   |  7 +++----\n refs/reftable-backend.c |  7 +++----\n setup.c                 |  5 ++---\n tmp-objdir.c            |  7 +++----\n 10 files changed, 30 insertions(+), 44 deletions(-)\n\ndiff --git a/chdir-notify.c b/chdir-notify.c\nindex 1237a45e2e..55773c24c9 100644\n--- a/chdir-notify.c\n+++ b/chdir-notify.c\n@@ -7,25 +7,22 @@\n #include \"trace.h\"\n \n struct chdir_notify_entry {\n-\tconst char *name;\n \tchdir_notify_callback cb;\n \tvoid *data;\n \tstruct list_head list;\n };\n static LIST_HEAD(chdir_notify_entries);\n \n-void chdir_notify_register(const char *name,\n-\t\t\t   chdir_notify_callback cb,\n+void chdir_notify_register(chdir_notify_callback cb,\n \t\t\t   void *data)\n {\n \tstruct chdir_notify_entry *e = xmalloc(sizeof(*e));\n-\te->name = name;\n \te->cb = cb;\n \te->data = data;\n \tlist_add_tail(&e->list, &chdir_notify_entries);\n }\n \n-void chdir_notify_unregister(const char *name, chdir_notify_callback cb,\n+void chdir_notify_unregister(chdir_notify_callback cb,\n \t\t\t     void *data)\n {\n \tstruct list_head *pos, *p;\n@@ -34,8 +31,7 @@ void chdir_notify_unregister(const char *name, chdir_notify_callback cb,\n \t\tstruct chdir_notify_entry *e =\n \t\t\tlist_entry(pos, struct chdir_notify_entry, list);\n \n-\t\tif (e->cb != cb || e->data != data || !e->name != !name ||\n-\t\t    (e->name && strcmp(e->name, name)))\n+\t\tif (e->cb != cb || e->data != data)\n \t\t\tcontinue;\n \n \t\tlist_del(pos);\n@@ -64,7 +60,7 @@ int chdir_notify(const char *new_cwd)\n \tlist_for_each(pos, &chdir_notify_entries) {\n \t\tstruct chdir_notify_entry *e =\n \t\t\tlist_entry(pos, struct chdir_notify_entry, list);\n-\t\te->cb(e->name, old_cwd.buf, new_cwd, e->data);\n+\t\te->cb(old_cwd.buf, new_cwd, e->data);\n \t}\n \n \tstrbuf_release(&old_cwd);\ndiff --git a/chdir-notify.h b/chdir-notify.h\nindex 36b4114472..e4ae38e12d 100644\n--- a/chdir-notify.h\n+++ b/chdir-notify.h\n@@ -33,13 +33,11 @@\n  * $GIT_TRACE_SETUP. It may be NULL, but if non-NULL should point to\n  * storage which lasts as long as the registration is active.\n  */\n-typedef void (*chdir_notify_callback)(const char *name,\n-\t\t\t\t      const char *old_cwd,\n+typedef void (*chdir_notify_callback)(const char *old_cwd,\n \t\t\t\t      const char *new_cwd,\n \t\t\t\t      void *data);\n-void chdir_notify_register(const char *name, chdir_notify_callback cb, void *data);\n-void chdir_notify_unregister(const char *name, chdir_notify_callback cb,\n-\t\t\t     void *data);\n+void chdir_notify_register(chdir_notify_callback cb, void *data);\n+void chdir_notify_unregister(chdir_notify_callback cb, void *data);\n \n /*\n  *\ndiff --git a/odb/source-files.c b/odb/source-files.c\nindex 5a68af7d84..c12e2795ba 100644\n--- a/odb/source-files.c\n+++ b/odb/source-files.c\n@@ -22,8 +22,7 @@\n #include \"tree.h\"\n #include \"write-or-die.h\"\n \n-static void odb_source_files_reparent(const char *name UNUSED,\n-\t\t\t\t      const char *old_cwd,\n+static void odb_source_files_reparent(const char *old_cwd,\n \t\t\t\t      const char *new_cwd,\n \t\t\t\t      void *cb_data)\n {\n@@ -37,7 +36,7 @@ static void odb_source_files_reparent(const char *name UNUSED,\n static void odb_source_files_free(struct odb_source *source)\n {\n \tstruct odb_source_files *files = odb_source_files_downcast(source);\n-\tchdir_notify_unregister(NULL, odb_source_files_reparent, files);\n+\tchdir_notify_unregister(odb_source_files_reparent, files);\n \todb_source_free(&files->loose->base);\n \todb_source_free(&files->packed->base);\n \todb_source_release(&files->base);\n@@ -763,7 +762,7 @@ struct odb_source_files *odb_source_files_new(struct object_database *odb,\n \t * paths in the primary ODB source in some user-facing functionality.\n \t */\n \tif (!is_absolute_path(path))\n-\t\tchdir_notify_register(NULL, odb_source_files_reparent, files);\n+\t\tchdir_notify_register(odb_source_files_reparent, files);\n \n \treturn files;\n }\ndiff --git a/odb/source-loose.c b/odb/source-loose.c\nindex ef0e919277..6a594a6458 100644\n--- a/odb/source-loose.c\n+++ b/odb/source-loose.c\n@@ -1006,8 +1006,7 @@ static void odb_source_loose_close(struct odb_source *source UNUSED)\n \t/* Nothing to do. */\n }\n \n-static void odb_source_loose_reparent(const char *name UNUSED,\n-\t\t\t\t      const char *old_cwd,\n+static void odb_source_loose_reparent(const char *old_cwd,\n \t\t\t\t      const char *new_cwd,\n \t\t\t\t      void *cb_data)\n {\n@@ -1023,7 +1022,7 @@ static void odb_source_loose_free(struct odb_source *source)\n \tstruct odb_source_loose *loose = odb_source_loose_downcast(source);\n \todb_source_loose_clear_cache(loose);\n \tloose_object_map_clear(&loose->map);\n-\tchdir_notify_unregister(NULL, odb_source_loose_reparent, loose);\n+\tchdir_notify_unregister(odb_source_loose_reparent, loose);\n \todb_source_release(&loose->base);\n \tfree(loose);\n }\n@@ -1053,7 +1052,7 @@ struct odb_source_loose *odb_source_loose_new(struct object_database *odb,\n \tloose->base.write_alternate = odb_source_loose_write_alternate;\n \n \tif (!is_absolute_path(loose->base.path))\n-\t\tchdir_notify_register(NULL, odb_source_loose_reparent, loose);\n+\t\tchdir_notify_register(odb_source_loose_reparent, loose);\n \n \treturn loose;\n }\ndiff --git a/odb/source-packed.c b/odb/source-packed.c\nindex 0890704e76..8d028971cd 100644\n--- a/odb/source-packed.c\n+++ b/odb/source-packed.c\n@@ -786,8 +786,7 @@ static void odb_source_packed_prepare(struct odb_source *source,\n \tpacked->initialized = true;\n }\n \n-static void odb_source_packed_reparent(const char *name UNUSED,\n-\t\t\t\t       const char *old_cwd,\n+static void odb_source_packed_reparent(const char *old_cwd,\n \t\t\t\t       const char *new_cwd,\n \t\t\t\t       void *cb_data)\n {\n@@ -816,7 +815,7 @@ static void odb_source_packed_free(struct odb_source *source)\n {\n \tstruct odb_source_packed *packed = odb_source_packed_downcast(source);\n \n-\tchdir_notify_unregister(NULL, odb_source_packed_reparent, packed);\n+\tchdir_notify_unregister(odb_source_packed_reparent, packed);\n \n \tfor (struct packfile_list_entry *e = packed->packs.head; e; e = e->next)\n \t\tfree(e->pack);\n@@ -853,7 +852,7 @@ struct odb_source_packed *odb_source_packed_new(struct object_database *odb,\n \tpacked->base.write_alternate = odb_source_packed_write_alternate;\n \n \tif (!is_absolute_path(path))\n-\t\tchdir_notify_register(NULL, odb_source_packed_reparent, packed);\n+\t\tchdir_notify_register(odb_source_packed_reparent, packed);\n \n \treturn packed;\n }\ndiff --git a/refs/files-backend.c b/refs/files-backend.c\nindex 1cc20aa486..71628550f2 100644\n--- a/refs/files-backend.c\n+++ b/refs/files-backend.c\n@@ -111,8 +111,7 @@ static void clear_loose_ref_cache(struct files_ref_store *refs)\n \t}\n }\n \n-static void files_ref_store_reparent(const char *name UNUSED,\n-\t\t\t\t     const char *old_cwd,\n+static void files_ref_store_reparent(const char *old_cwd,\n \t\t\t\t     const char *new_cwd,\n \t\t\t\t     void *payload)\n {\n@@ -182,7 +181,7 @@ static struct ref_store *files_ref_store_init(struct repository *repo,\n \t\tpacked_ref_store_init(repo, NULL, refs->gitcommondir, opts);\n \trefs->store_flags = opts->access_flags;\n \n-\tchdir_notify_register(NULL, files_ref_store_reparent, refs);\n+\tchdir_notify_register(files_ref_store_reparent, refs);\n \n \tstrbuf_release(&refdir);\n \n@@ -234,7 +233,7 @@ static void files_ref_store_release(struct ref_store *ref_store)\n \tfree(refs->gitcommondir);\n \tref_store_release(refs->packed_ref_store);\n \tfree(refs->packed_ref_store);\n-\tchdir_notify_unregister(NULL, files_ref_store_reparent, refs);\n+\tchdir_notify_unregister(files_ref_store_reparent, refs);\n }\n \n static void files_reflog_path(struct files_ref_store *refs,\ndiff --git a/refs/packed-backend.c b/refs/packed-backend.c\nindex b9b04b7010..a73fc6aca7 100644\n--- a/refs/packed-backend.c\n+++ b/refs/packed-backend.c\n@@ -217,8 +217,7 @@ static size_t snapshot_hexsz(const struct snapshot *snapshot)\n \treturn snapshot->refs->base.repo->hash_algo->hexsz;\n }\n \n-static void packed_ref_store_reparent(const char *name UNUSED,\n-\t\t\t\t      const char *old_cwd,\n+static void packed_ref_store_reparent(const char *old_cwd,\n \t\t\t\t      const char *new_cwd,\n \t\t\t\t      void *payload)\n {\n@@ -248,7 +247,7 @@ struct ref_store *packed_ref_store_init(struct repository *repo,\n \n \tstrbuf_addf(&sb, \"%s/packed-refs\", gitdir);\n \trefs->path = strbuf_detach(&sb, NULL);\n-\tchdir_notify_register(NULL, packed_ref_store_reparent, refs);\n+\tchdir_notify_register(packed_ref_store_reparent, refs);\n \treturn ref_store;\n }\n \n@@ -293,7 +292,7 @@ static void packed_ref_store_release(struct ref_store *ref_store)\n \tclear_snapshot(refs);\n \trollback_lock_file(&refs->lock);\n \tdelete_tempfile(&refs->tempfile);\n-\tchdir_notify_unregister(NULL, packed_ref_store_reparent, refs);\n+\tchdir_notify_unregister(packed_ref_store_reparent, refs);\n \tfree(refs->path);\n }\n \ndiff --git a/refs/reftable-backend.c b/refs/reftable-backend.c\nindex 028f0211af..08a75fb328 100644\n--- a/refs/reftable-backend.c\n+++ b/refs/reftable-backend.c\n@@ -391,8 +391,7 @@ static const struct reftable_be_write_options *reftable_be_write_options(struct\n \treturn opts;\n }\n \n-static void reftable_be_reparent(const char *name UNUSED,\n-\t\t\t\t const char *old_cwd,\n+static void reftable_be_reparent(const char *old_cwd,\n \t\t\t\t const char *new_cwd,\n \t\t\t\t void *payload)\n {\n@@ -465,7 +464,7 @@ static struct ref_store *reftable_be_init(struct repository *repo,\n \t\t\tgoto done;\n \t}\n \n-\tchdir_notify_register(NULL, reftable_be_reparent, refs);\n+\tchdir_notify_register(reftable_be_reparent, refs);\n \n done:\n \tassert(refs->err != REFTABLE_API_ERROR);\n@@ -492,7 +491,7 @@ static void reftable_be_release(struct ref_store *ref_store)\n \t\tfree(be);\n \t}\n \tstrmap_clear(&refs->worktree_backends, 0);\n-\tchdir_notify_unregister(NULL, reftable_be_reparent, refs);\n+\tchdir_notify_unregister(reftable_be_reparent, refs);\n }\n \n static int reftable_be_create_on_disk(struct ref_store *ref_store,\ndiff --git a/setup.c b/setup.c\nindex 95909e9603..671f88201d 100644\n--- a/setup.c\n+++ b/setup.c\n@@ -1057,8 +1057,7 @@ static void apply_gitdir_and_environment(struct repository *repo, const char *pa\n \tstrvec_clear(&to_free);\n }\n \n-static void update_relative_gitdir(const char *name UNUSED,\n-\t\t\t\t   const char *old_cwd,\n+static void update_relative_gitdir(const char *old_cwd,\n \t\t\t\t   const char *new_cwd,\n \t\t\t\t   void *data)\n {\n@@ -1086,7 +1085,7 @@ static void apply_and_export_relative_gitdir(struct repository *repo, const char\n \txsetenv(GIT_DIR_ENVIRONMENT, path, 1);\n \n \tif (!is_absolute_path(path))\n-\t\tchdir_notify_register(NULL, update_relative_gitdir, repo);\n+\t\tchdir_notify_register(update_relative_gitdir, repo);\n \n \tstrbuf_release(&realpath);\n }\ndiff --git a/tmp-objdir.c b/tmp-objdir.c\nindex d199d39e7c..520df2df8c 100644\n--- a/tmp-objdir.c\n+++ b/tmp-objdir.c\n@@ -37,8 +37,7 @@ static void tmp_objdir_free(struct tmp_objdir *t)\n \tfree(t);\n }\n \n-static void tmp_objdir_reparent(const char *name UNUSED,\n-\t\t\t\tconst char *old_cwd,\n+static void tmp_objdir_reparent(const char *old_cwd,\n \t\t\t\tconst char *new_cwd,\n \t\t\t\tvoid *cb_data)\n {\n@@ -67,7 +66,7 @@ int tmp_objdir_destroy(struct tmp_objdir *t)\n \n \terr = remove_dir_recursively(&t->path, 0);\n \n-\tchdir_notify_unregister(NULL, tmp_objdir_reparent, t);\n+\tchdir_notify_unregister(tmp_objdir_reparent, t);\n \ttmp_objdir_free(t);\n \n \treturn err;\n@@ -155,7 +154,7 @@ struct tmp_objdir *tmp_objdir_create(struct repository *r,\n \t\t    repo_get_object_directory(r), prefix);\n \n \tif (!is_absolute_path(t->path.buf))\n-\t\tchdir_notify_register(NULL, tmp_objdir_reparent, t);\n+\t\tchdir_notify_register(tmp_objdir_reparent, t);\n \n \tif (!mkdtemp(t->path.buf)) {\n \t\t/* free, not destroy, as we never touched the filesystem */\n-- \n2.55.0.windows.3\n\n"},{"id":"550646","messageId":"20260814203100.GB2575854@coredump.intra.peff.net","threadId":"66177","inReplyTo":"20260814193849.1538-1-colinlewishinton@gmail.com","subject":"Re: [PATCH] chdir-notify.h: Removed unused param 'name'","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2026-08-14T20:31:00Z","receivedAt":"2026-08-14T20:31:02Z","isPatch":true,"body":"On Fri, Aug 14, 2026 at 12:38:49PM -0700, Colin Hinton wrote:\n\n> the `name` parameter in `chdir_notify_entry` is only set to NULL.\n> Dropped to simplify logic in `chdir_notify_unregister`\n\nI think this makes sense. It is often helpful in cleanup patches to\nsummarize the history in the commit message. And then we can be sure\nthat the unused field is OK to be removed, and it is not simply a bug\nthat nobody is passing in the value.\n\nIt looks like these became NULL in the callers across several functions,\nlike 1f43ff2c7e (refs: unregister reference stores from \"chdir_notify\",\n2026-06-25) and 0de2467e6c (odb/source-packed: start converting to a\nproper `struct odb_source`, 2026-06-17). With hunks like this:\n\n  -       chdir_notify_reparent(\"files-backend $GIT_DIR\", &refs->base.gitdir);\n  -       chdir_notify_reparent(\"files-backend $GIT_COMMONDIR\",\n  -                             &refs->gitcommondir);\n  +       chdir_notify_register(NULL, files_ref_store_reparent, refs);\n\nNone of those indicate why they drop the descriptive names in favor of\nNULL.\n\nI think ultimately the reason is that the only user of the \"name\" field\nwas chdir_notify_reparent(), when it produced trace output. That went\naway in 5bf546755c (chdir-notify: drop unused `chdir_notify_reparent()`,\n2026-06-25).\n\nSo those other patches were preparing for that world, though I think the\nordering is somewhat confusing (and I won't be surprised if there was\nsome intermediate state where turning on tracing might have caused a\nsegfault).\n\nSo AFAICT the patch itself is good, but it might be nice to give some\nexplanation in the commit message.\n\n-Peff\n"},{"id":"550648","messageId":"xmqqwltsl9gx.fsf@gitster.g","threadId":"66177","inReplyTo":"20260814203100.GB2575854@coredump.intra.peff.net","subject":"Re: [PATCH] chdir-notify.h: Removed unused param 'name'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-08-14T20:42:54Z","receivedAt":"2026-08-14T20:42:56Z","isPatch":true,"body":"Jeff King <peff@peff.net> writes:\n\n> I think this makes sense. It is often helpful in cleanup patches to\n> summarize the history in the commit message. And then we can be sure\n> that the unused field is OK to be removed, and it is not simply a bug\n> that nobody is passing in the value.\n\nThanks for mentioning this.  I also was curious when we lost the\nusers of \"name\", as it is hard to believe that we introduced name\nthat nobody uses from day one.\n\n> I think ultimately the reason is that the only user of the \"name\" field\n> was chdir_notify_reparent(), when it produced trace output. That went\n> away in 5bf546755c (chdir-notify: drop unused `chdir_notify_reparent()`,\n> 2026-06-25).\n\nOK.  That is fairly recent.  The reason why we used to need reparent\nbut we no longer do is because...?\n\n    ... goes and looks ...\n\nAh, because the files backend of the refs subsystem started solving\nthe issue it used to solve with _reparent() differently in the same\nseries, losing the last caller of the _reparent() API.\n\nMakes sense.\n\n> So those other patches were preparing for that world, though I think the\n> ordering is somewhat confusing (and I won't be surprised if there was\n> some intermediate state where turning on tracing might have caused a\n> segfault).\n>\n> So AFAICT the patch itself is good, but it might be nice to give some\n> explanation in the commit message.\n\nYes, that would be very helpful.\n\nThanks.\n"},{"id":"550650","messageId":"20260814214210.1625-1-colinlewishinton@gmail.com","threadId":"66177","inReplyTo":"20260814193849.1538-1-colinlewishinton@gmail.com","subject":"[PATCH v2] chdir-notify.h: Removed unused param 'name'","fromName":"Colin Hinton","fromEmail":"colinlewishinton@gmail.com","sentAt":"2026-08-14T21:42:10Z","receivedAt":"2026-08-14T21:42:29Z","isPatch":true,"body":"The `name` parameter in `chdir_notify_entry` was only ever used by\nchdir_notify_reparent() to produce trace output. That function was\nremoved in 5bf546755c (chdir-notify: drop unused\n`chdir_notify_reparent()`, 2026-06-25), which left `name` with no\nremaining consumers.\n\nPrior to that removal, most callers had already stopped passing a\nmeaningful name, switching to NULL in 1f43ff2c7e (refs: unregister\nreference stores from \"chdir_notify\", 2026-06-25) and 0de2467e6c\n(odb/source-packed: start converting to a proper `struct odb_source`,\n2026-06-17).\n\nSince no caller has populated `name` with real data for some time,\nand its last consumer is gone, drop it from chdir_notify_register(),\nchdir_notify_unregister(), and the callback signature to simplify\nthe API.\n\nSigned-off-by: Colin Hinton <colinlewishinton@gmail.com>\n---\n chdir-notify.c          | 12 ++++--------\n chdir-notify.h          |  8 +++-----\n odb/source-files.c      |  7 +++----\n odb/source-loose.c      |  7 +++----\n odb/source-packed.c     |  7 +++----\n refs/files-backend.c    |  7 +++----\n refs/packed-backend.c   |  7 +++----\n refs/reftable-backend.c |  7 +++----\n setup.c                 |  5 ++---\n tmp-objdir.c            |  7 +++----\n 10 files changed, 30 insertions(+), 44 deletions(-)\n\ndiff --git a/chdir-notify.c b/chdir-notify.c\nindex 1237a45e2e..55773c24c9 100644\n--- a/chdir-notify.c\n+++ b/chdir-notify.c\n@@ -7,25 +7,22 @@\n #include \"trace.h\"\n \n struct chdir_notify_entry {\n-\tconst char *name;\n \tchdir_notify_callback cb;\n \tvoid *data;\n \tstruct list_head list;\n };\n static LIST_HEAD(chdir_notify_entries);\n \n-void chdir_notify_register(const char *name,\n-\t\t\t   chdir_notify_callback cb,\n+void chdir_notify_register(chdir_notify_callback cb,\n \t\t\t   void *data)\n {\n \tstruct chdir_notify_entry *e = xmalloc(sizeof(*e));\n-\te->name = name;\n \te->cb = cb;\n \te->data = data;\n \tlist_add_tail(&e->list, &chdir_notify_entries);\n }\n \n-void chdir_notify_unregister(const char *name, chdir_notify_callback cb,\n+void chdir_notify_unregister(chdir_notify_callback cb,\n \t\t\t     void *data)\n {\n \tstruct list_head *pos, *p;\n@@ -34,8 +31,7 @@ void chdir_notify_unregister(const char *name, chdir_notify_callback cb,\n \t\tstruct chdir_notify_entry *e =\n \t\t\tlist_entry(pos, struct chdir_notify_entry, list);\n \n-\t\tif (e->cb != cb || e->data != data || !e->name != !name ||\n-\t\t    (e->name && strcmp(e->name, name)))\n+\t\tif (e->cb != cb || e->data != data)\n \t\t\tcontinue;\n \n \t\tlist_del(pos);\n@@ -64,7 +60,7 @@ int chdir_notify(const char *new_cwd)\n \tlist_for_each(pos, &chdir_notify_entries) {\n \t\tstruct chdir_notify_entry *e =\n \t\t\tlist_entry(pos, struct chdir_notify_entry, list);\n-\t\te->cb(e->name, old_cwd.buf, new_cwd, e->data);\n+\t\te->cb(old_cwd.buf, new_cwd, e->data);\n \t}\n \n \tstrbuf_release(&old_cwd);\ndiff --git a/chdir-notify.h b/chdir-notify.h\nindex 36b4114472..e4ae38e12d 100644\n--- a/chdir-notify.h\n+++ b/chdir-notify.h\n@@ -33,13 +33,11 @@\n  * $GIT_TRACE_SETUP. It may be NULL, but if non-NULL should point to\n  * storage which lasts as long as the registration is active.\n  */\n-typedef void (*chdir_notify_callback)(const char *name,\n-\t\t\t\t      const char *old_cwd,\n+typedef void (*chdir_notify_callback)(const char *old_cwd,\n \t\t\t\t      const char *new_cwd,\n \t\t\t\t      void *data);\n-void chdir_notify_register(const char *name, chdir_notify_callback cb, void *data);\n-void chdir_notify_unregister(const char *name, chdir_notify_callback cb,\n-\t\t\t     void *data);\n+void chdir_notify_register(chdir_notify_callback cb, void *data);\n+void chdir_notify_unregister(chdir_notify_callback cb, void *data);\n \n /*\n  *\ndiff --git a/odb/source-files.c b/odb/source-files.c\nindex 5a68af7d84..c12e2795ba 100644\n--- a/odb/source-files.c\n+++ b/odb/source-files.c\n@@ -22,8 +22,7 @@\n #include \"tree.h\"\n #include \"write-or-die.h\"\n \n-static void odb_source_files_reparent(const char *name UNUSED,\n-\t\t\t\t      const char *old_cwd,\n+static void odb_source_files_reparent(const char *old_cwd,\n \t\t\t\t      const char *new_cwd,\n \t\t\t\t      void *cb_data)\n {\n@@ -37,7 +36,7 @@ static void odb_source_files_reparent(const char *name UNUSED,\n static void odb_source_files_free(struct odb_source *source)\n {\n \tstruct odb_source_files *files = odb_source_files_downcast(source);\n-\tchdir_notify_unregister(NULL, odb_source_files_reparent, files);\n+\tchdir_notify_unregister(odb_source_files_reparent, files);\n \todb_source_free(&files->loose->base);\n \todb_source_free(&files->packed->base);\n \todb_source_release(&files->base);\n@@ -763,7 +762,7 @@ struct odb_source_files *odb_source_files_new(struct object_database *odb,\n \t * paths in the primary ODB source in some user-facing functionality.\n \t */\n \tif (!is_absolute_path(path))\n-\t\tchdir_notify_register(NULL, odb_source_files_reparent, files);\n+\t\tchdir_notify_register(odb_source_files_reparent, files);\n \n \treturn files;\n }\ndiff --git a/odb/source-loose.c b/odb/source-loose.c\nindex ef0e919277..6a594a6458 100644\n--- a/odb/source-loose.c\n+++ b/odb/source-loose.c\n@@ -1006,8 +1006,7 @@ static void odb_source_loose_close(struct odb_source *source UNUSED)\n \t/* Nothing to do. */\n }\n \n-static void odb_source_loose_reparent(const char *name UNUSED,\n-\t\t\t\t      const char *old_cwd,\n+static void odb_source_loose_reparent(const char *old_cwd,\n \t\t\t\t      const char *new_cwd,\n \t\t\t\t      void *cb_data)\n {\n@@ -1023,7 +1022,7 @@ static void odb_source_loose_free(struct odb_source *source)\n \tstruct odb_source_loose *loose = odb_source_loose_downcast(source);\n \todb_source_loose_clear_cache(loose);\n \tloose_object_map_clear(&loose->map);\n-\tchdir_notify_unregister(NULL, odb_source_loose_reparent, loose);\n+\tchdir_notify_unregister(odb_source_loose_reparent, loose);\n \todb_source_release(&loose->base);\n \tfree(loose);\n }\n@@ -1053,7 +1052,7 @@ struct odb_source_loose *odb_source_loose_new(struct object_database *odb,\n \tloose->base.write_alternate = odb_source_loose_write_alternate;\n \n \tif (!is_absolute_path(loose->base.path))\n-\t\tchdir_notify_register(NULL, odb_source_loose_reparent, loose);\n+\t\tchdir_notify_register(odb_source_loose_reparent, loose);\n \n \treturn loose;\n }\ndiff --git a/odb/source-packed.c b/odb/source-packed.c\nindex 0890704e76..8d028971cd 100644\n--- a/odb/source-packed.c\n+++ b/odb/source-packed.c\n@@ -786,8 +786,7 @@ static void odb_source_packed_prepare(struct odb_source *source,\n \tpacked->initialized = true;\n }\n \n-static void odb_source_packed_reparent(const char *name UNUSED,\n-\t\t\t\t       const char *old_cwd,\n+static void odb_source_packed_reparent(const char *old_cwd,\n \t\t\t\t       const char *new_cwd,\n \t\t\t\t       void *cb_data)\n {\n@@ -816,7 +815,7 @@ static void odb_source_packed_free(struct odb_source *source)\n {\n \tstruct odb_source_packed *packed = odb_source_packed_downcast(source);\n \n-\tchdir_notify_unregister(NULL, odb_source_packed_reparent, packed);\n+\tchdir_notify_unregister(odb_source_packed_reparent, packed);\n \n \tfor (struct packfile_list_entry *e = packed->packs.head; e; e = e->next)\n \t\tfree(e->pack);\n@@ -853,7 +852,7 @@ struct odb_source_packed *odb_source_packed_new(struct object_database *odb,\n \tpacked->base.write_alternate = odb_source_packed_write_alternate;\n \n \tif (!is_absolute_path(path))\n-\t\tchdir_notify_register(NULL, odb_source_packed_reparent, packed);\n+\t\tchdir_notify_register(odb_source_packed_reparent, packed);\n \n \treturn packed;\n }\ndiff --git a/refs/files-backend.c b/refs/files-backend.c\nindex 1cc20aa486..71628550f2 100644\n--- a/refs/files-backend.c\n+++ b/refs/files-backend.c\n@@ -111,8 +111,7 @@ static void clear_loose_ref_cache(struct files_ref_store *refs)\n \t}\n }\n \n-static void files_ref_store_reparent(const char *name UNUSED,\n-\t\t\t\t     const char *old_cwd,\n+static void files_ref_store_reparent(const char *old_cwd,\n \t\t\t\t     const char *new_cwd,\n \t\t\t\t     void *payload)\n {\n@@ -182,7 +181,7 @@ static struct ref_store *files_ref_store_init(struct repository *repo,\n \t\tpacked_ref_store_init(repo, NULL, refs->gitcommondir, opts);\n \trefs->store_flags = opts->access_flags;\n \n-\tchdir_notify_register(NULL, files_ref_store_reparent, refs);\n+\tchdir_notify_register(files_ref_store_reparent, refs);\n \n \tstrbuf_release(&refdir);\n \n@@ -234,7 +233,7 @@ static void files_ref_store_release(struct ref_store *ref_store)\n \tfree(refs->gitcommondir);\n \tref_store_release(refs->packed_ref_store);\n \tfree(refs->packed_ref_store);\n-\tchdir_notify_unregister(NULL, files_ref_store_reparent, refs);\n+\tchdir_notify_unregister(files_ref_store_reparent, refs);\n }\n \n static void files_reflog_path(struct files_ref_store *refs,\ndiff --git a/refs/packed-backend.c b/refs/packed-backend.c\nindex b9b04b7010..a73fc6aca7 100644\n--- a/refs/packed-backend.c\n+++ b/refs/packed-backend.c\n@@ -217,8 +217,7 @@ static size_t snapshot_hexsz(const struct snapshot *snapshot)\n \treturn snapshot->refs->base.repo->hash_algo->hexsz;\n }\n \n-static void packed_ref_store_reparent(const char *name UNUSED,\n-\t\t\t\t      const char *old_cwd,\n+static void packed_ref_store_reparent(const char *old_cwd,\n \t\t\t\t      const char *new_cwd,\n \t\t\t\t      void *payload)\n {\n@@ -248,7 +247,7 @@ struct ref_store *packed_ref_store_init(struct repository *repo,\n \n \tstrbuf_addf(&sb, \"%s/packed-refs\", gitdir);\n \trefs->path = strbuf_detach(&sb, NULL);\n-\tchdir_notify_register(NULL, packed_ref_store_reparent, refs);\n+\tchdir_notify_register(packed_ref_store_reparent, refs);\n \treturn ref_store;\n }\n \n@@ -293,7 +292,7 @@ static void packed_ref_store_release(struct ref_store *ref_store)\n \tclear_snapshot(refs);\n \trollback_lock_file(&refs->lock);\n \tdelete_tempfile(&refs->tempfile);\n-\tchdir_notify_unregister(NULL, packed_ref_store_reparent, refs);\n+\tchdir_notify_unregister(packed_ref_store_reparent, refs);\n \tfree(refs->path);\n }\n \ndiff --git a/refs/reftable-backend.c b/refs/reftable-backend.c\nindex 028f0211af..08a75fb328 100644\n--- a/refs/reftable-backend.c\n+++ b/refs/reftable-backend.c\n@@ -391,8 +391,7 @@ static const struct reftable_be_write_options *reftable_be_write_options(struct\n \treturn opts;\n }\n \n-static void reftable_be_reparent(const char *name UNUSED,\n-\t\t\t\t const char *old_cwd,\n+static void reftable_be_reparent(const char *old_cwd,\n \t\t\t\t const char *new_cwd,\n \t\t\t\t void *payload)\n {\n@@ -465,7 +464,7 @@ static struct ref_store *reftable_be_init(struct repository *repo,\n \t\t\tgoto done;\n \t}\n \n-\tchdir_notify_register(NULL, reftable_be_reparent, refs);\n+\tchdir_notify_register(reftable_be_reparent, refs);\n \n done:\n \tassert(refs->err != REFTABLE_API_ERROR);\n@@ -492,7 +491,7 @@ static void reftable_be_release(struct ref_store *ref_store)\n \t\tfree(be);\n \t}\n \tstrmap_clear(&refs->worktree_backends, 0);\n-\tchdir_notify_unregister(NULL, reftable_be_reparent, refs);\n+\tchdir_notify_unregister(reftable_be_reparent, refs);\n }\n \n static int reftable_be_create_on_disk(struct ref_store *ref_store,\ndiff --git a/setup.c b/setup.c\nindex 95909e9603..671f88201d 100644\n--- a/setup.c\n+++ b/setup.c\n@@ -1057,8 +1057,7 @@ static void apply_gitdir_and_environment(struct repository *repo, const char *pa\n \tstrvec_clear(&to_free);\n }\n \n-static void update_relative_gitdir(const char *name UNUSED,\n-\t\t\t\t   const char *old_cwd,\n+static void update_relative_gitdir(const char *old_cwd,\n \t\t\t\t   const char *new_cwd,\n \t\t\t\t   void *data)\n {\n@@ -1086,7 +1085,7 @@ static void apply_and_export_relative_gitdir(struct repository *repo, const char\n \txsetenv(GIT_DIR_ENVIRONMENT, path, 1);\n \n \tif (!is_absolute_path(path))\n-\t\tchdir_notify_register(NULL, update_relative_gitdir, repo);\n+\t\tchdir_notify_register(update_relative_gitdir, repo);\n \n \tstrbuf_release(&realpath);\n }\ndiff --git a/tmp-objdir.c b/tmp-objdir.c\nindex d199d39e7c..520df2df8c 100644\n--- a/tmp-objdir.c\n+++ b/tmp-objdir.c\n@@ -37,8 +37,7 @@ static void tmp_objdir_free(struct tmp_objdir *t)\n \tfree(t);\n }\n \n-static void tmp_objdir_reparent(const char *name UNUSED,\n-\t\t\t\tconst char *old_cwd,\n+static void tmp_objdir_reparent(const char *old_cwd,\n \t\t\t\tconst char *new_cwd,\n \t\t\t\tvoid *cb_data)\n {\n@@ -67,7 +66,7 @@ int tmp_objdir_destroy(struct tmp_objdir *t)\n \n \terr = remove_dir_recursively(&t->path, 0);\n \n-\tchdir_notify_unregister(NULL, tmp_objdir_reparent, t);\n+\tchdir_notify_unregister(tmp_objdir_reparent, t);\n \ttmp_objdir_free(t);\n \n \treturn err;\n@@ -155,7 +154,7 @@ struct tmp_objdir *tmp_objdir_create(struct repository *r,\n \t\t    repo_get_object_directory(r), prefix);\n \n \tif (!is_absolute_path(t->path.buf))\n-\t\tchdir_notify_register(NULL, tmp_objdir_reparent, t);\n+\t\tchdir_notify_register(tmp_objdir_reparent, t);\n \n \tif (!mkdtemp(t->path.buf)) {\n \t\t/* free, not destroy, as we never touched the filesystem */\n-- \n2.55.0.windows.3\n\n"},{"id":"550655","messageId":"20260815051213.GA26013@coredump.intra.peff.net","threadId":"66177","inReplyTo":"20260814214210.1625-1-colinlewishinton@gmail.com","subject":"Re: [PATCH v2] chdir-notify.h: Removed unused param 'name'","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2026-08-15T05:12:13Z","receivedAt":"2026-08-15T05:12:15Z","isPatch":true,"body":"On Fri, Aug 14, 2026 at 02:42:10PM -0700, Colin Hinton wrote:\n\n> The `name` parameter in `chdir_notify_entry` was only ever used by\n> chdir_notify_reparent() to produce trace output. That function was\n> removed in 5bf546755c (chdir-notify: drop unused\n> `chdir_notify_reparent()`, 2026-06-25), which left `name` with no\n> remaining consumers.\n> \n> Prior to that removal, most callers had already stopped passing a\n> meaningful name, switching to NULL in 1f43ff2c7e (refs: unregister\n> reference stores from \"chdir_notify\", 2026-06-25) and 0de2467e6c\n> (odb/source-packed: start converting to a proper `struct odb_source`,\n> 2026-06-17).\n> \n> Since no caller has populated `name` with real data for some time,\n> and its last consumer is gone, drop it from chdir_notify_register(),\n> chdir_notify_unregister(), and the callback signature to simplify\n> the API.\n\nThanks, this description summarizes the situation nicely.\n\n-Peff\n"}]}