git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 4/5] t6302: add test combining '--start-after' with '--exclude'

From
Karthik Nayak <karthik.188@gmail.com>
Date
Jul 24, 2025, 08:14 UTC
Message-ID
<20250724-kn-small-cleanups-v1-4-0c70f591de3e@gmail.com>
In-Reply-To
<20250724-kn-small-cleanups-v1-0-0c70f591de3e@gmail.com>

The '--start-after' doesn't explicitly mention being compatible with the '--exclude' flag, generally only incompatibility is explicitly called out. However, it would be nice to test the compatibility between the two to avoid future regressions. Let's do that.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
---
 t/t6302-for-each-ref-filter.sh | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
diff --git a/t/t6302-for-each-ref-filter.sh b/t/t6302-for-each-ref-filter.sh
index e097db6b02..9b80ea1e3b 100755
--- a/t/t6302-for-each-ref-filter.sh
+++ b/t/t6302-for-each-ref-filter.sh
@@ -712,6 +712,25 @@ test_expect_success 'start after, overflow specific reference path' '
 	test_cmp expect actual
 '
 
+test_expect_success 'start after, with exclude pattern' '
+	cat >expect <<-\EOF &&
+	refs/tags/annotated-tag
+	refs/tags/doubly-annotated-tag
+	refs/tags/doubly-signed-tag
+	refs/tags/foo1.10
+	refs/tags/foo1.3
+	refs/tags/foo1.6
+	refs/tags/four
+	refs/tags/one
+	refs/tags/signed-tag
+	refs/tags/three
+	refs/tags/two
+	EOF
+	git for-each-ref --format="%(refname)" --start-after=refs/odd/spot \
+		--exclude=refs/tags/foo >actual &&
+	test_cmp expect actual
+'
+
 test_expect_success 'start after, last reference' '
 	cat >expect <<-\EOF &&
 	EOF
-- 
2.49.0
Previous: Patrick SteinhardtNext: Karthik Nayak
Message 13 of 22 in “ref-filter: small cleanups and fixes”
  1. 0/5 ref-filter: small cleanups and fixesKarthik Nayak, Jul 24, 2025
  2. 1/5 ref-cache: use 'size_t' instead of int for lengthKarthik Nayak, Jul 24, 2025
  3. Junio C HamanoJul 24, 2025
  4. 2/5 for-each-ref: fix documentation argument orderingKarthik Nayak, Jul 24, 2025
  5. Junio C HamanoJul 24, 2025
  6. Karthik NayakJul 24, 2025
  7. Junio C HamanoJul 24, 2025
  8. Karthik NayakJul 28, 2025
  9. Patrick SteinhardtJul 25, 2025
  10. Karthik NayakJul 28, 2025
  11. 3/5 for-each-ref: reword the documentation for '--start-after'Karthik Nayak, Jul 24, 2025
  12. Patrick SteinhardtJul 25, 2025
  13. 4/5 t6302: add test combining '--start-after' with '--exclude'Karthik Nayak, Jul 24, 2025
  14. 5/5 ref-filter: use REF_ITERATOR_SEEK_SET_PREFIX instead of '1'Karthik Nayak, Jul 24, 2025
  15. Junio C HamanoJul 24, 2025
  16. 0/5 ref-filter: small cleanups and fixesKarthik Nayak, Jul 28, 2025
  17. 1/5 ref-cache: use 'size_t' instead of int for lengthKarthik Nayak, Jul 28, 2025
  18. 2/5 for-each-ref: fix documentation argument orderingKarthik Nayak, Jul 28, 2025
  19. 3/5 for-each-ref: reword the documentation for '--start-after'Karthik Nayak, Jul 28, 2025
  20. 4/5 t6302: add test combining '--start-after' with '--exclude'Karthik Nayak, Jul 28, 2025
  21. 5/5 ref-filter: use REF_ITERATOR_SEEK_SET_PREFIX instead of '1'Karthik Nayak, Jul 28, 2025
  22. Patrick SteinhardtJul 29, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.