Skip to content

test(git): pin the glued -n<N> form of the git log limit - #2666

Open
guyoron1 wants to merge 1 commit into
rtk-ai:developfrom
guyoron1:fix/git-log-combined-n-flag
Open

guyoron1 wants to merge 1 commit into
rtk-ai:developfrom
guyoron1:fix/git-log-combined-n-flag

Conversation

@guyoron1

@guyoron1 guyoron1 commented Jun 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Refs #2665

rtk git log -n20 used to return 10 commits because the glued -n<N> form wasn't recognised. That was fixed on develop by the shared arg tokenizer (#3681), so the code change this PR originally carried is obsolete and has been dropped.

What is left is the coverage, since nothing on develop pins the glued form (the existing tests cover -20, -n 15 and --max-count):

  • test_parse_user_limit_n_combined (parser + has_limit_flag)
  • -n20 added to the shapes in a_user_limit_or_a_revision_range_is_not_capped (raw path)
  • a_glued_n_limit_is_the_users_limit_on_the_compact_listing (compact path: unbounded = 10; -n20, -n 20 and -20 = 20)

All three fail if the reported bug is reintroduced (checked by making -n count only when its value is a separate token). Issue #2665 itself is fixed on develop and can be closed.

  • cargo fmt --all -- --check, cargo clippy --all-targets (0 warnings), cargo test --all (all pass)

@guyoron1
guyoron1 force-pushed the fix/git-log-combined-n-flag branch from 3766d17 to 4053395 Compare August 14, 2026 19:03
`rtk git log -n20` was capped at 10 commits because only the separate-token
`-n 20` counted as a user limit (rtk-ai#2665). The shared arg tokenizer fixed that
without a test naming the case, so pin it: the parser and the limit
detection on the glued form, and the compact listing end to end.

Refs rtk-ai#2665
@guyoron1 guyoron1 changed the title fix(git): recognize -n<N> combined form in git log limit detection test(git): pin the glued -n<N> form of the git log limit Sep 21, 2026
@guyoron1
guyoron1 force-pushed the fix/git-log-combined-n-flag branch from 4053395 to 7cfe362 Compare September 21, 2026 12:20
@guyoron1

Copy link
Copy Markdown
Contributor Author

Checked against current develop: rtk git log -n20 now returns 20 commits (it returned 10 before the arg tokenizer in #3681), so the code fix here is obsolete and I've dropped it. Nothing on develop pins the glued -n<N> form though, so this is now a tests-only PR (retitled, and Refs instead of Fixes). The tests fail if the bug is reintroduced. Feel free to close it if you'd rather not carry the extra tests.

#2665 itself is fixed on develop and can be closed. #4148 and #4152 also edit tests/git_log_cap_notice_test.rs, so expect a small textual conflict in that file for whichever lands second.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant