git-copilot-commit 0.1.17__tar.gz → 0.1.18__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.17 → git_copilot_commit-0.1.18}/PKG-INFO +1 -1
- {git_copilot_commit-0.1.17 → git_copilot_commit-0.1.18}/src/git_copilot_commit/cli.py +37 -10
- {git_copilot_commit-0.1.17 → git_copilot_commit-0.1.18}/.github/workflows/ci.yml +0 -0
- {git_copilot_commit-0.1.17 → git_copilot_commit-0.1.18}/.gitignore +0 -0
- {git_copilot_commit-0.1.17 → git_copilot_commit-0.1.18}/.python-version +0 -0
- {git_copilot_commit-0.1.17 → git_copilot_commit-0.1.18}/LICENSE +0 -0
- {git_copilot_commit-0.1.17 → git_copilot_commit-0.1.18}/README.md +0 -0
- {git_copilot_commit-0.1.17 → git_copilot_commit-0.1.18}/pyproject.toml +0 -0
- {git_copilot_commit-0.1.17 → git_copilot_commit-0.1.18}/src/git_copilot_commit/__init__.py +0 -0
- {git_copilot_commit-0.1.17 → git_copilot_commit-0.1.18}/src/git_copilot_commit/git.py +0 -0
- /git_copilot_commit-0.1.17/src/git_copilot_commit/prompts/commit_message_generator.md → /git_copilot_commit-0.1.18/src/git_copilot_commit/prompts/commit-message-generator-prompt.md +0 -0
- {git_copilot_commit-0.1.17 → git_copilot_commit-0.1.18}/src/git_copilot_commit/py.typed +0 -0
- {git_copilot_commit-0.1.17 → git_copilot_commit-0.1.18}/src/git_copilot_commit/settings.py +0 -0
- {git_copilot_commit-0.1.17 → git_copilot_commit-0.1.18}/src/git_copilot_commit/version.py +0 -0
- {git_copilot_commit-0.1.17 → git_copilot_commit-0.1.18}/uv.lock +0 -0
- {git_copilot_commit-0.1.17 → git_copilot_commit-0.1.18}/vhs/demo.vhs +0 -0
|
@@ -42,18 +42,39 @@ def main(
|
|
|
42
42
|
raise typer.Exit()
|
|
43
43
|
|
|
44
44
|
|
|
45
|
+
def get_prompt_locations():
|
|
46
|
+
"""Get potential prompt file locations in order of preference."""
|
|
47
|
+
import importlib.resources
|
|
48
|
+
|
|
49
|
+
filename = "commit-message-generator-prompt.md"
|
|
50
|
+
|
|
51
|
+
return [
|
|
52
|
+
Path(Settings().data_dir) / "prompts" / filename, # User customizable
|
|
53
|
+
importlib.resources.files("git_copilot_commit") / "prompts" / filename # Packaged version
|
|
54
|
+
]
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def get_active_prompt_path():
|
|
58
|
+
"""Get the path of the prompt file that will be used."""
|
|
59
|
+
for path in get_prompt_locations():
|
|
60
|
+
try:
|
|
61
|
+
path.read_text(encoding="utf-8")
|
|
62
|
+
return str(path)
|
|
63
|
+
except (FileNotFoundError, AttributeError):
|
|
64
|
+
continue
|
|
65
|
+
return None
|
|
66
|
+
|
|
67
|
+
|
|
45
68
|
def load_system_prompt() -> str:
|
|
46
69
|
"""Load the system prompt from the markdown file."""
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
console.print("[red]Error: Prompt file not found[/red]")
|
|
56
|
-
raise typer.Exit(1)
|
|
70
|
+
for path in get_prompt_locations():
|
|
71
|
+
try:
|
|
72
|
+
return path.read_text(encoding="utf-8")
|
|
73
|
+
except (FileNotFoundError, AttributeError):
|
|
74
|
+
continue
|
|
75
|
+
|
|
76
|
+
console.print("[red]Error: Prompt file not found in any location[/red]")
|
|
77
|
+
raise typer.Exit(1)
|
|
57
78
|
|
|
58
79
|
|
|
59
80
|
def generate_commit_message(
|
|
@@ -276,6 +297,12 @@ def config(
|
|
|
276
297
|
else:
|
|
277
298
|
console.print("Default model: [dim]not set[/dim]")
|
|
278
299
|
|
|
300
|
+
active_prompt = get_active_prompt_path()
|
|
301
|
+
if active_prompt:
|
|
302
|
+
console.print(f"Active prompt file: [cyan]{active_prompt}[/cyan]")
|
|
303
|
+
else:
|
|
304
|
+
console.print("Active prompt file: [red]not found[/red]")
|
|
305
|
+
|
|
279
306
|
console.print(f"Config file: [dim]{settings.config_file}[/dim]")
|
|
280
307
|
|
|
281
308
|
|
|
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
|
|
File without changes
|
|
File without changes
|