git-copilot-commit 0.1.15__tar.gz → 0.1.16__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {git_copilot_commit-0.1.15 → git_copilot_commit-0.1.16}/PKG-INFO +4 -6
- {git_copilot_commit-0.1.15 → git_copilot_commit-0.1.16}/README.md +3 -5
- {git_copilot_commit-0.1.15 → git_copilot_commit-0.1.16}/src/git_copilot_commit/cli.py +9 -67
- {git_copilot_commit-0.1.15 → git_copilot_commit-0.1.16}/.github/workflows/ci.yml +0 -0
- {git_copilot_commit-0.1.15 → git_copilot_commit-0.1.16}/.gitignore +0 -0
- {git_copilot_commit-0.1.15 → git_copilot_commit-0.1.16}/.python-version +0 -0
- {git_copilot_commit-0.1.15 → git_copilot_commit-0.1.16}/LICENSE +0 -0
- {git_copilot_commit-0.1.15 → git_copilot_commit-0.1.16}/pyproject.toml +0 -0
- {git_copilot_commit-0.1.15 → git_copilot_commit-0.1.16}/src/git_copilot_commit/__init__.py +0 -0
- {git_copilot_commit-0.1.15 → git_copilot_commit-0.1.16}/src/git_copilot_commit/git.py +0 -0
- {git_copilot_commit-0.1.15 → git_copilot_commit-0.1.16}/src/git_copilot_commit/py.typed +0 -0
- {git_copilot_commit-0.1.15 → git_copilot_commit-0.1.16}/src/git_copilot_commit/settings.py +0 -0
- {git_copilot_commit-0.1.15 → git_copilot_commit-0.1.16}/src/git_copilot_commit/version.py +0 -0
- {git_copilot_commit-0.1.15 → git_copilot_commit-0.1.16}/uv.lock +0 -0
- {git_copilot_commit-0.1.15 → git_copilot_commit-0.1.16}/vhs/demo.vhs +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: git-copilot-commit
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.16
|
|
4
4
|
Summary: Automatically generate and commit changes using copilot
|
|
5
5
|
Author-email: Dheepak Krishnamurthy <1813121+kdheepak@users.noreply.github.com>
|
|
6
6
|
License-File: LICENSE
|
|
@@ -100,7 +100,6 @@ Usage: git-copilot-commit commit [OPTIONS]
|
|
|
100
100
|
|
|
101
101
|
Options:
|
|
102
102
|
-a, --all Stage all files before committing
|
|
103
|
-
-v, --verbose Show verbose output
|
|
104
103
|
-m, --model TEXT Model to use for generating commit message
|
|
105
104
|
-y, --yes Automatically accept the generated commit message
|
|
106
105
|
--help Show this message and exit.
|
|
@@ -152,10 +151,10 @@ Commit all changes:
|
|
|
152
151
|
git-copilot-commit commit --all
|
|
153
152
|
```
|
|
154
153
|
|
|
155
|
-
|
|
154
|
+
Accept the generated commit message without editing:
|
|
156
155
|
|
|
157
156
|
```bash
|
|
158
|
-
git-copilot-commit commit --
|
|
157
|
+
git-copilot-commit commit --yes
|
|
159
158
|
```
|
|
160
159
|
|
|
161
160
|
Use a specific model:
|
|
@@ -205,8 +204,7 @@ Now you can run:
|
|
|
205
204
|
|
|
206
205
|
```bash
|
|
207
206
|
git ai-commit
|
|
208
|
-
git ai-commit --all --
|
|
209
|
-
git ai-commit --model claude-3.5-sonnet
|
|
207
|
+
git ai-commit --all --yes --model claude-3.5-sonnet
|
|
210
208
|
```
|
|
211
209
|
|
|
212
210
|
Additionally, show more context in diffs by running the following command:
|
|
@@ -87,7 +87,6 @@ Usage: git-copilot-commit commit [OPTIONS]
|
|
|
87
87
|
|
|
88
88
|
Options:
|
|
89
89
|
-a, --all Stage all files before committing
|
|
90
|
-
-v, --verbose Show verbose output
|
|
91
90
|
-m, --model TEXT Model to use for generating commit message
|
|
92
91
|
-y, --yes Automatically accept the generated commit message
|
|
93
92
|
--help Show this message and exit.
|
|
@@ -139,10 +138,10 @@ Commit all changes:
|
|
|
139
138
|
git-copilot-commit commit --all
|
|
140
139
|
```
|
|
141
140
|
|
|
142
|
-
|
|
141
|
+
Accept the generated commit message without editing:
|
|
143
142
|
|
|
144
143
|
```bash
|
|
145
|
-
git-copilot-commit commit --
|
|
144
|
+
git-copilot-commit commit --yes
|
|
146
145
|
```
|
|
147
146
|
|
|
148
147
|
Use a specific model:
|
|
@@ -192,8 +191,7 @@ Now you can run:
|
|
|
192
191
|
|
|
193
192
|
```bash
|
|
194
193
|
git ai-commit
|
|
195
|
-
git ai-commit --all --
|
|
196
|
-
git ai-commit --model claude-3.5-sonnet
|
|
194
|
+
git ai-commit --all --yes --model claude-3.5-sonnet
|
|
197
195
|
```
|
|
198
196
|
|
|
199
197
|
Additionally, show more context in diffs by running the following command:
|
|
@@ -41,38 +41,6 @@ def main(
|
|
|
41
41
|
raise typer.Exit()
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
def display_file_status(status: GitStatus) -> None:
|
|
45
|
-
"""Display file status in a rich table."""
|
|
46
|
-
if not status.files:
|
|
47
|
-
return
|
|
48
|
-
|
|
49
|
-
table = Table(title="Git Status")
|
|
50
|
-
table.add_column("Status", style="yellow", width=8)
|
|
51
|
-
table.add_column("File", style="white")
|
|
52
|
-
|
|
53
|
-
# Group files by status
|
|
54
|
-
staged = status.staged_files
|
|
55
|
-
unstaged = status.unstaged_files
|
|
56
|
-
untracked = status.untracked_files
|
|
57
|
-
|
|
58
|
-
if staged:
|
|
59
|
-
table.add_row("[green]Staged[/green]", "", style="dim")
|
|
60
|
-
for file in staged:
|
|
61
|
-
table.add_row(f" {file.staged_status}", file.path)
|
|
62
|
-
|
|
63
|
-
if unstaged:
|
|
64
|
-
table.add_row("[yellow]Unstaged[/yellow]", "", style="dim")
|
|
65
|
-
for file in unstaged:
|
|
66
|
-
table.add_row(f" {file.status}", file.path)
|
|
67
|
-
|
|
68
|
-
if untracked:
|
|
69
|
-
table.add_row("[red]Untracked[/red]", "", style="dim")
|
|
70
|
-
for file in untracked:
|
|
71
|
-
table.add_row(" ?", file.path)
|
|
72
|
-
|
|
73
|
-
console.print(table)
|
|
74
|
-
|
|
75
|
-
|
|
76
44
|
def generate_commit_message(
|
|
77
45
|
repo: GitRepository, status: GitStatus, model: str | None = None
|
|
78
46
|
) -> str:
|
|
@@ -120,11 +88,11 @@ The guidelines for the commit messages are as follows:
|
|
|
120
88
|
|
|
121
89
|
3. Scope (Optional but encouraged):
|
|
122
90
|
|
|
123
|
-
- Enclose in parentheses
|
|
124
|
-
- Use the affected module, component, or area
|
|
125
|
-
- For multiple files in same area, use the broader scope
|
|
126
|
-
- For single files, you may use filename
|
|
127
|
-
- Scope should be a single word or hyphenated phrase describing the affected module
|
|
91
|
+
- Enclose in parentheses
|
|
92
|
+
- Use the affected module, component, or area
|
|
93
|
+
- For multiple files in same area, use the broader scope
|
|
94
|
+
- For single files, you may use filename
|
|
95
|
+
- Scope should be a single word or hyphenated phrase describing the affected module
|
|
128
96
|
|
|
129
97
|
4. Description:
|
|
130
98
|
|
|
@@ -132,7 +100,7 @@ The guidelines for the commit messages are as follows:
|
|
|
132
100
|
- Be concise yet informative.
|
|
133
101
|
- Focus on the primary change, not all details.
|
|
134
102
|
- Do not make assumptions about why the change was made or how it works.
|
|
135
|
-
-
|
|
103
|
+
- When bumping versions, do not mention the names of the files.
|
|
136
104
|
|
|
137
105
|
5. Analyzing Git Diffs:
|
|
138
106
|
|
|
@@ -141,21 +109,6 @@ The guidelines for the commit messages are as follows:
|
|
|
141
109
|
- Identify the primary purpose of the change set.
|
|
142
110
|
- If changes span multiple unrelated areas, focus on the most significant one.
|
|
143
111
|
|
|
144
|
-
Examples:
|
|
145
|
-
|
|
146
|
-
✅ Good Commit Messages:
|
|
147
|
-
|
|
148
|
-
- feat(api): add user authentication with JWT
|
|
149
|
-
- fix(database): handle connection retries properly
|
|
150
|
-
- docs(readme): update installation instructions
|
|
151
|
-
- refactor(utils): simplify date parsing logic
|
|
152
|
-
- chore(deps): update dependencies to latest versions
|
|
153
|
-
- feat(auth): implement OAuth2 integration
|
|
154
|
-
- fix(payments): resolve double-charging bug in subscription renewal
|
|
155
|
-
- refactor(database): extract query builder into separate module
|
|
156
|
-
- chore(ci): add automated security scanning to pipeline
|
|
157
|
-
- docs(api): add OpenAPI specifications for user endpoints
|
|
158
|
-
|
|
159
112
|
❌ Strongly Avoid:
|
|
160
113
|
|
|
161
114
|
- Vague descriptions: "fixed bug", "updated code", "made changes"
|
|
@@ -165,12 +118,12 @@ Examples:
|
|
|
165
118
|
- Not in imperative mood: "new feature", "updates stuff"
|
|
166
119
|
|
|
167
120
|
Given a Git diff, a list of modified files, or a short description of changes,
|
|
168
|
-
generate a single clear and structured Conventional Commit message following the above rules.
|
|
121
|
+
generate a single, short, clear and structured Conventional Commit message following the above rules.
|
|
169
122
|
If multiple changes are detected, prioritize the most important changes in a single commit message.
|
|
170
123
|
Do not add any body or footer.
|
|
171
|
-
You can only give one reply for each conversation
|
|
124
|
+
You can only give one reply for each conversation.
|
|
172
125
|
|
|
173
|
-
|
|
126
|
+
Do not wrap the response in triple backticks or single backticks.
|
|
174
127
|
Return the commit message as the output without any additional text, explanations, or formatting markers.
|
|
175
128
|
"""
|
|
176
129
|
)
|
|
@@ -202,7 +155,6 @@ def commit(
|
|
|
202
155
|
all_files: bool = typer.Option(
|
|
203
156
|
False, "--all", "-a", help="Stage all files before committing"
|
|
204
157
|
),
|
|
205
|
-
verbose: bool = typer.Option(False, "--verbose", "-v", help="Show verbose output"),
|
|
206
158
|
model: str | None = typer.Option(
|
|
207
159
|
None, "--model", "-m", help="Model to use for generating commit message"
|
|
208
160
|
),
|
|
@@ -231,10 +183,6 @@ def commit(
|
|
|
231
183
|
console.print("[yellow]No changes to commit.[/yellow]")
|
|
232
184
|
raise typer.Exit()
|
|
233
185
|
|
|
234
|
-
# Display current status
|
|
235
|
-
if verbose:
|
|
236
|
-
display_file_status(status)
|
|
237
|
-
|
|
238
186
|
# Handle staging based on options
|
|
239
187
|
if all_files:
|
|
240
188
|
repo.stage_files() # Stage all files
|
|
@@ -280,12 +228,6 @@ def commit(
|
|
|
280
228
|
# Display commit message
|
|
281
229
|
console.print(Panel(commit_message, title="Commit Message", border_style="green"))
|
|
282
230
|
|
|
283
|
-
# Show what will be committed in verbose mode
|
|
284
|
-
if verbose:
|
|
285
|
-
console.print("\n[bold]Changes to be committed:[/bold]")
|
|
286
|
-
for file in status.staged_files:
|
|
287
|
-
console.print(f" {file.staged_status} {file.path}")
|
|
288
|
-
|
|
289
231
|
# Confirm commit or edit message (skip if --yes flag is used)
|
|
290
232
|
if yes:
|
|
291
233
|
# Automatically commit with generated message
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|