Re: [RFC PATCH 4/4] name-rev: avoid naming from a ref if it’s not a descendant of any commit
On Fri, Mar 1, 2019 at 12:50 PM Alban Gruin <alban.gruin@gmail.com> wrote:
> A ref may not be the descendant of all of the commits mentionned in
> stdin. In this case, we want to avoid naming its parents.
Show 15 quoted lines
>
> To do this, find_commits_in_strbuf() is created. It returns a raw list
> of all the commits that have been found in the input buffer. ishex() is
> converted to an inlined function. Then, we add a raw list of commits in
> the name_ref_data structure, and call find_commits_in_strbuf() before
> for_each_ref() if the user wants name-ref to process stdin. Then, for
> each ref, we check if the reachable subset of this commit list is empty
> or not. If it is, we do not call name_rev(), so we don’t name its
> parents.
>
> The code dealing with stdin after calling for_each_ref() is no longer
> needed as we already read it. name_rev_line() is renamed name_rev_buf()
> to reflect its new role better.
>
> Signed-off-by: Alban Gruin <alban.gruin@gmail.com>