refactor(workflow): [2f488f42] Deaktiviere post-commit hook und mache git push interaktiv

This commit is contained in:
2026-01-27 10:36:37 +00:00
parent 6b4901f981
commit acf64fcfe8
2 changed files with 5 additions and 114 deletions

View File

@@ -701,7 +701,10 @@ def report_status_to_notion(
subprocess.run(["git", "commit", "-m", commit_message], check=True)
print("✅ Git commit erfolgreich.")
git_push_with_retry()
# Interaktive Abfrage für git push
push_choice = input("\n✅ Commit erfolgreich erstellt. Sollen die Änderungen jetzt gepusht werden? (j/n): ").lower()
if push_choice == 'j':
git_push_with_retry()
except subprocess.CalledProcessError as e:
print(f"❌ FEHLER bei Git-Operationen: {e}")
@@ -763,26 +766,7 @@ def save_session_info(task_id: str, token: str):
def install_git_hook():
"""Installiert das notion_commit_hook.py Skript als post-commit Git-Hook."""
git_hooks_dir = os.path.join(".git", "hooks")
post_commit_hook_path = os.path.join(git_hooks_dir, "post-commit")
source_hook_script = "notion_commit_hook.py"
if not os.path.exists(git_hooks_dir):
# Wahrscheinlich kein Git-Repository, also nichts tun
return
if not os.path.exists(source_hook_script):
print(f"Warnung: Hook-Skript {source_hook_script} nicht gefunden. Hook wird nicht installiert.")
return
try:
# Kopiere das Skript und mache es ausführbar
shutil.copy(source_hook_script, post_commit_hook_path)
os.chmod(post_commit_hook_path, 0o755)
print("✅ Git-Hook für Notion-Kommentare erfolgreich installiert.")
except (IOError, OSError) as e:
print(f"❌ FEHLER beim Installieren des Git-Hooks: {e}")
pass
def cleanup_session():
"""Bereinigt die Session-Datei und den Git-Hook."""