refactor: post-commit Git-Block entfernt
- git-templates/hooks/post-commit: no-op (kein automatischer Git-Block mehr) - Session-Datei: appended Git-Block entfernt, nur Agent-Inhalt bleibt - Auto-Stub 2026-06-03_master_ca7f52b.md geloescht - copilot-instructions.md (beide): Suffix-Erklaerung auf Check 6 umgeschrieben - prompts/history.prompt.md: post-commit Referenz entfernt - docs/MAINTAINER.md: post-commit Zeile aus Dateistruktur entfernt - README.md: post-commit Zeile aus Struktur + Tabelle entfernt - scripts/copilot-update.fish: post-commit nicht mehr kopiert - scripts/deploy.sh: post-commit nicht mehr installiert
This commit is contained in:
parent
2d318f3654
commit
d9508f7bf1
11 changed files with 16 additions and 139 deletions
4
.github/copilot-instructions.md
vendored
4
.github/copilot-instructions.md
vendored
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
**Session END** – Führe `/history` im Copilot Chat aus um die Session abzuschließen:
|
||||
1. Lies die bestehende `history/prompts/YYYY-MM-DD_*_session.md` (falls vorhanden) und ergänze nur den neuen Teil
|
||||
**Dateiformat zwingend:** Suffix `_session.md` — der post-commit Hook erkennt daran das Agent-Log
|
||||
**Dateiformat zwingend:** Suffix `_session.md`
|
||||
2. Aktualisiere `history/summary/PROJECT_CONTEXT.md` mit dem neuen Projektstand
|
||||
3. **Stage beide Dateien VOR `git commit`:** `git add history/`
|
||||
Der pre-commit Hook (Check 6) blockiert wenn keine `*_session.md` gestaged ist.
|
||||
|
|
@ -62,7 +62,7 @@
|
|||
- Copilot Chat: `/check-consistency` → Konsistenz zwischen Code, Docs und Requirements prüfen
|
||||
|
||||
### Agent History (`/history/`)
|
||||
- **Vollständige Konversationen** → `history/prompts/YYYY-MM-DD_beschreibung_session.md` (**Suffix `_session.md` zwingend** – post-commit Hook erkennt daran das Agent-Log)
|
||||
- **Vollständige Konversationen** → `history/prompts/YYYY-MM-DD_beschreibung_session.md` (**Suffix `_session.md` zwingend** – Check 6 im pre-commit Hook erkennt daran das Agent-Log)
|
||||
- **Komprimierter Kontext** → `history/summary/PROJECT_CONTEXT.md` (**committed, immer aktuell halten!**)
|
||||
- **Beim Start einer neuen Session:** `history/summary/PROJECT_CONTEXT.md` zuerst lesen
|
||||
- **Am Ende jeder Session:** beide Dateien committen
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ git copilot-update
|
|||
Was das macht:
|
||||
1. **Setup-Repo pullen** – `~/.copilot-setup/` (SSH, HTTP-Fallback zu `http://192.168.178.6:8083/cschulz/rd13_copilot_setup`)
|
||||
2. **Globale Templates updaten** – `~/.git-templates/` + VS Code Prompt-Dateien
|
||||
3. **Repo-lokale Hooks updaten** – `.git/hooks/pre-commit` + `post-commit`
|
||||
3. **Repo-lokale Hooks updaten** – `.git/hooks/pre-commit`
|
||||
4. **`copilot-instructions.md`** – nur überschreiben wenn noch TODO-Platzhalter enthalten (Backup `.bak` wird angelegt)
|
||||
|
||||
> **Empfehlung:** In jedem Repo nach einem `git pull` auf dem Setup-Repo ausführen,
|
||||
|
|
@ -107,7 +107,6 @@ rd13_copilot_setup/
|
|||
│ │ └── extensions.json
|
||||
│ ├── hooks/
|
||||
│ │ ├── pre-commit ← Agent Quality Gate (Tests + Doku-Check)
|
||||
│ │ ├── post-commit ← Automatischer History-Log nach jedem Commit
|
||||
│ │ └── post-merge ← Opt-in: copilot-update nach git pull
|
||||
│ ├── docs/
|
||||
│ │ ├── USER.md ← Template: Endnutzer-Dokumentation
|
||||
|
|
@ -167,7 +166,6 @@ Nach `git init` (via Alias) oder `copilot-bootstrap.sh`:
|
|||
| Copilot-Anweisungen + Konventionen | `.github/copilot-instructions.md` |
|
||||
| VS Code-Einstellungen | `.vscode/` |
|
||||
| **pre-commit Quality Gate** | `.git/hooks/pre-commit` |
|
||||
| **post-commit History-Log** | `.git/hooks/post-commit` |
|
||||
| **Persistente Daten (gitignored)** | `data/` |
|
||||
| **Agent-Konversationen (committed)** | `history/prompts/` |
|
||||
| **Agent-Kontext-Summary (committed)** | `history/summary/PROJECT_CONTEXT.md` |
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ rd13_copilot_setup/
|
|||
│ │ └── extensions.json ← Empfohlene Extensions für neue Repos
|
||||
│ ├── hooks/
|
||||
│ │ ├── pre-commit ← Agent Quality Gate (6 Checks)
|
||||
│ │ ├── post-commit ← Hängt Git-Block an *_session.md an
|
||||
│ │ └── post-merge ← Opt-in: copilot-update.sh nach git pull
|
||||
│ ├── docs/
|
||||
│ │ ├── USER.md ← Template Endnutzer-Doku
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
**Session END** – Führe `/history` im Copilot Chat aus um die Session abzuschließen:
|
||||
1. Lies die bestehende `history/prompts/YYYY-MM-DD_*_session.md` (falls vorhanden) und ergänze nur den neuen Teil
|
||||
**Dateiformat zwingend:** Suffix `_session.md` — der post-commit Hook erkennt daran das Agent-Log
|
||||
**Dateiformat zwingend:** Suffix `_session.md`
|
||||
2. Aktualisiere `history/summary/PROJECT_CONTEXT.md` mit dem neuen Projektstand
|
||||
3. **Stage beide Dateien VOR `git commit`:** `git add history/`
|
||||
Der pre-commit Hook (Check 6) blockiert wenn keine `*_session.md` gestaged ist.
|
||||
|
|
@ -62,7 +62,7 @@
|
|||
- Copilot Chat: `/check-consistency` → Konsistenz zwischen Code, Docs und Requirements prüfen
|
||||
|
||||
### Agent History (`/history/`)
|
||||
- **Vollständige Konversationen** → `history/prompts/YYYY-MM-DD_beschreibung_session.md` (**Suffix `_session.md` zwingend** – post-commit Hook erkennt daran das Agent-Log)
|
||||
- **Vollständige Konversationen** → `history/prompts/YYYY-MM-DD_beschreibung_session.md` (**Suffix `_session.md` zwingend** – Check 6 im pre-commit Hook erkennt daran das Agent-Log)
|
||||
- **Komprimierter Kontext** → `history/summary/PROJECT_CONTEXT.md` (**committed, immer aktuell halten!**)
|
||||
- **Beim Start einer neuen Session:** `history/summary/PROJECT_CONTEXT.md` zuerst lesen
|
||||
- **Am Ende jeder Session:** beide Dateien committen
|
||||
|
|
|
|||
88
git-templates/hooks/post-commit
Normal file → Executable file
88
git-templates/hooks/post-commit
Normal file → Executable file
|
|
@ -1,87 +1,3 @@
|
|||
#!/usr/bin/env sh
|
||||
# post-commit – Automatischer History-Log
|
||||
#
|
||||
# Läuft nach jedem erfolgreichen Commit.
|
||||
# Zwei Modi:
|
||||
#
|
||||
# A) Session-Datei gefunden (Agent hat /history ausgeführt):
|
||||
# → Git-Block wird an die bestehende Konversations-Datei ANGEHÄNGT.
|
||||
# Session-Dateien werden vom Agent mit dem Suffix "_session.md" erstellt.
|
||||
#
|
||||
# B) Keine Session-Datei für heute:
|
||||
# → Neuer Git-Stub (nur Metadaten, kein KI-Inhalt).
|
||||
#
|
||||
# Die Datei wird NICHT automatisch committed (kein Rekursionsrisiko).
|
||||
# Sie wird beim nächsten regulären Commit mit erfasst (history/ ist tracked).
|
||||
|
||||
HASH=$(git rev-parse --short HEAD 2>/dev/null)
|
||||
FULL_HASH=$(git rev-parse HEAD 2>/dev/null)
|
||||
BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
|
||||
DATE=$(date '+%Y-%m-%d')
|
||||
DATETIME=$(date '+%Y-%m-%d %H:%M:%S')
|
||||
MSG=$(git log -1 --format='%s' 2>/dev/null)
|
||||
AUTHOR=$(git log -1 --format='%an <%ae>' 2>/dev/null)
|
||||
|
||||
# Nur ausführen wenn history/prompts/ existiert
|
||||
if [ ! -d "history/prompts" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Geänderte Dateien dieses Commits
|
||||
CHANGED_FILES=$(git diff-tree --no-commit-id -r --name-status "$FULL_HASH" 2>/dev/null \
|
||||
| awk '{printf "| %-1s | %s |\n", $1, $2}')
|
||||
|
||||
GIT_BLOCK=$(cat << EOF
|
||||
|
||||
---
|
||||
|
||||
## Git Commit
|
||||
|
||||
| Feld | Wert |
|
||||
|---|---|
|
||||
| Datum | $DATETIME |
|
||||
| Branch | \`$BRANCH\` |
|
||||
| Commit | \`$FULL_HASH\` |
|
||||
| Autor | $AUTHOR |
|
||||
|
||||
### Commit Message
|
||||
|
||||
\`\`\`
|
||||
$MSG
|
||||
\`\`\`
|
||||
|
||||
### Geänderte Dateien
|
||||
|
||||
| Status | Datei |
|
||||
|---|---|
|
||||
$CHANGED_FILES
|
||||
|
||||
---
|
||||
*Git-Block automatisch generiert durch post-commit hook.*
|
||||
EOF
|
||||
)
|
||||
|
||||
# Modus A: Session-Datei vom Agent für heute suchen (Suffix: _session.md)
|
||||
SESSION_FILE=$(ls "history/prompts/${DATE}_"*"_session.md" 2>/dev/null | tail -1)
|
||||
|
||||
if [ -n "$SESSION_FILE" ]; then
|
||||
printf '%s\n' "$GIT_BLOCK" >> "$SESSION_FILE"
|
||||
echo ""
|
||||
echo " ✓ history: Git-Block angehängt an $(basename "$SESSION_FILE")"
|
||||
echo " → Konversation + Commit in einer Datei"
|
||||
else
|
||||
# Modus B: Kein Agent-Log – reinen Git-Stub anlegen
|
||||
BRANCH_CLEAN=$(printf '%s' "$BRANCH" | tr '/' '-' | tr ' ' '-')
|
||||
OUTFILE="history/prompts/${DATE}_${BRANCH_CLEAN}_${HASH}.md"
|
||||
cat > "$OUTFILE" << STUB
|
||||
# Auto-Log: $MSG
|
||||
$GIT_BLOCK
|
||||
|
||||
*Kein Agent-Log vorhanden. Für vollständige Konversation: Copilot Chat → \`/history\` vor dem Commit ausführen.*
|
||||
STUB
|
||||
echo ""
|
||||
echo " ✓ history: $(basename "$OUTFILE") geschrieben (nur Git-Metadaten)"
|
||||
echo " → Tipp: '/history' vor dem Commit für vollständige Konversation"
|
||||
fi
|
||||
|
||||
echo " → wird beim nächsten Commit automatisch erfasst"
|
||||
# post-commit – reserviert fuer zukuenftige Nutzung
|
||||
exit 0
|
||||
|
|
|
|||
|
|
@ -1,33 +0,0 @@
|
|||
# Auto-Log: fix: pre-commit Check 6 – Session-Datei muss in Commit gestaged sein
|
||||
|
||||
---
|
||||
|
||||
## Git Commit
|
||||
|
||||
| Feld | Wert |
|
||||
|---|---|
|
||||
| Datum | 2026-06-03 05:55:36 |
|
||||
| Branch | `master` |
|
||||
| Commit | `ca7f52b0baca026837687469193cd3d322a1f782` |
|
||||
| Autor | Conrad Schulz <conradschulz@me.com> |
|
||||
|
||||
### Commit Message
|
||||
|
||||
```
|
||||
fix: pre-commit Check 6 – Session-Datei muss in Commit gestaged sein
|
||||
```
|
||||
|
||||
### Geänderte Dateien
|
||||
|
||||
| Status | Datei |
|
||||
|---|---|
|
||||
| A | .copilot-no-session |
|
||||
| M | git-templates/hooks/pre-commit |
|
||||
| M | history/prompts/2026-06-02_review-fixes-requirements-engineering_session.md |
|
||||
| M | history/summary/PROJECT_CONTEXT.md |
|
||||
| M | prompts/history.prompt.md |
|
||||
|
||||
---
|
||||
*Git-Block automatisch generiert durch post-commit hook.*
|
||||
|
||||
*Kein Agent-Log vorhanden. Für vollständige Konversation: Copilot Chat → `/history` vor dem Commit ausführen.*
|
||||
|
|
@ -100,3 +100,6 @@ Neue Session-Datei für heute angelegt: `2026-06-03_pre-commit-check6-session-pf
|
|||
## Offene Punkte
|
||||
|
||||
- [ ] `git copilot-update` ausführen um neuen Hook + history.prompt.md in andere Repos zu distribuieren
|
||||
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
## Aktueller Projektstatus
|
||||
|
||||
**Letzte Aktualisierung:** 2026-06-03 – .copilot-no-session/no-docs entfernt, alle 3 Docs aktualisiert
|
||||
**Letzte Aktualisierung:** 2026-06-03 – post-commit Git-Block entfernt (no-op Hook)
|
||||
**Phase:** Produktion / stabil – wird bei Bedarf erweitert
|
||||
|
||||
---
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ Suche nach einer Datei `history/prompts/YYYY-MM-DD_*_session.md` für das heutig
|
|||
|
||||
**Dateiname:** `YYYY-MM-DD_kurzbeschreibung_session.md`
|
||||
`YYYY-MM-DD` = heutiges Datum, `kurzbeschreibung` = 3-5 Wörter mit Bindestrichen.
|
||||
**Das Suffix `_session.md` ist zwingend** — der post-commit Hook erkennt daran das Agent-Log.
|
||||
**Das Suffix `_session.md` ist zwingend** — Check 6 im pre-commit Hook erkennt daran das Agent-Log.
|
||||
|
||||
Beispiel: `2026-06-03_tile-server-martin-setup_session.md`
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
# Zieht die neueste Version des Copilot-Setup-Repos und aktualisiert:
|
||||
# - Globale Git-Templates (~/.git-templates/)
|
||||
# - VS Code Prompt-Dateien
|
||||
# - Git-Hooks im aktuellen Repo (pre-commit, post-commit)
|
||||
# - Git-Hooks im aktuellen Repo (pre-commit)
|
||||
# - .github/copilot-instructions.md (nur wenn noch TODO-Platzhalter enthalten)
|
||||
#
|
||||
# Usage:
|
||||
|
|
@ -62,8 +62,7 @@ cp $SOURCE/git-templates/.github/copilot-instructions.md $GIT_TEMPLATE_DIR/.gith
|
|||
cp $SOURCE/git-templates/.vscode/settings.json $GIT_TEMPLATE_DIR/.vscode/
|
||||
cp $SOURCE/git-templates/.vscode/extensions.json $GIT_TEMPLATE_DIR/.vscode/
|
||||
cp $SOURCE/git-templates/hooks/pre-commit $GIT_TEMPLATE_DIR/hooks/
|
||||
cp $SOURCE/git-templates/hooks/post-commit $GIT_TEMPLATE_DIR/hooks/
|
||||
chmod +x $GIT_TEMPLATE_DIR/hooks/pre-commit $GIT_TEMPLATE_DIR/hooks/post-commit
|
||||
chmod +x $GIT_TEMPLATE_DIR/hooks/pre-commit
|
||||
if test -f $SOURCE/git-templates/hooks/post-merge
|
||||
cp $SOURCE/git-templates/hooks/post-merge $GIT_TEMPLATE_DIR/hooks/
|
||||
chmod +x $GIT_TEMPLATE_DIR/hooks/post-merge
|
||||
|
|
@ -116,7 +115,7 @@ set HOOKS_DIR $REPO_ROOT/.git/hooks
|
|||
mkdir -p $HOOKS_DIR
|
||||
set HOOKS_UPDATED 0
|
||||
|
||||
for hook in pre-commit post-commit
|
||||
for hook in pre-commit
|
||||
if test -f $SOURCE/git-templates/hooks/$hook
|
||||
cp $SOURCE/git-templates/hooks/$hook $HOOKS_DIR/$hook
|
||||
chmod +x $HOOKS_DIR/$hook
|
||||
|
|
|
|||
|
|
@ -88,10 +88,9 @@ echo " ✓ git alias 'init' gesetzt (führt copilot-bootstrap.sh automatisch au
|
|||
git config --global alias.copilot-update '!~/.local/bin/copilot-update.sh'
|
||||
echo " ✓ git alias 'copilot-update' gesetzt (aktualisiert Templates & Prompts)"
|
||||
|
||||
# ── 7. post-merge + post-commit Hook für dieses Setup-Repo ───────────────────
|
||||
# ── 7. post-merge Hook für dieses Setup-Repo ─────────────────────────────────
|
||||
# Nach jedem 'git pull' auf dem Setup-Repo selbst wird deploy.sh automatisch
|
||||
# ausgeführt, sodass Templates immer auf dem neuesten Stand sind.
|
||||
# post-commit generiert die History-Logs nach jedem Commit.
|
||||
SELF_HOOKS_DIR="$REPO_DIR/.git/hooks"
|
||||
if [[ -d "$SELF_HOOKS_DIR" ]]; then
|
||||
cat > "$SELF_HOOKS_DIR/post-merge" << 'HOOK'
|
||||
|
|
@ -104,10 +103,6 @@ bash "$SCRIPT_DIR/deploy.sh"
|
|||
HOOK
|
||||
chmod +x "$SELF_HOOKS_DIR/post-merge"
|
||||
echo " ✓ post-merge Hook im Setup-Repo installiert (auto-deploy nach git pull)"
|
||||
# post-commit aus git-templates kopieren (History-Logs)
|
||||
cp "$REPO_DIR/git-templates/hooks/post-commit" "$SELF_HOOKS_DIR/post-commit"
|
||||
chmod +x "$SELF_HOOKS_DIR/post-commit"
|
||||
echo " ✓ post-commit Hook im Setup-Repo installiert (History-Logs)"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue