Re: [PATCH 2/2] for-each-ref: add --count-matches option

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

 



"Derrick Stolee via GitGitGadget" <gitgitgadget@xxxxxxxxx> writes:

> Each of these approaches is wasteful as it requires sending the list of
> matching reference names across a pipe plus the cost of parsing that
> output.
>
> Instead, it would be helpful to have a Git command that counts the
> number of refs matching a list of patterns.

For for-each-ref (which can be reused by branch and tag for no
cost), I am on the fence but slightly in favor (partly because the
code has already been written).  But I have to wonder where changes
that come from the above reasoning need to end, though.

Do we count branches and tags because "git branch --list | wc -l" is
too costly?  Should we teach "git remote" the same trick?  How about
"git stash list"?  "git show-index $pack_index"?  "git ls-files"?

How do we decide where to draw the line?  When a command invocation
in a large repository can produce records exceeding a million?



[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