Re: [PATCH 0/3] git for-each-ref: is-base atom and base branches
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 2, 2024, 17:30 UTC
- Message-ID
- <xmqqo76ade8r.fsf@gitster.g>
- In-Reply-To
- <xmqqzfpudful.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
>> +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.
This was a bit too dense for me to grok. So if I have a <commit> that is at the tip of a branch B forked from 'master', and then 'master' advanced by a lot since the branch forked, the number this is minimizing for 'master' is the commits on the branch B, but when showing 'maint', then even though the branch B may have the tip of 'maint' as an ancestor, the number for 'maint' would be a lot more than the number for 'master'. If there were another branch C that was forked from 'master' and shared some (or all) commits that are near the tip of branch B, e.g.
---o---o---o---o---o---o---o---o---o 'master'
\
o---o---o---o 'C'
\
o---o---o---o 'B'then the number may be even smaller for branch 'C' than 'master'.
And for at most one ref, %(is-base:<commit>) becomes "(<commit>)"; for all other refs, it becomes an empty string.
OK.
Show 5 quoted lines
> OK. Knowing what definition you used is crucial when reading the > implementation, as we cannot tell what you wanted to implement > without it ;-) > > Thanks.