rtk icon indicating copy to clipboard operation
rtk copied to clipboard

rtk git log silently truncates output to 50 commits, ignoring --reverse and losing historical data

Open qmy777 opened this issue 7 months ago • 3 comments

Description

When running rtk git log --all --oneline --format="%ci" --reverse, the output is silently truncated to 50 commits, starting from the most recent commits instead of the oldest ones. This behavior differs from native git log and causes data loss when users expect to see the full commit history in reverse order.

Steps to Reproduce

  1. Install rtk v0.35.0
  2. Run the following commands in a repository with 100+ commits:

Native git - shows all commits starting from the oldest (2022 in my case)

git log --all --oneline --format="%ci" --reverse | head -100

rtk git - only shows 50 commits, starting from recent ones (2025+)

rtk git log --all --oneline --format="%ci" --reverse | head -100

Expected Behavior

rtk git log --reverse should respect the --reverse flag and either:

  1. Return all commits in reverse order (oldest first), OR
  2. At least document the default limit clearly in help output

Actual Behavior │ Command │ Total Lines │ First Date │ │ git log --all --reverse │ 1045 │ 2022-01-10 │ │ rtk git log --all --reverse │ 50 │ 2025-09-26 │

The output is truncated to 50 commits before applying the reverse order, so --reverse becomes ineffective for viewing historical commits.

Workaround

Using -n parameter works to increase the limit:

rtk git log --all --oneline --format="%ci" --reverse -n 200

However, this is not intuitive and the default limit is not documented in rtk git log --help.

Environment

  • rtk version: 0.35.0
  • OS: macOS (Darwin 23.5.0)
  • Shell: zsh

Suggested Improvements

  1. Document the default limit in rtk git log --help (e.g., "Default: 50 commits, use -n to override")
  2. Apply --reverse after truncation so that rtk git log --reverse shows the oldest N commits, not the newest N commits
  3. Consider warning users when output is truncated, similar to how grep warns about truncated results

qmy777 avatar Apr 14 '26 08:04 qmy777

Taking this

NEOFIT-dev avatar Apr 14 '26 09:04 NEOFIT-dev

wshm · Automated triage by AI

🔍 Automated Triage

🐛 Category bug
🟡 Priority medium
🎯 Confidence 95%

Summary

rtk git log silently truncates to 50 commits and applies --reverse before truncation, inverting expected behavior; PR #1302 already addresses this.

This looks like a simple fix that could be auto-resolved. Repo maintainers can use /wshm fix to attempt it.


Triaged automatically by wshm · This is an automated analysis, not a human review.

pszymkowiak avatar Apr 17 '26 15:04 pszymkowiak

I too would appreciate a simple message explaining displayed/total and how to bypass this so I don't have to babysit the agent when it needs more. Thanks!

John-Gee avatar Jun 03 '26 04:06 John-Gee