jesseduffield / jesseduffield/lazygit

Make the refs shown by the commits view's whole-graph toggle configurable

Open
#6,005 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
82.4k
Forks
3k
Avg merge
2d 18h
Merged PRs (30d)
19

Description

### Is your feature request related to a problem? Please describe.

The commit view's whole-graph toggle hardcodes `--all` when building the `git log` command, which means every ref in the repo.

Agent harnesses like Claude and Copilot write large numbers of checkpoint commits under `refs/agents`, and stashes are refs too. I’d like to filter stashes and agent checkpoints out of this view.

### Describe the solution you'd like

A config option that controls which args are spliced into `git log` in place of `--all`, e.g.:

```yaml
git:
log:
allRefsArgs: ["--branches", "--remotes"]
```

It would default to `["--all"]`, so existing behaviour is unchanged, and could be set to something narrower like the above, or to `--all` plus `--exclude` globs:

```yaml
git:
log:
allRefsArgs: ["--all", "--exclude=refs/agents/*"]
```

### Describe alternatives you've considered

- **Turning the whole-graph toggle off.** Loses the other branches, which is the whole point of the toggle.
- **A boolean like `excludeStashes`.** Narrower, and doesn't help with the general problem of third-party tooling writing refs; a list of args covers stashes, agent refs, and whatever comes next without another config option each time.
- **A full command override like `git.allBranchesLogCmds`.** Doesn't work here, since lazygit has to parse the output — see above.
- **A custom command.** Can't help: the commits view builds this `git log` invocation itself.

### Additional context

I have a prototype implementing this: https://github.com/jesseduffield/lazygit/pull/6004

Contributor guide

Open the contributing guide

Research direction

Start at the commits view's whole-graph toggle and the code that builds its git log command; trace how the git.log configuration is parsed. Compare the prototype in PR #6004 with the requested default and configurable argument list, then verify that existing whole-graph behavior remains unchanged and narrower ref selections work.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, go
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.