From: Harald Nordgren Date: Sat, 24 Oct 2026 17:18:57 GMT Subject: Re: [PATCH v10 1/5] fetch: add remote..refmap Message-ID: In-Reply-To: > remote.h says this procedure does "For the given remote, reads the > refspec's src and sets the other fields." Ok, and glancing at > refspec_find_match the idea is that "refspec" input is a query (with a > src or dst) and we find the matching entry and fill out the input's > fields. > > So… I assume the usual idea would be that refmap is a "superset" of > the fetch refspec, since I might want to map refs that I don't > normally fetch. (Or it might be disjoint, if none of the mappings > apply to my usual fetches.) But that means that remote_find_tracking() > won't be able to find entries for the mapped refs that aren't part of > my "normal" fetches? Are there downstream consequences of that? I'm > not sure, I haven't looked at how else remote_find_tracking is used. > > Could that affect, for example, --delete-merged? Good point, I will change it like this: ``` 1: ba7f1354cd ! 16: 4603c84d68 fetch: add remote..refmap @@ remote.c: void ref_push_report_free(struct ref_push_report *report) int remote_find_tracking(struct remote *remote, struct refspec_item *refspec) { - return refspec_find_match(&remote->fetch, refspec); -+ if (remote->fetch.nr) -+ return refspec_find_match(&remote->fetch, refspec); -+ return refspec_find_match(&remote->refmap, refspec); ++ if (!remote->fetch.nr || refspec_find_match(&remote->fetch, refspec)) ++ return refspec_find_match(&remote->refmap, refspec); ++ return 0; } static struct ref *alloc_ref_with_prefix(const char *prefix, size_t prefixlen, ``` Harald