From: Derrick Stolee Date: Wed, 15 Mar 2023 16:12:45 GMT Subject: Re: [PATCH v2 7/8] for-each-ref: add ahead-behind format atom Message-ID: <3f7fe6c4-197e-bde9-50b8-ecce705a9f22@github.com> In-Reply-To: On 3/15/2023 12:01 PM, Junio C Hamano wrote: > Ævar Arnfjörð Bjarmason writes: > >> On Fri, Mar 10 2023, Derrick Stolee via GitGitGadget wrote: >> >>> From: Derrick Stolee >>> [...] >>> +ahead-behind::: >>> + Two integers, separated by a space, demonstrating the number of >>> + commits ahead and behind, respectively, when comparing the output >>> + ref to the `` specified in the format. >>> + >> >> As a potential (expert) user who hasn't read the code yet I'd think the >> the "" here would be the same as "update-ref", but glancing ahead >> at your tests it seems that it does ref matching, so "refs/heads/master" >> and "master" are both accepted? >> >> Since nothing else uses "" here I think we should clearly define >> the matching rules somehow, or maybe we do, and I missed it. > > I vaguely recall noticing this in the previous round, but doesn't > this only require a commit-ish, not even a ref? It is parsed with > lookup_commit_reference_by_name(). You noticed it in this round, but I haven't sent v3 yet. I have this in my local copy: ahead-behind::: Two integers, separated by a space, demonstrating the number of commits ahead and behind, respectively, when comparing the output ref to the `` specified in the format. Thanks, -Stolee