fix(git): run_log silently injects --no-merges, hiding merge commits
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
Research direction
Start in run_log() around lines 492-498, where the git log command is assembled and --no-merges is added. Reproduce the merge history from the issue, then verify that rtk git log preserves merge commits and graph topology while an explicit --no-merges argument still works.
Written by the indexing model from the issue text.
Description
🤖 This was written by an AI agent on behalf of @paolomainardi.
Description
run_log() unconditionally adds --no-merges to all git log commands unless the user explicitly passes --merges. This silently removes all merge commits from the output with no indication they were filtered.
For AI agents, this is a correctness bug: the agent cannot see that branches were merged, leading to wrong conclusions about branch topology and project history.
Root Cause
Lines ~492-498 in run_log():
// Only add --no-merges if user didn't explicitly request merge commits
let wants_merges = args
.iter()
.any(|arg| arg == "--merges" || arg == "--min-parents=2");
if !wants_merges {
cmd.arg("--no-merges");
}
Reproduction
# Create a repo with a merge commit
git init test-repo && cd test-repo
echo "a" > a.txt && git add . && git commit -m "initial"
git checkout -b feature
echo "b" > b.txt && git add . && git commit -m "feature work"
git checkout master
git merge --no-ff feature -m "Merge branch 'feature'"
echo "c" > c.txt && git add . && git commit -m "after merge"
# Raw: 4 commits (including merge)
git log --oneline | wc -l
# Output: 4
# RTK: 3 commits (merge silently removed)
rtk git log --oneline | wc -l
# Output: 3
# The merge commit is completely invisible
rtk git log --oneline | grep "Merge"
# Output: (empty)
Side Effects
git log --graphshows corrupted topology because the merge node is removed and the graph is redrawn incorrectly- Agents that check "was this branch merged?" get the wrong answer
git log --onelinecount disagrees withgit rev-list --count
Fix
Remove the --no-merges injection entirely. If users want to filter merge commits, they can pass --no-merges explicitly. RTK should not silently alter the semantics of git commands.
Impact
- Severity: High — merge commits vanish completely, corrupts history understanding
- Token cost: +1 line per merge commit in history — negligible
- Version: Verified on v0.39.0
Related
- #619 (git log issues)
- #1704 (git log filtering)
- Dominant language
- Rust
- Stars
- 81.1k
- Forks
- 5.1k
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 42
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rtk-ai/rtk
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
bug core output-formatting
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
uv_cmd discards print_with_hint's return value, so the tee hint is not counted and savings read 100% Openanalytics bug python
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
area:cli bug good first issue platform:windows priority:medium resolved-pending-close
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
area:cli bug good first issue priority:high
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100