Skip to content

technoplasm/git-candlestick

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

git-candlestick

Gitコミット履歴を株価のローソク足チャートのように可視化するツール。

各コミットを1本のローソク足として、コードベースの総行数の推移を表現します。

ローソク足の定義

要素 定義
始値 (Open) コミット前の総行数
終値 (Close) コミット後の総行数
高値 (High) 始値 + 追加行数
安値 (Low) 始値 - 削除行数
陽線 (緑) 終値 > 始値
陰線 (赤) 終値 < 始値

インストール

uv (推奨)

cd git-candlestick/

# 直接実行(インストール不要)
uv run git_candlestick.py /path/to/repo

# または開発用にインストール
uv pip install -e .
git-candlestick /path/to/repo

pip

pip install -e .

システムPython (Arch Linux)

sudo pacman -S python-plotly python-pandas
python git_candlestick.py /path/to/repo

使い方

# 基本
git-candlestick /path/to/repo

# ブラウザで表示(デフォルト)
git-candlestick .

# HTMLにエクスポート
git-candlestick . -o chart.html

# CDN使用(軽量HTML、Web公開向け)
git-candlestick . -o chart.html --cdn

# コミットメッセージ・作者を非表示(公開向け)
git-candlestick . -o chart.html --cdn --hide-message

オプション

オプション 説明
-o, --output FILE HTMLファイルに出力
-b, --branch BRANCH 対象ブランチを指定
-s, --since DATE 開始日 (例: 2024-01-01, 1 month ago)
-u, --until DATE 終了日 (例: 2024-12-31, yesterday)
-p, --pattern GLOB ファイルパターン (例: *.py, *.go)
-n, --limit N 最新N件のコミットのみ
--hide-message コミットメッセージと作者を非表示
--cdn plotly.jsをCDNから読み込む(HTML軽量化)

使用例

# Goファイルのみ、最新100コミット
git-candlestick . -p "*.go" -n 100 -o chart.html --cdn

# 2024年のコミットのみ
git-candlestick . --since 2024-01-01 --until 2024-12-31

# 特定ブランチ
git-candlestick . -b develop

# 公開用HTML(CDN + メッセージ非表示)
git-candlestick . -o public/chart.html --cdn --hide-message

Webページへの埋め込み

<iframe
  src="/chart.html"
  width="100%"
  height="600"
  frameborder="0">
</iframe>

出力サイズ

オプション HTMLサイズ
デフォルト ~3MB (plotly.js埋め込み)
--cdn ~10KB (CDNから読み込み)

--cdn を使用する場合、閲覧時にインターネット接続が必要です。

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages