Skip to content

Commit fecb8a5

Browse files
committed
docs: 設定章に階層構成と自動プッシュ項目を追加
1 parent aee6e55 commit fecb8a5

2 files changed

Lines changed: 80 additions & 12 deletions

File tree

‎README.ja.md‎

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,18 @@ git-sc -g abc1234 -b # 詳細な本文付き
152152

153153
## 設定
154154

155-
設定ファイル: `~/.git-sc`
155+
### 階層的設定
156+
157+
git-sc はプロジェクトレベルでの上書きが可能な階層的設定をサポートしています:
158+
159+
| ファイル | スコープ | 説明 |
160+
|---------|---------|------|
161+
| `~/.git-sc` | グローバル | ユーザー全体のデフォルト設定 |
162+
| `.git-sc` | プロジェクト | リポジトリ固有の上書き設定(リポジトリルートに配置) |
163+
164+
プロジェクト設定はグローバル設定を上書きします。プロジェクト設定で指定されていないフィールドはグローバル設定から継承されます。
165+
166+
### 設定例
156167

157168
```toml
158169
# AIプロバイダーの優先順位
@@ -161,6 +172,13 @@ providers = ["gemini", "codex", "claude"]
161172
# コミットメッセージの言語
162173
language = "Japanese"
163174

175+
# コミットプレフィックス形式(オプション)
176+
# 値: conventional, bracket, colon, emoji, plain, none
177+
prefix_type = "conventional"
178+
179+
# コミット後に自動プッシュ(オプション)
180+
auto_push = true
181+
164182
# モデル設定
165183
[models]
166184
gemini = "flash"
@@ -177,11 +195,24 @@ provider_cooldown_minutes = 60
177195
|-----------|------|-----------|
178196
| `providers` | AIプロバイダーの優先順位 | `["gemini", "codex", "claude"]` |
179197
| `language` | コミットメッセージの言語 | `"Japanese"` |
198+
| `prefix_type` | コミットプレフィックス形式 | 自動検出 |
199+
| `auto_push` | コミット後に自動プッシュ | `false` |
180200
| `models.*` | 各プロバイダーのモデル | 設定参照 |
181201
| `provider_cooldown_minutes` | 失敗プロバイダーのクールダウン | `60` |
182202
| `prefix_rules` | URLベースのプレフィックス形式 | `[]` |
183203
| `prefix_scripts` | 外部プレフィックススクリプト | `[]` |
184204

205+
### prefix_type の値
206+
207+
| 値 | 例 | 説明 |
208+
|----|-----|------|
209+
| `conventional` | `feat: add feature` | Conventional Commits 形式 |
210+
| `bracket` | `[feat] add feature` | ブラケット形式 |
211+
| `colon` | `feat: add feature` | シンプルなコロン形式 |
212+
| `emoji` | `:sparkles: add feature` | 絵文字形式 |
213+
| `plain` | `Add feature` | プレフィックスなし |
214+
| `none` | `add feature` | プレフィックスなし、小文字 |
215+
185216
### プレフィックスルール
186217

187218
リモートURLでコミット形式を指定:
@@ -218,15 +249,18 @@ Cargo.lock
218249
*.generated.ts
219250
```
220251

221-
### .git-sc-auto-push
252+
### 自動プッシュ
222253

223-
リポジトリルートにこのファイルを作成すると、コミット後に自動で push します:
254+
設定ファイルで自動プッシュを有効にできます:
224255

225-
```bash
226-
touch .git-sc-auto-push
256+
```toml
257+
# ~/.git-sc または .git-sc に記述
258+
auto_push = true
227259
```
228260

229-
このファイルが存在する場合、`git-sc` はコミットまたは squash 成功後に `git push` を実行します。
261+
有効にすると、`git-sc` はコミットまたは squash 成功後に `git push` を実行します。
262+
263+
> **注意**: 後方互換性のため、従来の `.git-sc-auto-push` ファイルも引き続きサポートされています。
230264
231265
## VS Code 拡張機能
232266

‎README.md‎

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,18 @@ git-sc -g abc1234 -b # With detailed body
152152

153153
## Configuration
154154

155-
Config file: `~/.git-sc`
155+
### Hierarchical Configuration
156+
157+
git-sc supports hierarchical configuration with project-level overrides:
158+
159+
| File | Scope | Description |
160+
|------|-------|-------------|
161+
| `~/.git-sc` | Global | User-wide default settings |
162+
| `.git-sc` | Project | Repository-specific overrides (in repo root) |
163+
164+
Project settings override global settings. Fields not specified in project config inherit from global config.
165+
166+
### Example Configuration
156167

157168
```toml
158169
# AI provider priority
@@ -161,6 +172,13 @@ providers = ["gemini", "codex", "claude"]
161172
# Commit message language
162173
language = "Japanese"
163174

175+
# Commit prefix format (optional)
176+
# Values: conventional, bracket, colon, emoji, plain, none
177+
prefix_type = "conventional"
178+
179+
# Auto-push after commit (optional)
180+
auto_push = true
181+
164182
# Model configuration
165183
[models]
166184
gemini = "flash"
@@ -177,11 +195,24 @@ provider_cooldown_minutes = 60
177195
|--------|-------------|---------|
178196
| `providers` | AI provider priority | `["gemini", "codex", "claude"]` |
179197
| `language` | Commit message language | `"Japanese"` |
198+
| `prefix_type` | Commit prefix format | Auto-detect |
199+
| `auto_push` | Auto-push after commit | `false` |
180200
| `models.*` | Model for each provider | See config |
181201
| `provider_cooldown_minutes` | Failed provider cooldown | `60` |
182202
| `prefix_rules` | URL-based prefix format | `[]` |
183203
| `prefix_scripts` | External prefix scripts | `[]` |
184204

205+
### prefix_type Values
206+
207+
| Value | Example | Description |
208+
|-------|---------|-------------|
209+
| `conventional` | `feat: add feature` | Conventional Commits format |
210+
| `bracket` | `[feat] add feature` | Bracket-style prefix |
211+
| `colon` | `feat: add feature` | Simple colon prefix |
212+
| `emoji` | `:sparkles: add feature` | Emoji prefix |
213+
| `plain` | `Add feature` | No prefix |
214+
| `none` | `add feature` | No prefix, lowercase |
215+
185216
### Prefix Rules
186217

187218
Specify commit format by remote URL:
@@ -218,15 +249,18 @@ Cargo.lock
218249
*.generated.ts
219250
```
220251

221-
### .git-sc-auto-push
252+
### Auto Push
222253

223-
Create this file in the repository root to automatically push after commit:
254+
Enable auto-push in your config file:
224255

225-
```bash
226-
touch .git-sc-auto-push
256+
```toml
257+
# In ~/.git-sc or .git-sc
258+
auto_push = true
227259
```
228260

229-
When this file exists, `git-sc` will run `git push` after a successful commit or squash.
261+
When enabled, `git-sc` will run `git push` after a successful commit or squash.
262+
263+
> **Note**: The legacy `.git-sc-auto-push` file is still supported for backward compatibility.
230264
231265
## VS Code Extension
232266

0 commit comments

Comments
 (0)