From: Derrick Stolee <stolee@gmail.com>
To: Junio C Hamano <gitster@pobox.com>,
Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, vdye@github.com
Subject: Re: [PATCH 0/3] git for-each-ref: is-base atom and base branches
Date: Fri, 2 Aug 2024 10:32:46 -0400 [thread overview]
Message-ID: <27f3de89-55b2-413d-b4b4-6b35f8c4bcc9@gmail.com> (raw)
In-Reply-To: <xmqqmslvhmgm.fsf@gitster.g>
On 8/1/24 7:06 PM, Junio C Hamano wrote:
> "Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
>> Derrick Stolee (3):
>> commit-reach: add get_branch_base_for_tip
>> for-each-ref: add 'is-base' token
>> p1500: add is-base performance tests
>>
>> commit-reach.c | 118 ++++++++++++++++++++++++++++++++++++
>> commit-reach.h | 17 ++++++
>> ref-filter.c | 78 +++++++++++++++++++++++-
>> ref-filter.h | 15 +++++
>> t/helper/test-reach.c | 2 +
>> t/perf/p1500-graph-walks.sh | 31 ++++++++++
>> t/t6600-test-reach.sh | 94 ++++++++++++++++++++++++++++
>> 7 files changed, 354 insertions(+), 1 deletion(-)
>
> I was expecting to see an documentation update to for-each-ref (and
> probably branch and tag) so that what this new atom means. Is it
> that %(is-base:<commit>) interpolates to <commit> for a ref that is an
> ancestor of <commit>, and interpolates to an empty string for a ref
> that is not, or something?
You are absolutely right that I missed this crucial detail. I will
eventually send a v2 with this oversight corrected. For now, please
consider this documentation diff, and I look forward to other review
comments that I can use to improve this series before sending v2.
diff --git a/Documentation/git-for-each-ref.txt
b/Documentation/git-for-each-ref.txt
index c1dd12b93cf..5154ba3e2a7 100644
--- a/Documentation/git-for-each-ref.txt
+++ b/Documentation/git-for-each-ref.txt
@@ -264,6 +264,16 @@ ahead-behind:<committish>::
commits ahead and behind, respectively, when comparing the output
ref to the `<committish>` specified in the format.
+is-base:<committish>::
+ In at most one row, `(<committish>)` will appear to indicate the ref
+ that minimizes the number of commits in the first-parent history of
+ `<committish>` and not in the first-parent history of the ref. Ties
+ are broken by favoring the earliest ref in the list. Note that this
+ token will not appear if the first-parent history of `<committish>`
+ does not intersect the first-parent histories of the filtered refs.
+ This can be used as a heuristic to guess which of the filtered refs
+ was used as the base of the branch that produced `<committish>`.
+
describe[:options]::
A human-readable name, like linkgit:git-describe[1];
empty string for undescribable commits. The `describe` string may
next prev parent reply other threads:[~2024-08-02 14:32 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-01 22:10 [PATCH 0/3] git for-each-ref: is-base atom and base branches Derrick Stolee via GitGitGadget
2024-08-01 22:10 ` [PATCH 1/3] commit-reach: add get_branch_base_for_tip Derrick Stolee via GitGitGadget
2024-08-01 22:10 ` [PATCH 2/3] for-each-ref: add 'is-base' token Derrick Stolee via GitGitGadget
2024-08-01 22:10 ` [PATCH 3/3] p1500: add is-base performance tests Derrick Stolee via GitGitGadget
2024-08-01 23:06 ` [PATCH 0/3] git for-each-ref: is-base atom and base branches Junio C Hamano
2024-08-02 14:32 ` Derrick Stolee [this message]
2024-08-02 16:55 ` Junio C Hamano
2024-08-02 17:30 ` Junio C Hamano
2024-08-11 17:34 ` [PATCH v2 " Derrick Stolee via GitGitGadget
2024-08-11 17:34 ` [PATCH v2 1/3] commit-reach: add get_branch_base_for_tip Derrick Stolee via GitGitGadget
2024-08-12 20:30 ` Junio C Hamano
2024-08-13 13:39 ` Derrick Stolee
2024-08-11 17:34 ` [PATCH v2 2/3] for-each-ref: add 'is-base' token Derrick Stolee via GitGitGadget
2024-08-12 21:05 ` Junio C Hamano
2024-08-13 13:44 ` Derrick Stolee
2024-08-11 17:34 ` [PATCH v2 3/3] p1500: add is-base performance tests Derrick Stolee via GitGitGadget
2024-08-14 10:31 ` [PATCH v3 0/4] git for-each-ref: is-base atom and base branches Derrick Stolee via GitGitGadget
2024-08-14 10:31 ` [PATCH v3 1/4] commit-reach: add get_branch_base_for_tip Derrick Stolee via GitGitGadget
2024-08-14 10:31 ` [PATCH v3 2/4] commit: add gentle reference lookup method Derrick Stolee via GitGitGadget
2024-08-14 10:31 ` [PATCH v3 3/4] for-each-ref: add 'is-base' token Derrick Stolee via GitGitGadget
2024-08-14 10:31 ` [PATCH v3 4/4] p1500: add is-base performance tests Derrick Stolee via GitGitGadget
2024-08-19 19:52 ` [PATCH v3 0/4] git for-each-ref: is-base atom and base branches Junio C Hamano
2024-08-20 1:33 ` Derrick Stolee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=27f3de89-55b2-413d-b4b4-6b35f8c4bcc9@gmail.com \
--to=stolee@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=gitster@pobox.com \
--cc=vdye@github.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).