Skip to content

feat: draw a subset of the full graph by specifying refspecs#143

Merged
peso merged 2 commits intogit-bahn:masterfrom
aimuzov:feature/subset-graph
Apr 8, 2026
Merged

feat: draw a subset of the full graph by specifying refspecs#143
peso merged 2 commits intogit-bahn:masterfrom
aimuzov:feature/subset-graph

Conversation

@aimuzov
Copy link
Copy Markdown
Contributor

@aimuzov aimuzov commented Apr 8, 2026

Summary

  • Add positional argument to scope the graph to specific branches
  • When multiple refspecs are given, the graph is bounded by their merge-base at the bottom and the branch tips at the top
  • A single refspec with an upstream tracking branch auto-detects the fork point
  • No changes to default behavior when no refspecs are specified

Example

$ git-graph master A B
 ○<──┐  cf43da7 (HEAD -> master) Merge branch A into master
 ○<┐ │  ddcfb2d Merge branch B into master
 │ ● │  bcfb676 (B) ...
 │ │ ●  019ae78 (A) ...
 ├─┴─┘
 ○      9cca380 Merge branch X into master

Lazygit integration

git:
  branchLogCmd: "git-graph --color always {{branchName}}"

Closes #55

aimuzov added 2 commits April 8, 2026 16:32
Allow passing branch names or refspecs as positional arguments
to scope the graph visualization to only the relevant subgraph.

When multiple refspecs are given, the graph is bounded by their
merge-base at the bottom. A single refspec with an upstream
tracking branch auto-detects the fork point.

Closes git-bahn#55
Copy link
Copy Markdown
Collaborator

@peso peso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution. This is a valuable feature.

@peso peso merged commit 795d8ee into git-bahn:master Apr 8, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Draw a subset of the full graph

2 participants