chdir-notify.h: Removed unused param 'name'
PATCH 1/1 chdir-notify.h: Removed unused param 'name'
the name parameter in chdir_notify_entry is only set to NULL. Dropped to simplify logic in chdir_notify_unregister
--- chdir-notify.c | 12 ++++-------- chdir-notify.h | 8 +++----- odb/source-files.c | 7 +++---- odb/source-loose.c | 7 +++---- odb/source-packed.c | 7 +++---- refs/files-backend.c | 7 +++---- refs/packed-backend.c | 7 +++---- refs/reftable-backend.c | 7 +++---- setup.c | 5 ++--- tmp-objdir.c | 7 +++---- 10 files changed, 30 insertions(+), 44 deletions(-)
chdir-notify.c +4 -8
@@ -7,25 +7,22 @@#include "trace.h" struct chdir_notify_entry { -const char *name;chdir_notify_callback cb;void *data;struct list_head list; };static LIST_HEAD (chdir_notify_entries); -void chdir_notify_register (const char *name, -chdir_notify_callback cb, +void chdir_notify_register (chdir_notify_callback cb,void *data) {struct chdir_notify_entry *e =xmalloc (sizeof (*e)); - e->name = name; e->cb = cb; e->data = data;list_add_tail (&e->list, &chdir_notify_entries); } -void chdir_notify_unregister (const char *name,chdir_notify_callback cb, +void chdir_notify_unregister (chdir_notify_callback cb,void *data) {struct list_head *pos, *p;
@@ -34,8 +31,7 @@ void chdir_notify_unregister(const char *name, chdir_notify_callback cb,struct chdir_notify_entry *e = list_entry(pos, struct chdir_notify_entry, list); -if (e->cb != cb || e->data != data || !e->name != !name || - (e->name &&strcmp (e->name, name))) +if (e->cb != cb || e->data != data)continue ;list_del (pos);
@@ -64,7 +60,7 @@ int chdir_notify(const char *new_cwd)list_for_each (pos, &chdir_notify_entries) {struct chdir_notify_entry *e = list_entry(pos, struct chdir_notify_entry, list); - e->cb (e->name, old_cwd.buf, new_cwd, e->data); + e->cb (old_cwd.buf, new_cwd, e->data); }strbuf_release (&old_cwd);
chdir-notify.h +3 -5
@@ -33,13 +33,11 @@* $GIT_TRACE_SETUP. It may be NULL, but if non-NULL should point to * storage which lasts as long as the registration is active. */ -typedef void (*chdir_notify_callback )(const char *name, -const char *old_cwd, +typedef void (*chdir_notify_callback )(const char *old_cwd,const char *new_cwd,void *data); -void chdir_notify_register (const char *name,chdir_notify_callback cb,void *data); -void chdir_notify_unregister (const char *name,chdir_notify_callback cb, -void *data); +void chdir_notify_register (chdir_notify_callback cb,void *data); +void chdir_notify_unregister (chdir_notify_callback cb,void *data);/* *
odb/source-files.c +3 -4
@@ -22,8 +22,7 @@#include "tree.h" #include "write-or-die.h" -static void odb_source_files_reparent(const char *name UNUSED, -const char *old_cwd, +static void odb_source_files_reparent (const char *old_cwd,const char *new_cwd,void *cb_data) {
@@ -37,7 +36,7 @@ static void odb_source_files_reparent(const char *name UNUSED,static void odb_source_files_free (struct odb_source *source) {struct odb_source_files *files =odb_source_files_downcast (source); -chdir_notify_unregister (NULL , odb_source_files_reparent, files); +chdir_notify_unregister (odb_source_files_reparent, files);odb_source_free (&files->loose->base);odb_source_free (&files->packed->base);odb_source_release (&files->base);
@@ -763,7 +762,7 @@ struct odb_source_files *odb_source_files_new(struct object_database *odb,* paths in the primary ODB source in some user-facing functionality. */ if (!is_absolute_path (path)) -chdir_notify_register (NULL , odb_source_files_reparent, files); +chdir_notify_register (odb_source_files_reparent, files);return files; }
odb/source-loose.c +3 -4
@@ -1006,8 +1006,7 @@ static void odb_source_loose_close(struct odb_source *source UNUSED)/* Nothing to do. */ } -static void odb_source_loose_reparent(const char *name UNUSED, -const char *old_cwd, +static void odb_source_loose_reparent (const char *old_cwd,const char *new_cwd,void *cb_data) {
@@ -1023,7 +1022,7 @@ static void odb_source_loose_free(struct odb_source *source)struct odb_source_loose *loose =odb_source_loose_downcast (source);odb_source_loose_clear_cache (loose);loose_object_map_clear (&loose->map); -chdir_notify_unregister (NULL , odb_source_loose_reparent, loose); +chdir_notify_unregister (odb_source_loose_reparent, loose);odb_source_release (&loose->base);free (loose); }
@@ -1053,7 +1052,7 @@ struct odb_source_loose *odb_source_loose_new(struct object_database *odb, loose->base.write_alternate = odb_source_loose_write_alternate;if (!is_absolute_path (loose->base.path)) -chdir_notify_register (NULL , odb_source_loose_reparent, loose); +chdir_notify_register (odb_source_loose_reparent, loose);return loose; }
odb/source-packed.c +3 -4
@@ -786,8 +786,7 @@ static void odb_source_packed_prepare(struct odb_source *source, packed->initialized = true; } -static void odb_source_packed_reparent(const char *name UNUSED, -const char *old_cwd, +static void odb_source_packed_reparent (const char *old_cwd,const char *new_cwd,void *cb_data) {
@@ -816,7 +815,7 @@ static void odb_source_packed_free(struct odb_source *source) {struct odb_source_packed *packed =odb_source_packed_downcast (source); -chdir_notify_unregister (NULL , odb_source_packed_reparent, packed); +chdir_notify_unregister (odb_source_packed_reparent, packed);for (struct packfile_list_entry *e = packed->packs.head; e; e = e->next)free (e->pack);
@@ -853,7 +852,7 @@ struct odb_source_packed *odb_source_packed_new(struct object_database *odb, packed->base.write_alternate = odb_source_packed_write_alternate;if (!is_absolute_path (path)) -chdir_notify_register (NULL , odb_source_packed_reparent, packed); +chdir_notify_register (odb_source_packed_reparent, packed);return packed; }
refs/files-backend.c +3 -4
@@ -111,8 +111,7 @@ static void clear_loose_ref_cache(struct files_ref_store *refs) } } -static void files_ref_store_reparent(const char *name UNUSED, -const char *old_cwd, +static void files_ref_store_reparent (const char *old_cwd,const char *new_cwd,void *payload) {
@@ -182,7 +181,7 @@ static struct ref_store *files_ref_store_init(struct repository *repo,packed_ref_store_init (repo,NULL , refs->gitcommondir, opts); refs->store_flags = opts->access_flags; -chdir_notify_register (NULL , files_ref_store_reparent, refs); +chdir_notify_register (files_ref_store_reparent, refs);strbuf_release (&refdir);
@@ -234,7 +233,7 @@ static void files_ref_store_release(struct ref_store *ref_store)free (refs->gitcommondir);ref_store_release (refs->packed_ref_store);free (refs->packed_ref_store); -chdir_notify_unregister (NULL , files_ref_store_reparent, refs); +chdir_notify_unregister (files_ref_store_reparent, refs); } static void files_reflog_path(struct files_ref_store *refs,
refs/packed-backend.c +3 -4
@@ -217,8 +217,7 @@ static size_t snapshot_hexsz(const struct snapshot *snapshot)return snapshot->refs->base.repo->hash_algo->hexsz; } -static void packed_ref_store_reparent(const char *name UNUSED, -const char *old_cwd, +static void packed_ref_store_reparent (const char *old_cwd,const char *new_cwd,void *payload) {
@@ -248,7 +247,7 @@ struct ref_store *packed_ref_store_init(struct repository *repo,strbuf_addf (&sb,"%s/packed-refs" , gitdir); refs->path =strbuf_detach (&sb,NULL ); -chdir_notify_register (NULL , packed_ref_store_reparent, refs); +chdir_notify_register (packed_ref_store_reparent, refs);return ref_store; }
@@ -293,7 +292,7 @@ static void packed_ref_store_release(struct ref_store *ref_store)clear_snapshot (refs);rollback_lock_file (&refs->lock);delete_tempfile (&refs->tempfile); -chdir_notify_unregister (NULL , packed_ref_store_reparent, refs); +chdir_notify_unregister (packed_ref_store_reparent, refs);free (refs->path); }
refs/reftable-backend.c +3 -4
@@ -391,8 +391,7 @@ static const struct reftable_be_write_options *reftable_be_write_options(structreturn opts; } -static void reftable_be_reparent(const char *name UNUSED, -const char *old_cwd, +static void reftable_be_reparent (const char *old_cwd,const char *new_cwd,void *payload) {
@@ -465,7 +464,7 @@ static struct ref_store *reftable_be_init(struct repository *repo, goto done; } -chdir_notify_register (NULL , reftable_be_reparent, refs); +chdir_notify_register (reftable_be_reparent, refs); done:assert (refs->err !=REFTABLE_API_ERROR );
@@ -492,7 +491,7 @@ static void reftable_be_release(struct ref_store *ref_store)free (be); }strmap_clear (&refs->worktree_backends,0 ); -chdir_notify_unregister (NULL , reftable_be_reparent, refs); +chdir_notify_unregister (reftable_be_reparent, refs); } static int reftable_be_create_on_disk(struct ref_store *ref_store,
setup.c +2 -3
@@ -1057,8 +1057,7 @@ static void apply_gitdir_and_environment(struct repository *repo, const char *pastrvec_clear (&to_free); } -static void update_relative_gitdir(const char *name UNUSED, -const char *old_cwd, +static void update_relative_gitdir (const char *old_cwd,const char *new_cwd,void *data) {
@@ -1086,7 +1085,7 @@ static void apply_and_export_relative_gitdir(struct repository *repo, const charxsetenv (GIT_DIR_ENVIRONMENT , path,1 );if (!is_absolute_path (path)) -chdir_notify_register (NULL , update_relative_gitdir, repo); +chdir_notify_register (update_relative_gitdir, repo);strbuf_release (&realpath); }
tmp-objdir.c +3 -4
@@ -37,8 +37,7 @@ static void tmp_objdir_free(struct tmp_objdir *t)free (t); } -static void tmp_objdir_reparent(const char *name UNUSED, -const char *old_cwd, +static void tmp_objdir_reparent (const char *old_cwd,const char *new_cwd,void *cb_data) {
@@ -67,7 +66,7 @@ int tmp_objdir_destroy(struct tmp_objdir *t) err =remove_dir_recursively (&t->path,0 ); -chdir_notify_unregister (NULL , tmp_objdir_reparent, t); +chdir_notify_unregister (tmp_objdir_reparent, t);tmp_objdir_free (t);return err;
@@ -155,7 +154,7 @@ struct tmp_objdir *tmp_objdir_create(struct repository *r, repo_get_object_directory(r), prefix);if (!is_absolute_path (t->path.buf)) -chdir_notify_register (NULL , tmp_objdir_reparent, t); +chdir_notify_register (tmp_objdir_reparent, t);if (!mkdtemp (t->path.buf)) {/* free, not destroy, as we never touched the filesystem */
Signature · 1 line
2.55.0.windows.3
Quoted 2 lines · Colin Hinton
the
nameparameter inchdir_notify_entryis only set to NULL. Dropped to simplify logic inchdir_notify_unregister
I think this makes sense. It is often helpful in cleanup patches to summarize the history in the commit message. And then we can be sure that the unused field is OK to be removed, and it is not simply a bug that nobody is passing in the value.
It looks like these became NULL in the callers across several functions, like 1f43ff2c7e (refs: unregister reference stores from "chdir_notify", 2026-06-25) and 0de2467e6c (odb/source-packed: start converting to a proper struct odb_source, 2026-06-17). With hunks like this:
- chdir_notify_reparent("files-backend $GIT_DIR", &refs->base.gitdir);
- chdir_notify_reparent("files-backend $GIT_COMMONDIR",
- &refs->gitcommondir);
+ chdir_notify_register(NULL, files_ref_store_reparent, refs);
None of those indicate why they drop the descriptive names in favor of NULL.
I think ultimately the reason is that the only user of the "name" field was chdir_notify_reparent(), when it produced trace output. That went away in 5bf546755c (chdir-notify: drop unused chdir_notify_reparent(), 2026-06-25).
So those other patches were preparing for that world, though I think the ordering is somewhat confusing (and I won't be surprised if there was some intermediate state where turning on tracing might have caused a segfault).
So AFAICT the patch itself is good, but it might be nice to give some explanation in the commit message.
-Peff
Quoted 4 lines · Jeff King
I think this makes sense. It is often helpful in cleanup patches to summarize the history in the commit message. And then we can be sure that the unused field is OK to be removed, and it is not simply a bug that nobody is passing in the value.
Thanks for mentioning this. I also was curious when we lost the users of "name", as it is hard to believe that we introduced name that nobody uses from day one.
Quoted 4 lines
I think ultimately the reason is that the only user of the "name" field was
chdir_notify_reparent(), when it produced trace output. That went away in5bf546755c(chdir-notify: drop unusedchdir_notify_reparent(), 2026-06-25).
OK. That is fairly recent. The reason why we used to need reparent but we no longer do is because...?
... goes and looks ...
Ah, because the files backend of the refs subsystem started solving the issue it used to solve with _reparent() differently in the same series, losing the last caller of the _reparent() API.
Makes sense.
Quoted 7 lines
So those other patches were preparing for that world, though I think the ordering is somewhat confusing (and I won't be surprised if there was some intermediate state where turning on tracing might have caused a segfault).
So AFAICT the patch itself is good, but it might be nice to give some explanation in the commit message.
Yes, that would be very helpful.
Thanks.
PATCH v2 1/1 chdir-notify.h: Removed unused param 'name'
In reply to Colin HintonThe name parameter in chdir_notify_entry was only ever used by chdir_notify_reparent() to produce trace output. That function was removed in 5bf546755c (chdir-notify: drop unused chdir_notify_reparent(), 2026-06-25), which left name with no remaining consumers.
Prior to that removal, most callers had already stopped passing a meaningful name, switching to NULL in 1f43ff2c7e (refs: unregister reference stores from "chdir_notify", 2026-06-25) and 0de2467e6c (odb/source-packed: start converting to a proper struct odb_source, 2026-06-17).
Since no caller has populated name with real data for some time, and its last consumer is gone, drop it from chdir_notify_register(), chdir_notify_unregister(), and the callback signature to simplify the API.
--- chdir-notify.c | 12 ++++-------- chdir-notify.h | 8 +++----- odb/source-files.c | 7 +++---- odb/source-loose.c | 7 +++---- odb/source-packed.c | 7 +++---- refs/files-backend.c | 7 +++---- refs/packed-backend.c | 7 +++---- refs/reftable-backend.c | 7 +++---- setup.c | 5 ++--- tmp-objdir.c | 7 +++---- 10 files changed, 30 insertions(+), 44 deletions(-)
chdir-notify.c +4 -8
@@ -7,25 +7,22 @@#include "trace.h" struct chdir_notify_entry { -const char *name;chdir_notify_callback cb;void *data;struct list_head list; };static LIST_HEAD (chdir_notify_entries); -void chdir_notify_register (const char *name, -chdir_notify_callback cb, +void chdir_notify_register (chdir_notify_callback cb,void *data) {struct chdir_notify_entry *e =xmalloc (sizeof (*e)); - e->name = name; e->cb = cb; e->data = data;list_add_tail (&e->list, &chdir_notify_entries); } -void chdir_notify_unregister (const char *name,chdir_notify_callback cb, +void chdir_notify_unregister (chdir_notify_callback cb,void *data) {struct list_head *pos, *p;
@@ -34,8 +31,7 @@ void chdir_notify_unregister(const char *name, chdir_notify_callback cb,struct chdir_notify_entry *e = list_entry(pos, struct chdir_notify_entry, list); -if (e->cb != cb || e->data != data || !e->name != !name || - (e->name &&strcmp (e->name, name))) +if (e->cb != cb || e->data != data)continue ;list_del (pos);
@@ -64,7 +60,7 @@ int chdir_notify(const char *new_cwd)list_for_each (pos, &chdir_notify_entries) {struct chdir_notify_entry *e = list_entry(pos, struct chdir_notify_entry, list); - e->cb (e->name, old_cwd.buf, new_cwd, e->data); + e->cb (old_cwd.buf, new_cwd, e->data); }strbuf_release (&old_cwd);
chdir-notify.h +3 -5
@@ -33,13 +33,11 @@* $GIT_TRACE_SETUP. It may be NULL, but if non-NULL should point to * storage which lasts as long as the registration is active. */ -typedef void (*chdir_notify_callback )(const char *name, -const char *old_cwd, +typedef void (*chdir_notify_callback )(const char *old_cwd,const char *new_cwd,void *data); -void chdir_notify_register (const char *name,chdir_notify_callback cb,void *data); -void chdir_notify_unregister (const char *name,chdir_notify_callback cb, -void *data); +void chdir_notify_register (chdir_notify_callback cb,void *data); +void chdir_notify_unregister (chdir_notify_callback cb,void *data);/* *
odb/source-files.c +3 -4
@@ -22,8 +22,7 @@#include "tree.h" #include "write-or-die.h" -static void odb_source_files_reparent(const char *name UNUSED, -const char *old_cwd, +static void odb_source_files_reparent (const char *old_cwd,const char *new_cwd,void *cb_data) {
@@ -37,7 +36,7 @@ static void odb_source_files_reparent(const char *name UNUSED,static void odb_source_files_free (struct odb_source *source) {struct odb_source_files *files =odb_source_files_downcast (source); -chdir_notify_unregister (NULL , odb_source_files_reparent, files); +chdir_notify_unregister (odb_source_files_reparent, files);odb_source_free (&files->loose->base);odb_source_free (&files->packed->base);odb_source_release (&files->base);
@@ -763,7 +762,7 @@ struct odb_source_files *odb_source_files_new(struct object_database *odb,* paths in the primary ODB source in some user-facing functionality. */ if (!is_absolute_path (path)) -chdir_notify_register (NULL , odb_source_files_reparent, files); +chdir_notify_register (odb_source_files_reparent, files);return files; }
odb/source-loose.c +3 -4
@@ -1006,8 +1006,7 @@ static void odb_source_loose_close(struct odb_source *source UNUSED)/* Nothing to do. */ } -static void odb_source_loose_reparent(const char *name UNUSED, -const char *old_cwd, +static void odb_source_loose_reparent (const char *old_cwd,const char *new_cwd,void *cb_data) {
@@ -1023,7 +1022,7 @@ static void odb_source_loose_free(struct odb_source *source)struct odb_source_loose *loose =odb_source_loose_downcast (source);odb_source_loose_clear_cache (loose);loose_object_map_clear (&loose->map); -chdir_notify_unregister (NULL , odb_source_loose_reparent, loose); +chdir_notify_unregister (odb_source_loose_reparent, loose);odb_source_release (&loose->base);free (loose); }
@@ -1053,7 +1052,7 @@ struct odb_source_loose *odb_source_loose_new(struct object_database *odb, loose->base.write_alternate = odb_source_loose_write_alternate;if (!is_absolute_path (loose->base.path)) -chdir_notify_register (NULL , odb_source_loose_reparent, loose); +chdir_notify_register (odb_source_loose_reparent, loose);return loose; }
odb/source-packed.c +3 -4
@@ -786,8 +786,7 @@ static void odb_source_packed_prepare(struct odb_source *source, packed->initialized = true; } -static void odb_source_packed_reparent(const char *name UNUSED, -const char *old_cwd, +static void odb_source_packed_reparent (const char *old_cwd,const char *new_cwd,void *cb_data) {
@@ -816,7 +815,7 @@ static void odb_source_packed_free(struct odb_source *source) {struct odb_source_packed *packed =odb_source_packed_downcast (source); -chdir_notify_unregister (NULL , odb_source_packed_reparent, packed); +chdir_notify_unregister (odb_source_packed_reparent, packed);for (struct packfile_list_entry *e = packed->packs.head; e; e = e->next)free (e->pack);
@@ -853,7 +852,7 @@ struct odb_source_packed *odb_source_packed_new(struct object_database *odb, packed->base.write_alternate = odb_source_packed_write_alternate;if (!is_absolute_path (path)) -chdir_notify_register (NULL , odb_source_packed_reparent, packed); +chdir_notify_register (odb_source_packed_reparent, packed);return packed; }
refs/files-backend.c +3 -4
@@ -111,8 +111,7 @@ static void clear_loose_ref_cache(struct files_ref_store *refs) } } -static void files_ref_store_reparent(const char *name UNUSED, -const char *old_cwd, +static void files_ref_store_reparent (const char *old_cwd,const char *new_cwd,void *payload) {
@@ -182,7 +181,7 @@ static struct ref_store *files_ref_store_init(struct repository *repo,packed_ref_store_init (repo,NULL , refs->gitcommondir, opts); refs->store_flags = opts->access_flags; -chdir_notify_register (NULL , files_ref_store_reparent, refs); +chdir_notify_register (files_ref_store_reparent, refs);strbuf_release (&refdir);
@@ -234,7 +233,7 @@ static void files_ref_store_release(struct ref_store *ref_store)free (refs->gitcommondir);ref_store_release (refs->packed_ref_store);free (refs->packed_ref_store); -chdir_notify_unregister (NULL , files_ref_store_reparent, refs); +chdir_notify_unregister (files_ref_store_reparent, refs); } static void files_reflog_path(struct files_ref_store *refs,
refs/packed-backend.c +3 -4
@@ -217,8 +217,7 @@ static size_t snapshot_hexsz(const struct snapshot *snapshot)return snapshot->refs->base.repo->hash_algo->hexsz; } -static void packed_ref_store_reparent(const char *name UNUSED, -const char *old_cwd, +static void packed_ref_store_reparent (const char *old_cwd,const char *new_cwd,void *payload) {
@@ -248,7 +247,7 @@ struct ref_store *packed_ref_store_init(struct repository *repo,strbuf_addf (&sb,"%s/packed-refs" , gitdir); refs->path =strbuf_detach (&sb,NULL ); -chdir_notify_register (NULL , packed_ref_store_reparent, refs); +chdir_notify_register (packed_ref_store_reparent, refs);return ref_store; }
@@ -293,7 +292,7 @@ static void packed_ref_store_release(struct ref_store *ref_store)clear_snapshot (refs);rollback_lock_file (&refs->lock);delete_tempfile (&refs->tempfile); -chdir_notify_unregister (NULL , packed_ref_store_reparent, refs); +chdir_notify_unregister (packed_ref_store_reparent, refs);free (refs->path); }
refs/reftable-backend.c +3 -4
@@ -391,8 +391,7 @@ static const struct reftable_be_write_options *reftable_be_write_options(structreturn opts; } -static void reftable_be_reparent(const char *name UNUSED, -const char *old_cwd, +static void reftable_be_reparent (const char *old_cwd,const char *new_cwd,void *payload) {
@@ -465,7 +464,7 @@ static struct ref_store *reftable_be_init(struct repository *repo, goto done; } -chdir_notify_register (NULL , reftable_be_reparent, refs); +chdir_notify_register (reftable_be_reparent, refs); done:assert (refs->err !=REFTABLE_API_ERROR );
@@ -492,7 +491,7 @@ static void reftable_be_release(struct ref_store *ref_store)free (be); }strmap_clear (&refs->worktree_backends,0 ); -chdir_notify_unregister (NULL , reftable_be_reparent, refs); +chdir_notify_unregister (reftable_be_reparent, refs); } static int reftable_be_create_on_disk(struct ref_store *ref_store,
setup.c +2 -3
@@ -1057,8 +1057,7 @@ static void apply_gitdir_and_environment(struct repository *repo, const char *pastrvec_clear (&to_free); } -static void update_relative_gitdir(const char *name UNUSED, -const char *old_cwd, +static void update_relative_gitdir (const char *old_cwd,const char *new_cwd,void *data) {
@@ -1086,7 +1085,7 @@ static void apply_and_export_relative_gitdir(struct repository *repo, const charxsetenv (GIT_DIR_ENVIRONMENT , path,1 );if (!is_absolute_path (path)) -chdir_notify_register (NULL , update_relative_gitdir, repo); +chdir_notify_register (update_relative_gitdir, repo);strbuf_release (&realpath); }
tmp-objdir.c +3 -4
@@ -37,8 +37,7 @@ static void tmp_objdir_free(struct tmp_objdir *t)free (t); } -static void tmp_objdir_reparent(const char *name UNUSED, -const char *old_cwd, +static void tmp_objdir_reparent (const char *old_cwd,const char *new_cwd,void *cb_data) {
@@ -67,7 +66,7 @@ int tmp_objdir_destroy(struct tmp_objdir *t) err =remove_dir_recursively (&t->path,0 ); -chdir_notify_unregister (NULL , tmp_objdir_reparent, t); +chdir_notify_unregister (tmp_objdir_reparent, t);tmp_objdir_free (t);return err;
@@ -155,7 +154,7 @@ struct tmp_objdir *tmp_objdir_create(struct repository *r, repo_get_object_directory(r), prefix);if (!is_absolute_path (t->path.buf)) -chdir_notify_register (NULL , tmp_objdir_reparent, t); +chdir_notify_register (tmp_objdir_reparent, t);if (!mkdtemp (t->path.buf)) {/* free, not destroy, as we never touched the filesystem */
Signature · 1 line
2.55.0.windows.3
Quoted 12 lines · Colin Hinton
The
nameparameter inchdir_notify_entrywas only ever used bychdir_notify_reparent()to produce trace output. That function was removed in5bf546755c(chdir-notify: drop unusedchdir_notify_reparent(), 2026-06-25), which leftnamewith no remaining consumers.Prior to that removal, most callers had already stopped passing a meaningful name, switching to NULL in
1f43ff2c7e(refs: unregister reference stores from "chdir_notify", 2026-06-25) and0de2467e6c(odb/source-packed: start converting to a properstruct odb_source, 2026-06-17).
Quoted 4 lines
Since no caller has populated
namewith real data for some time, and its last consumer is gone, drop it fromchdir_notify_register(),chdir_notify_unregister(), and the callback signature to simplify the API.
Thanks, this description summarizes the situation nicely.
-Peff