-
Notifications
You must be signed in to change notification settings - Fork 36
Description
First off, thanks for building such a fantastic tool!
I usually rely on LazyGit, but I've struggled to find a good way to visualize the commit graph in repositories with multiple developers. Serie has the cleanest and most readable commit graph visualization I've come across so far.
However, working with larger codebases brought up two specific challenges for me:
- I wanted to check diffs using a richer UI than the standard
git diffoutput, or open files directly in my editor for before/after comparison. - Even a single long-lived branch pushes the commit messages off-screen, making them unreadable.
I took a stab at solving these issues in a fork and wanted to share my findings with you.
- The interfaces and implementations below are just proof-of-concepts.
- The code was generated using Codex CLI (GPT-5.2-codex high).
If these features align with Serie's philosophy, I'd love to see them included :) (I'm happy to open a PR if you'd like.)
1. Add mode = "exec" option to temporarily run external commands and block until finished
I often use Neovim's Diffview.nvim to check commit diffs. Since everyone has their preferred workflow, I thought it would be useful to allow users to view details directly in their familiar TUI or GUI.
Configuration Example
[core.user_command]
commands_1 = { "name" = "git diff", commands = ["sh", "-c", "git diff --color=always {{first_parent_hash}} {{target_hash}} | delta --dark --paging=never --side-by-side --line-numbers --width {{area_width}}"] }
commands_2 = { "name" = "Diffview.nvim", commands = ["nvim", "-c", "DiffviewOpen \"{{first_parent_hash}}\"..\"{{target_hash}}\""], mode = "exec" }
[keybind]
user_command_view_toggle_2 = ["shift-d"]Result
20260112_11_03_50.mp4
Reference Commit
Note
I realize Serie isn't trying to provide complex features beyond git log --graph, but since this is an extension of User Commands and simply builds an interface for external tools, I felt it might be within scope.
Note
I'm not an expert in Ratatui, so I'm unsure about the validity of the code implementation...
2. Add CLI option to limit the number of commits displayed (--max-commits <N>)
Below is the result of displaying the commit graph for stable-diffusion-webui using Serie.
In many cases, I only need to check the most recent history (e.g., the last few dozen commits). If old, long-lived branches clutter the view and hide recent messages, simply limiting the commit count solves the problem.
Command Example
serie --max-commits 100Result
Reference Commit
🗾 日本語バージョン
はじめに、素晴らしいツールの開発をありがとうございます!
私はGit操作をするときはLazyGitを使っていますが、開発者が複数人のリポジトリでコミットグラフを把握する方法に頭を悩ませていました。Serieは私が今まで見てきたツールの中で、最もコミットグラフが見やすいと思います。
ただ、大きめのコードベースで確認するにあたり、2つの課題に直面しました。
- git diffの出力よりもリッチなUIで確認したり、変更前後のファイルをエディタで開きたい
- 生存期間が長いブランチが(たとえ1つでも)存在してしまうとコミットメッセージ以降がほぼ表示されない
forkしたリポジトリで、上記2つの課題を解決するPoCを試しにつくってみましたので、共有させてください。
- IFや実装は一例です
- コードはCodex CLI (GPT-5.2-codex high) で生成されたものです
もし、Serieの目指す方向に沿っているようでしたら、対応を検討いただけたら嬉しく思います。(PRが必要であれば作成いたします)
1. Serieから一時的に外部コマンドを実行し、完了までブロックするオプションを追加する (mode = "exec")
私はNeovimのDiffview.nvimでコミット差分を確認することが多いです。何で確認するかは人それぞれだと思いますが、馴染みのTUIやGUIでそのまま詳細が見られると便利だなと思い追加してみました。
具体的な設定イメージ
[core.user_command]
commands_1 = { "name" = "git diff", commands = ["sh", "-c", "git diff --color=always {{first_parent_hash}} {{target_hash}} | delta --dark --paging=never --side-by-side --line-numbers --width {{area_width}}"] }
commands_2 = { "name" = "Diffview.nvim", commands = ["nvim", "-c", "DiffviewOpen \"{{first_parent_hash}}\"..\"{{target_hash}}\""], mode = "exec" }
[keybind]
user_command_view_toggle_2 = ["shift-d"]結果
20260112_11_03_50.mp4
参考コミット
Note
Serieでは git log --graph を超える複雑な機能や操作の提供を目標としていないことは存じ上げておりますが、User Commandの延長上であり、外部ツールとのIFを構築するだけであれば許容範囲かなと感じました。
Note
Ratatuiについて詳しくないので、コードの妥当性は分かっておりません...。
2. git logで表示する最大コミット数を制限するCLIオプションを追加する (--max-commits <N>)
以下は stable-diffusion-webui のコミットグラフをSerieで表示した結果です。
実際に確認したいコミットグラフは直近数十件だけのことが多く、何ヶ月・何年も前のブランチが常にそれらを阻害するのであれば、数を制限してしまえばいいと考えました。
具体的なコマンドイメージ
serie --max-commits 100
結果