gritHEAD → docs/shortlog
Commands / HistoryMarkdown

grit shortlog

List the commits on this branch that aren't on the target branch yet.

grit shortlog
grit sl

Description

Shows the current branch, its target branch, and every commit on the current branch that the target doesn't have, newest first. It's the list of what you would be proposing if you opened a pull request now.

The target branch is found the same way as for grit status: the target.branch setting, then origin/master, origin/main, master and main. Unlike grit status, which shows at most ten commits, grit shortlog lists all of them.

Options

grit shortlog takes no options beyond the global ones.

JSON output

Pass --json for stable, scripting-friendly output:

Field Type Meaning
branch string Current branch name.
target string or null Target branch used for comparison, or null when none was found.
ahead number How many commits are on the branch but not on the target.
commits array Those commits, newest first, each with oid and subject.

Markdown output