You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
git log -n<N> combined form silently truncated to 10 commits #2665
rtk git log -n20 silently truncates output to 10 commits instead of 20. The combined -n<N> form (e.g. -n20, -n5) is not recognized by either the has_limit_flag detection or parse_user_limit().
Steps to Reproduce
rtk git log -n20 # shows 10 commits instead of 20
rtk git log -n 20 # works correctly (shows 20)
rtk git log -20 # works correctly (shows 20)
Root Cause
In src/cmds/git/git.rs, the has_limit_flag check only detects:
-<digit> (like -20)
-n as a standalone token (for the -n 20 two-token form)
--max-count prefix
It does not detect -n<digits> (e.g. -n20), which is a valid and commonly used git syntax.
When -n20 is not detected as a limit flag:
RTK injects its own -10 limit → git uses the last limit (-n20) and outputs 20 commits
RTK sets limit = 10 and user_set_limit = false in filter_log_output()
The filter truncates to 10 commits → user loses half their requested output
The same gap exists in parse_user_limit(), which also doesn't handle the -n<N> combined form.
Expected Behavior
rtk git log -n20 should show 20 commits, identical to rtk git log -n 20 and rtk git log -20.
The combined -n<N> git flag form (e.g. -n20) is not recognized by has_limit_flag or parse_user_limit(), causing RTK to silently inject its own -10 limit and truncate output; fix is to add a -n\d+ pattern match in both functions in src/cmds/git/git.rs.
This looks like a simple fix that could be auto-resolved. Repo maintainers can use /wshm fix to attempt it.
📁 Relevant files
src/cmds/git/git.rs
Triaged automatically by wshm · This is an automated analysis, not a human review.
Fixed on develop by the shared arg tokenizer in #3681: rtk git log -n20 now returns 20 commits (it returned 10 before that). #2666 is now a tests-only PR that pins the glued -n<N> form. Closing.
Activity
pszymkowiak commentedon Jun 27, 2026
🔍 Automated Triage
bugmediumSummary
The combined
-n<N>git flag form (e.g.-n20) is not recognized byhas_limit_flagorparse_user_limit(), causing RTK to silently inject its own-10limit and truncate output; fix is to add a-n\d+pattern match in both functions insrc/cmds/git/git.rs.📁 Relevant files
src/cmds/git/git.rsTriaged automatically by wshm · This is an automated analysis, not a human review.
fix(git): handle -n<N> combined form in git log (fixes rtk-ai#2665)
fix(git): handle -n<N> combined form in git log (fixes rtk-ai#2665)
fix(git): recognize -n<N> combined form in git log limit detection
fix(git): handle -n<N> combined form in git log (fixes rtk-ai#2665)
test(git): pin the glued -n<N> form of the git log limit
guyoron1 commentedon Sep 21, 2026
Fixed on develop by the shared arg tokenizer in #3681:
rtk git log -n20now returns 20 commits (it returned 10 before that). #2666 is now a tests-only PR that pins the glued-n<N>form. Closing.