gac 2.4.1__tar.gz → 2.5.0__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.

Potentially problematic release.


This version of gac might be problematic. Click here for more details.

Files changed (44) hide show
  1. {gac-2.4.1 → gac-2.5.0}/PKG-INFO +2 -2
  2. {gac-2.4.1 → gac-2.5.0}/README.md +1 -1
  3. {gac-2.4.1 → gac-2.5.0}/src/gac/__version__.py +1 -1
  4. {gac-2.4.1 → gac-2.5.0}/src/gac/cli.py +9 -0
  5. {gac-2.4.1 → gac-2.5.0}/src/gac/config.py +1 -0
  6. {gac-2.4.1 → gac-2.5.0}/src/gac/constants.py +1 -0
  7. {gac-2.4.1 → gac-2.5.0}/src/gac/git.py +6 -6
  8. {gac-2.4.1 → gac-2.5.0}/src/gac/main.py +7 -2
  9. {gac-2.4.1 → gac-2.5.0}/.gitignore +0 -0
  10. {gac-2.4.1 → gac-2.5.0}/LICENSE +0 -0
  11. {gac-2.4.1 → gac-2.5.0}/pyproject.toml +0 -0
  12. {gac-2.4.1 → gac-2.5.0}/src/gac/__init__.py +0 -0
  13. {gac-2.4.1 → gac-2.5.0}/src/gac/ai.py +0 -0
  14. {gac-2.4.1 → gac-2.5.0}/src/gac/ai_utils.py +0 -0
  15. {gac-2.4.1 → gac-2.5.0}/src/gac/config_cli.py +0 -0
  16. {gac-2.4.1 → gac-2.5.0}/src/gac/diff_cli.py +0 -0
  17. {gac-2.4.1 → gac-2.5.0}/src/gac/errors.py +0 -0
  18. {gac-2.4.1 → gac-2.5.0}/src/gac/init_cli.py +0 -0
  19. {gac-2.4.1 → gac-2.5.0}/src/gac/language_cli.py +0 -0
  20. {gac-2.4.1 → gac-2.5.0}/src/gac/preprocess.py +0 -0
  21. {gac-2.4.1 → gac-2.5.0}/src/gac/prompt.py +0 -0
  22. {gac-2.4.1 → gac-2.5.0}/src/gac/providers/__init__.py +0 -0
  23. {gac-2.4.1 → gac-2.5.0}/src/gac/providers/anthropic.py +0 -0
  24. {gac-2.4.1 → gac-2.5.0}/src/gac/providers/cerebras.py +0 -0
  25. {gac-2.4.1 → gac-2.5.0}/src/gac/providers/chutes.py +0 -0
  26. {gac-2.4.1 → gac-2.5.0}/src/gac/providers/custom_anthropic.py +0 -0
  27. {gac-2.4.1 → gac-2.5.0}/src/gac/providers/custom_openai.py +0 -0
  28. {gac-2.4.1 → gac-2.5.0}/src/gac/providers/deepseek.py +0 -0
  29. {gac-2.4.1 → gac-2.5.0}/src/gac/providers/fireworks.py +0 -0
  30. {gac-2.4.1 → gac-2.5.0}/src/gac/providers/gemini.py +0 -0
  31. {gac-2.4.1 → gac-2.5.0}/src/gac/providers/groq.py +0 -0
  32. {gac-2.4.1 → gac-2.5.0}/src/gac/providers/lmstudio.py +0 -0
  33. {gac-2.4.1 → gac-2.5.0}/src/gac/providers/minimax.py +0 -0
  34. {gac-2.4.1 → gac-2.5.0}/src/gac/providers/mistral.py +0 -0
  35. {gac-2.4.1 → gac-2.5.0}/src/gac/providers/ollama.py +0 -0
  36. {gac-2.4.1 → gac-2.5.0}/src/gac/providers/openai.py +0 -0
  37. {gac-2.4.1 → gac-2.5.0}/src/gac/providers/openrouter.py +0 -0
  38. {gac-2.4.1 → gac-2.5.0}/src/gac/providers/streamlake.py +0 -0
  39. {gac-2.4.1 → gac-2.5.0}/src/gac/providers/synthetic.py +0 -0
  40. {gac-2.4.1 → gac-2.5.0}/src/gac/providers/together.py +0 -0
  41. {gac-2.4.1 → gac-2.5.0}/src/gac/providers/zai.py +0 -0
  42. {gac-2.4.1 → gac-2.5.0}/src/gac/security.py +0 -0
  43. {gac-2.4.1 → gac-2.5.0}/src/gac/utils.py +0 -0
  44. {gac-2.4.1 → gac-2.5.0}/src/gac/workflow_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gac
3
- Version: 2.4.1
3
+ Version: 2.5.0
4
4
  Summary: LLM-powered Git commit message generator with multi-provider support
5
5
  Project-URL: Homepage, https://github.com/cellwebb/gac
6
6
  Project-URL: Documentation, https://github.com/cellwebb/gac#readme
@@ -56,7 +56,7 @@ Description-Content-Type: text/markdown
56
56
  [![Contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg)](docs/en/CONTRIBUTING.md)
57
57
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
58
58
 
59
- **English** | [简体中文](README.zh-CN.md) | [繁體中文](README.zh-TW.md) | [日本語](README.ja.md) | [한국어](README.ko.md) | [हिन्दी](README.hi.md) | [Français](README.fr.md) | [Русский](README.ru.md) | [Español](README.es.md) | [Português](README.pt.md) | [Deutsch](README.de.md) | [Nederlands](README.nl.md)
59
+ **English** | [简体中文](docs/zh-CN/README.md) | [繁體中文](docs/zh-TW/README.md) | [日本語](docs/ja/README.md) | [한국어](docs/ko/README.md) | [हिन्दी](docs/hi/README.md) | [Français](docs/fr/README.md) | [Русский](docs/ru/README.md) | [Español](docs/es/README.md) | [Português](docs/pt/README.md) | [Deutsch](docs/de/README.md) | [Nederlands](docs/nl/README.md)
60
60
 
61
61
  **LLM-powered commit messages that understand your code!**
62
62
 
@@ -14,7 +14,7 @@
14
14
  [![Contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg)](docs/en/CONTRIBUTING.md)
15
15
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
16
16
 
17
- **English** | [简体中文](README.zh-CN.md) | [繁體中文](README.zh-TW.md) | [日本語](README.ja.md) | [한국어](README.ko.md) | [हिन्दी](README.hi.md) | [Français](README.fr.md) | [Русский](README.ru.md) | [Español](README.es.md) | [Português](README.pt.md) | [Deutsch](README.de.md) | [Nederlands](README.nl.md)
17
+ **English** | [简体中文](docs/zh-CN/README.md) | [繁體中文](docs/zh-TW/README.md) | [日本語](docs/ja/README.md) | [한국어](docs/ko/README.md) | [हिन्दी](docs/hi/README.md) | [Français](docs/fr/README.md) | [Русский](docs/ru/README.md) | [Español](docs/es/README.md) | [Português](docs/pt/README.md) | [Deutsch](docs/de/README.md) | [Nederlands](docs/nl/README.md)
18
18
 
19
19
  **LLM-powered commit messages that understand your code!**
20
20
 
@@ -1,3 +1,3 @@
1
1
  """Version information for gac package."""
2
2
 
3
- __version__ = "2.4.1"
3
+ __version__ = "2.5.0"
@@ -66,6 +66,12 @@ logger = logging.getLogger(__name__)
66
66
  # Advanced options
67
67
  @click.option("--no-verify", is_flag=True, help="Skip pre-commit and lefthook hooks when committing")
68
68
  @click.option("--skip-secret-scan", is_flag=True, help="Skip security scan for secrets in staged changes")
69
+ @click.option(
70
+ "--hook-timeout",
71
+ type=int,
72
+ default=0,
73
+ help="Timeout for pre-commit and lefthook hooks in seconds (0 to use configuration)",
74
+ )
69
75
  # Other options
70
76
  @click.option("--version", is_flag=True, help="Show the version of the Git Auto Commit (gac) tool")
71
77
  @click.pass_context
@@ -88,6 +94,7 @@ def cli(
88
94
  verbose: bool = False,
89
95
  no_verify: bool = False,
90
96
  skip_secret_scan: bool = False,
97
+ hook_timeout: int = 0,
91
98
  ) -> None:
92
99
  """Git Auto Commit - Generate commit messages with AI."""
93
100
  if ctx.invoked_subcommand is None:
@@ -126,6 +133,7 @@ def cli(
126
133
  no_verify=no_verify,
127
134
  skip_secret_scan=skip_secret_scan or bool(config.get("skip_secret_scan", False)),
128
135
  language=resolved_language,
136
+ hook_timeout=hook_timeout if hook_timeout > 0 else int(config.get("hook_timeout", 120)),
129
137
  )
130
138
  except Exception as e:
131
139
  handle_error(e, exit_program=True)
@@ -151,6 +159,7 @@ def cli(
151
159
  "verbose": verbose,
152
160
  "no_verify": no_verify,
153
161
  "skip_secret_scan": skip_secret_scan,
162
+ "hook_timeout": hook_timeout,
154
163
  }
155
164
 
156
165
 
@@ -42,6 +42,7 @@ def load_config() -> dict[str, str | int | float | bool | None]:
42
42
  "language": os.getenv("GAC_LANGUAGE"),
43
43
  "translate_prefixes": os.getenv("GAC_TRANSLATE_PREFIXES", "false").lower() in ("true", "1", "yes", "on"),
44
44
  "rtl_confirmed": os.getenv("GAC_RTL_CONFIRMED", "false").lower() in ("true", "1", "yes", "on"),
45
+ "hook_timeout": int(os.getenv("GAC_HOOK_TIMEOUT", EnvDefaults.HOOK_TIMEOUT)),
45
46
  }
46
47
 
47
48
  return config
@@ -25,6 +25,7 @@ class EnvDefaults:
25
25
  ALWAYS_INCLUDE_SCOPE: bool = False
26
26
  SKIP_SECRET_SCAN: bool = False
27
27
  VERBOSE: bool = False
28
+ HOOK_TIMEOUT: int = 120 # Timeout for pre-commit and lefthook hooks in seconds
28
29
 
29
30
 
30
31
  class Logging:
@@ -205,7 +205,7 @@ def get_commit_hash() -> str:
205
205
  return result
206
206
 
207
207
 
208
- def run_pre_commit_hooks() -> bool:
208
+ def run_pre_commit_hooks(hook_timeout: int = 120) -> bool:
209
209
  """Run pre-commit hooks if they exist.
210
210
 
211
211
  Returns:
@@ -225,9 +225,9 @@ def run_pre_commit_hooks() -> bool:
225
225
  return True
226
226
 
227
227
  # Run pre-commit hooks on staged files
228
- logger.info("Running pre-commit hooks...")
228
+ logger.info(f"Running pre-commit hooks with {hook_timeout}s timeout...")
229
229
  # Run pre-commit and capture both stdout and stderr
230
- result = run_subprocess_with_encoding_fallback(["pre-commit", "run"])
230
+ result = run_subprocess_with_encoding_fallback(["pre-commit", "run"], timeout=hook_timeout)
231
231
 
232
232
  if result.returncode == 0:
233
233
  # All hooks passed
@@ -252,7 +252,7 @@ def run_pre_commit_hooks() -> bool:
252
252
  return True
253
253
 
254
254
 
255
- def run_lefthook_hooks() -> bool:
255
+ def run_lefthook_hooks(hook_timeout: int = 120) -> bool:
256
256
  """Run Lefthook hooks if they exist.
257
257
 
258
258
  Returns:
@@ -275,9 +275,9 @@ def run_lefthook_hooks() -> bool:
275
275
  return True
276
276
 
277
277
  # Run lefthook hooks on staged files
278
- logger.info("Running Lefthook hooks...")
278
+ logger.info(f"Running Lefthook hooks with {hook_timeout}s timeout...")
279
279
  # Run lefthook and capture both stdout and stderr
280
- result = run_subprocess_with_encoding_fallback(["lefthook", "run", "pre-commit"])
280
+ result = run_subprocess_with_encoding_fallback(["lefthook", "run", "pre-commit"], timeout=hook_timeout)
281
281
 
282
282
  if result.returncode == 0:
283
283
  # All hooks passed
@@ -134,6 +134,7 @@ def execute_grouped_commits_workflow(
134
134
  dry_run: bool,
135
135
  push: bool,
136
136
  show_prompt: bool,
137
+ hook_timeout: int = 120,
137
138
  ) -> None:
138
139
  """Execute the grouped commits workflow."""
139
140
  import json
@@ -389,6 +390,7 @@ def execute_single_commit_workflow(
389
390
  dry_run: bool,
390
391
  push: bool,
391
392
  show_prompt: bool,
393
+ hook_timeout: int = 120,
392
394
  ) -> None:
393
395
  if show_prompt:
394
396
  full_prompt = f"SYSTEM PROMPT:\n{system_prompt}\n\nUSER PROMPT:\n{user_prompt}"
@@ -497,6 +499,7 @@ def main(
497
499
  no_verify: bool = False,
498
500
  skip_secret_scan: bool = False,
499
501
  language: str | None = None,
502
+ hook_timeout: int = 120,
500
503
  ) -> None:
501
504
  """Main application logic for gac."""
502
505
  try:
@@ -549,12 +552,12 @@ def main(
549
552
  sys.exit(0)
550
553
 
551
554
  if not no_verify and not dry_run:
552
- if not run_lefthook_hooks():
555
+ if not run_lefthook_hooks(hook_timeout):
553
556
  console.print("[red]Lefthook hooks failed. Please fix the issues and try again.[/red]")
554
557
  console.print("[yellow]You can use --no-verify to skip pre-commit and lefthook hooks.[/yellow]")
555
558
  sys.exit(1)
556
559
 
557
- if not run_pre_commit_hooks():
560
+ if not run_pre_commit_hooks(hook_timeout):
558
561
  console.print("[red]Pre-commit hooks failed. Please fix the issues and try again.[/red]")
559
562
  console.print("[yellow]You can use --no-verify to skip pre-commit and lefthook hooks.[/yellow]")
560
563
  sys.exit(1)
@@ -687,6 +690,7 @@ def main(
687
690
  dry_run=dry_run,
688
691
  push=push,
689
692
  show_prompt=show_prompt,
693
+ hook_timeout=hook_timeout,
690
694
  )
691
695
  except AIError as e:
692
696
  logger.error(str(e))
@@ -707,6 +711,7 @@ def main(
707
711
  dry_run=dry_run,
708
712
  push=push,
709
713
  show_prompt=show_prompt,
714
+ hook_timeout=hook_timeout,
710
715
  )
711
716
  except AIError as e:
712
717
  logger.error(str(e))
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
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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes