git-copilot-commit 0.1.13__tar.gz → 0.1.14__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.13 → git_copilot_commit-0.1.14}/PKG-INFO +1 -1
- {git_copilot_commit-0.1.13 → git_copilot_commit-0.1.14}/src/git_copilot_commit/cli.py +1 -1
- {git_copilot_commit-0.1.13 → git_copilot_commit-0.1.14}/src/git_copilot_commit/git.py +0 -48
- {git_copilot_commit-0.1.13 → git_copilot_commit-0.1.14}/.github/workflows/ci.yml +0 -0
- {git_copilot_commit-0.1.13 → git_copilot_commit-0.1.14}/.gitignore +0 -0
- {git_copilot_commit-0.1.13 → git_copilot_commit-0.1.14}/.python-version +0 -0
- {git_copilot_commit-0.1.13 → git_copilot_commit-0.1.14}/LICENSE +0 -0
- {git_copilot_commit-0.1.13 → git_copilot_commit-0.1.14}/README.md +0 -0
- {git_copilot_commit-0.1.13 → git_copilot_commit-0.1.14}/pyproject.toml +0 -0
- {git_copilot_commit-0.1.13 → git_copilot_commit-0.1.14}/src/git_copilot_commit/__init__.py +0 -0
- {git_copilot_commit-0.1.13 → git_copilot_commit-0.1.14}/src/git_copilot_commit/py.typed +0 -0
- {git_copilot_commit-0.1.13 → git_copilot_commit-0.1.14}/src/git_copilot_commit/settings.py +0 -0
- {git_copilot_commit-0.1.13 → git_copilot_commit-0.1.14}/src/git_copilot_commit/version.py +0 -0
- {git_copilot_commit-0.1.13 → git_copilot_commit-0.1.14}/uv.lock +0 -0
- {git_copilot_commit-0.1.13 → git_copilot_commit-0.1.14}/vhs/demo.vhs +0 -0
|
@@ -9,7 +9,7 @@ from rich.panel import Panel
|
|
|
9
9
|
from rich.table import Table
|
|
10
10
|
import rich
|
|
11
11
|
|
|
12
|
-
from pycopilot.copilot import Copilot
|
|
12
|
+
from pycopilot.copilot import Copilot # type: ignore
|
|
13
13
|
from pycopilot.auth import Authentication
|
|
14
14
|
from .git import GitRepository, GitError, NotAGitRepositoryError, GitStatus
|
|
15
15
|
from .settings import Settings
|
|
@@ -302,51 +302,3 @@ class GitRepository:
|
|
|
302
302
|
commits.append((sha, message))
|
|
303
303
|
|
|
304
304
|
return commits
|
|
305
|
-
|
|
306
|
-
def get_current_branch(self) -> str:
|
|
307
|
-
"""Get the name of the current branch."""
|
|
308
|
-
result = self._run_git_command(["rev-parse", "--abbrev-ref", "HEAD"])
|
|
309
|
-
return result.stdout.strip()
|
|
310
|
-
|
|
311
|
-
def has_changes(self) -> bool:
|
|
312
|
-
"""Check if there are any changes (staged, unstaged, or untracked)."""
|
|
313
|
-
status = self.get_status()
|
|
314
|
-
return (
|
|
315
|
-
status.has_staged_changes
|
|
316
|
-
or status.has_unstaged_changes
|
|
317
|
-
or status.has_untracked_files
|
|
318
|
-
)
|
|
319
|
-
|
|
320
|
-
def get_diff(self, staged: bool = False, paths: list[str] | None = None) -> str:
|
|
321
|
-
"""
|
|
322
|
-
Get diff output.
|
|
323
|
-
|
|
324
|
-
Args:
|
|
325
|
-
staged: Whether to get staged diff (--staged flag).
|
|
326
|
-
paths: Specific paths to diff.
|
|
327
|
-
|
|
328
|
-
Returns:
|
|
329
|
-
Diff output as string.
|
|
330
|
-
"""
|
|
331
|
-
args = ["diff"]
|
|
332
|
-
if staged:
|
|
333
|
-
args.append("--staged")
|
|
334
|
-
if paths:
|
|
335
|
-
args.extend(["--"] + paths)
|
|
336
|
-
|
|
337
|
-
result = self._run_git_command(args)
|
|
338
|
-
return result.stdout
|
|
339
|
-
|
|
340
|
-
def get_file_content(self, path: str, revision: str = "HEAD") -> str:
|
|
341
|
-
"""
|
|
342
|
-
Get content of a file at a specific revision.
|
|
343
|
-
|
|
344
|
-
Args:
|
|
345
|
-
path: File path.
|
|
346
|
-
revision: Git revision (default: HEAD).
|
|
347
|
-
|
|
348
|
-
Returns:
|
|
349
|
-
File content as string.
|
|
350
|
-
"""
|
|
351
|
-
result = self._run_git_command(["show", f"{revision}:{path}"])
|
|
352
|
-
return result.stdout
|
|
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
|