Re: [PATCH v4 0/4] for-each-ref: introduce seeking functionality via '--start-after'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 11, 2025 at 6:20 PM Karthik Nayak <karthik.188@xxxxxxxxx> wrote:

> Initially I was also planning to cleanup all the `refs_for_each...()`
> functions in 'refs.h' by simply using the iterator, but this bloated the
> series. So I've left that for another day.

I wonder if there is a plan to add the '--start-after' option to `git
branch` and `git tag` too?

> Karthik Nayak (4):
>       refs: expose `ref_iterator` via 'refs.h'
>       ref-cache: remove unused function 'find_ref_entry()'
>       refs: selectively set prefix in the seek functions
>       for-each-ref: introduce a '--start-after' option

Except for the few small comments I left on the two last patches and
one below, this looks good to me.

[ ... ]

> Range-diff versus v3:

[ ... ]

>      +  struct cache_ref_iterator *iter =
>      +          (struct cache_ref_iterator *)ref_iterator;
>      +
>      +  if (flags & REF_ITERATOR_SEEK_SET_PREFIX) {
>     -+          return cache_ref_iterator_set_prefix(iter, seek);
>     -+  } else if (seek && *seek) {
>     ++          return cache_ref_iterator_set_prefix(iter, refname);
>     ++  } else if (refname && *refname) {

Nit: the `else` here could be removed, but yeah it might be better to
do that in a preparatory patch.

>      +          struct cache_ref_iterator_level *level;
>     -+          const char *slash = seek;
>     ++          const char *slash = refname;
>      +          struct ref_dir *dir;





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux