From 03f3024c66aca79d21dc7775a76bc0d3282bbb63 Mon Sep 17 00:00:00 2001
From: Manfred Riem <15701806+mnriem@users.noreply.github.com>
Date: Fri, 24 Apr 2026 13:54:40 -0500
Subject: [PATCH] feat(init): deprecate --no-git flag, gate deprecations at
v0.10.0 (#2357)
* feat(init): deprecate --no-git flag, gate deprecations at v0.10.0
- Add deprecation warning when --no-git is used on specify init
- Update --ai deprecation gate from 1.0.0 to 0.10.0
- Update test expectation for the new version gate
Closes #2167
* fix: address PR review feedback
- Update --no-git deprecation message to reference existing 'specify extension'
commands instead of non-existent --extension flag
- Add test_no_git_emits_deprecation_warning CLI test
* fix: strengthen --no-git deprecation test assertions
Add assertions unique to the --no-git message ('will be removed',
'git extension will no longer be enabled by default') to prevent
false positives from the --ai deprecation panel.
---
src/specify_cli/__init__.py | 9 ++++++++-
tests/integrations/test_cli.py | 29 ++++++++++++++++++++++++++++-
2 files changed, 36 insertions(+), 2 deletions(-)
diff --git a/src/specify_cli/__init__.py b/src/specify_cli/__init__.py
index 1c3e63ec0..618492f30 100644
--- a/src/specify_cli/__init__.py
+++ b/src/specify_cli/__init__.py
@@ -127,7 +127,7 @@ def _build_ai_deprecation_warning(
ai_commands_dir=ai_commands_dir,
)
return (
- "[bold]--ai[/bold] is deprecated and will no longer be available in version 1.0.0 or later.\n\n"
+ "[bold]--ai[/bold] is deprecated and will no longer be available in version 0.10.0 or later.\n\n"
f"Use [bold]{replacement}[/bold] instead."
)
@@ -1088,6 +1088,13 @@ def init(
'use [bold]--integration generic --integration-options="--commands-dir
"[/bold] instead.[/dim]'
)
+ if no_git:
+ console.print(
+ "[yellow]⚠️ --no-git is deprecated and will be removed in v0.10.0.[/yellow]\n"
+ "[yellow]The git extension will no longer be enabled by default "
+ "— use the [bold]specify extension[/bold] commands to install or enable the git extension if needed.[/yellow]"
+ )
+
if project_name == ".":
here = True
project_name = None # Clear project_name to use existing validation logic
diff --git a/tests/integrations/test_cli.py b/tests/integrations/test_cli.py
index 152c56813..df48323ed 100644
--- a/tests/integrations/test_cli.py
+++ b/tests/integrations/test_cli.py
@@ -112,7 +112,7 @@ class TestInitIntegrationFlag:
assert "--ai" in normalized_output
assert "deprecated" in normalized_output
assert "no longer be available" in normalized_output
- assert "1.0.0" in normalized_output
+ assert "0.10.0" in normalized_output
assert "--integration copilot" in normalized_output
assert normalized_output.index("Deprecation Warning") < normalized_output.index("Next Steps")
assert (project / ".github" / "agents" / "speckit.plan.agent.md").exists()
@@ -446,6 +446,33 @@ class TestGitExtensionAutoInstall:
ext_dir = project / ".specify" / "extensions" / "git"
assert not ext_dir.exists(), "git extension should not be installed with --no-git"
+ def test_no_git_emits_deprecation_warning(self, tmp_path):
+ """Using --no-git emits a visible deprecation warning."""
+ from typer.testing import CliRunner
+ from specify_cli import app
+
+ project = tmp_path / "no-git-warn"
+ project.mkdir()
+ old_cwd = os.getcwd()
+ try:
+ os.chdir(project)
+ runner = CliRunner()
+ result = runner.invoke(app, [
+ "init", "--here", "--ai", "claude", "--script", "sh",
+ "--no-git", "--ignore-agent-tools",
+ ], catch_exceptions=False)
+ finally:
+ os.chdir(old_cwd)
+
+ normalized_output = _normalize_cli_output(result.output)
+ assert result.exit_code == 0, result.output
+ assert "--no-git" in normalized_output
+ assert "deprecated" in normalized_output
+ assert "0.10.0" in normalized_output
+ assert "specify extension" in normalized_output
+ assert "will be removed" in normalized_output
+ assert "git extension will no longer be enabled by default" in normalized_output
+
def test_git_extension_commands_registered(self, tmp_path):
"""Git extension commands are registered with the agent during init."""
from typer.testing import CliRunner