All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] builtin/show-ref.c: support `--count` for limiting output
@ 2022-06-06 21:56 Taylor Blau
  2022-06-06 21:56 ` [PATCH 1/2] builtin/show-ref.c: rename `found_match` to `matches_nr` Taylor Blau
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Taylor Blau @ 2022-06-06 21:56 UTC (permalink / raw)
  To: git; +Cc: derrickstolee, gitster

This short patch series adds support for a new `--count` argument for limiting
the output of `show-ref` (à-la the `for-each-ref` option by the same name).

This is useful in contexts where a caller wants to avoid enumerating more
references than necessary (e.g., they only care whether a tag exists, but not
how many or what they are called) but doesn't have control of the output stream
(e.g., they are in Ruby and can't pipe the output to `head -n 1`).

The first patch is preparatory, and the second patch implements the new option.
This series doesn't conflict with my recent [1], and can be applied
independently.

Thanks in advance for your review!

[1]: https://lore.kernel.org/git/3fa6932641f18d78156bbf60b1571383f2cb5046.1654293264.git.me@ttaylorr.com/

Taylor Blau (2):
  builtin/show-ref.c: rename `found_match` to `matches_nr`
  builtin/show-ref.c: limit output with `--count`

 Documentation/git-show-ref.txt |  7 ++++++-
 builtin/show-ref.c             | 29 +++++++++++++++++++++++++----
 t/t1403-show-ref.sh            | 21 +++++++++++++++++++++
 3 files changed, 52 insertions(+), 5 deletions(-)

-- 
2.36.1.94.gb0d54bedca

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2022-06-08 16:10 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-06 21:56 [PATCH 0/2] builtin/show-ref.c: support `--count` for limiting output Taylor Blau
2022-06-06 21:56 ` [PATCH 1/2] builtin/show-ref.c: rename `found_match` to `matches_nr` Taylor Blau
2022-06-06 21:56 ` [PATCH 2/2] builtin/show-ref.c: limit output with `--count` Taylor Blau
2022-06-06 23:09   ` Junio C Hamano
2022-06-07  8:07   ` Ævar Arnfjörð Bjarmason
2022-06-07 21:13     ` Taylor Blau
2022-06-07 21:31       ` Ævar Arnfjörð Bjarmason
2022-06-08 16:10         ` Junio C Hamano
2022-06-06 22:52 ` [PATCH 0/2] builtin/show-ref.c: support `--count` for limiting output Junio C Hamano
2022-06-06 22:57   ` Taylor Blau
2022-06-06 23:00     ` Junio C Hamano
2022-06-07 19:41       ` Derrick Stolee
2022-06-07  8:18     ` Ævar Arnfjörð Bjarmason
2022-06-07 21:04       ` Taylor Blau

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.