git-copilot-commit 0.1.9__tar.gz → 0.1.10__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: git-copilot-commit
3
- Version: 0.1.9
3
+ Version: 0.1.10
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
@@ -101,7 +101,7 @@ Options:
101
101
  $ uvx git-copilot-commit models --help
102
102
  Usage: git-copilot-commit models [OPTIONS]
103
103
 
104
- List models available for chat in a Rich table.
104
+ List models available for chat in a table.
105
105
 
106
106
  Options:
107
107
  --help Show this message and exit.
@@ -169,13 +169,6 @@ Follows [Conventional Commits](https://www.conventionalcommits.org/):
169
169
  - `chore`: Maintenance
170
170
  - `revert`: Revert changes
171
171
 
172
- **Examples:**
173
-
174
- - `feat(auth): add JWT authentication`
175
- - `fix(db): retry connection on failure`
176
- - `docs(readme): update install steps`
177
- - `refactor(utils): simplify date parsing`
178
-
179
172
  ## Git Configuration
180
173
 
181
174
  Add a git alias by adding the following to your `~/.gitconfig`:
@@ -189,11 +182,11 @@ Now you can run:
189
182
 
190
183
  ```bash
191
184
  git ai-commit
192
- git ai-commit --model claude-3.5-sonnet
193
185
  git ai-commit --all --verbose
186
+ git ai-commit --model claude-3.5-sonnet
194
187
  ```
195
188
 
196
- Show more context in diffs:
189
+ Additionally, show more context in diffs by running the following command:
197
190
 
198
191
  ```bash
199
192
  git config --global diff.context 3
@@ -88,7 +88,7 @@ Options:
88
88
  $ uvx git-copilot-commit models --help
89
89
  Usage: git-copilot-commit models [OPTIONS]
90
90
 
91
- List models available for chat in a Rich table.
91
+ List models available for chat in a table.
92
92
 
93
93
  Options:
94
94
  --help Show this message and exit.
@@ -156,13 +156,6 @@ Follows [Conventional Commits](https://www.conventionalcommits.org/):
156
156
  - `chore`: Maintenance
157
157
  - `revert`: Revert changes
158
158
 
159
- **Examples:**
160
-
161
- - `feat(auth): add JWT authentication`
162
- - `fix(db): retry connection on failure`
163
- - `docs(readme): update install steps`
164
- - `refactor(utils): simplify date parsing`
165
-
166
159
  ## Git Configuration
167
160
 
168
161
  Add a git alias by adding the following to your `~/.gitconfig`:
@@ -176,11 +169,11 @@ Now you can run:
176
169
 
177
170
  ```bash
178
171
  git ai-commit
179
- git ai-commit --model claude-3.5-sonnet
180
172
  git ai-commit --all --verbose
173
+ git ai-commit --model claude-3.5-sonnet
181
174
  ```
182
175
 
183
- Show more context in diffs:
176
+ Additionally, show more context in diffs by running the following command:
184
177
 
185
178
  ```bash
186
179
  git config --global diff.context 3
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "git-copilot-commit"
3
- version = "0.1.9"
3
+ version = "0.1.10"
4
4
  description = "Automatically generate and commit changes using copilot"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -21,7 +21,7 @@ app = typer.Typer(help=__doc__, add_completion=False)
21
21
 
22
22
  def version_callback(value: bool):
23
23
  if value:
24
- rich.print(f"git-copilot-version [bold green]{__version__}[/]")
24
+ rich.print(f"git-copilot-commit [bold green]{__version__}[/]")
25
25
  raise typer.Exit()
26
26
 
27
27
 
@@ -78,9 +78,13 @@ def generate_commit_message(
78
78
  ) -> str:
79
79
  """Generate a conventional commit message using Copilot API."""
80
80
 
81
- # Get recent commits for context
82
- recent_commits = repo.get_recent_commits(limit=5)
83
- recent_commits_text = "\n".join([f"- {msg}" for _, msg in recent_commits])
81
+ # Get recent commits for context (handle empty repositories)
82
+ try:
83
+ recent_commits = repo.get_recent_commits(limit=5)
84
+ recent_commits_text = "\n".join([f"- {msg}" for _, msg in recent_commits])
85
+ except GitError:
86
+ # No commits yet in this repository
87
+ recent_commits_text = "No previous commits (initial commit)"
84
88
 
85
89
  client = Copilot(
86
90
  system_prompt="""
@@ -172,6 +176,7 @@ Return the commit message as the output without any additional text, explanation
172
176
  )
173
177
 
174
178
  prompt = f"""Recent commits:
179
+
175
180
  {recent_commits_text}
176
181
 
177
182
  `git status`:
@@ -260,10 +265,14 @@ def commit(
260
265
  raise typer.Exit()
261
266
 
262
267
  # Generate or use provided commit message
263
- with console.status("[cyan]Generating commit message...[/cyan]"):
268
+ with console.status(
269
+ "[cyan]Generating commit message based on [bold]`git diff --staged`[/bold] ...[/cyan]"
270
+ ):
264
271
  commit_message = generate_commit_message(repo, status, model)
265
272
 
266
- console.print("[cyan]Generated commit message...[/cyan]")
273
+ console.print(
274
+ "[cyan]Generated commit message based on [bold]`git diff --staged`[/bold] ...[/cyan]"
275
+ )
267
276
 
268
277
  # Display commit message
269
278
  console.print(Panel(commit_message, title="Commit Message", border_style="green"))
@@ -315,7 +324,7 @@ def authenticate():
315
324
 
316
325
  @app.command()
317
326
  def models():
318
- """List models available for chat in a Rich table."""
327
+ """List models available for chat in a table."""
319
328
  models = Copilot().models
320
329
 
321
330
  console = Console()
@@ -57,7 +57,7 @@ wheels = [
57
57
 
58
58
  [[package]]
59
59
  name = "git-copilot-commit"
60
- version = "0.1.9"
60
+ version = "0.1.10"
61
61
  source = { editable = "." }
62
62
  dependencies = [
63
63
  { name = "platformdirs" },