diff --git a/scripts/run-entire-copilot-migration-with-optional-rewind-resume.sh b/scripts/run-entire-copilot-migration-with-optional-rewind-resume.sh index 955d491..e26e84b 100755 --- a/scripts/run-entire-copilot-migration-with-optional-rewind-resume.sh +++ b/scripts/run-entire-copilot-migration-with-optional-rewind-resume.sh @@ -14,17 +14,23 @@ need_cmd entire need_cmd copilot need_cmd git -if [ ! -d "$PROJECT_DIR" ]; then - echo "ERROR: project directory '$PROJECT_DIR' not found." >&2 +if ! git rev-parse --show-toplevel >/dev/null 2>&1; then + echo "ERROR: Dieses Skript muss innerhalb eines bestehenden Git-Repositories gestartet werden." >&2 + echo "Bitte zuerst im Repo-Root 'git init' oder in einem bestehenden Repo arbeiten." >&2 exit 1 fi -cd "$PROJECT_DIR" +REPO_ROOT="$(git rev-parse --show-toplevel)" +cd "$REPO_ROOT" -if [ ! -d .git ]; then - git init +if [ ! -d "$PROJECT_DIR" ]; then + echo "ERROR: project directory '$PROJECT_DIR' not found relative to repo root '$REPO_ROOT'." >&2 + exit 1 fi +echo "Repo root: $REPO_ROOT" +echo "Legacy project: $PROJECT_DIR" + entire agent add copilot-cli entire status @@ -35,16 +41,18 @@ else git commit -m "baseline: Qt5/C++11 legacy benchmark before Qt6/C++23 migration" fi +echo +echo "== Checkpoints vor der Session ==" entire checkpoint list -cat <<'PROMPT' +cat <&2 +if ! git rev-parse --show-toplevel >/dev/null 2>&1; then + echo "ERROR: Dieses Skript muss innerhalb eines bestehenden Git-Repositories gestartet werden." >&2 + echo "Bitte zuerst im Repo-Root 'git init' oder in einem bestehenden Repo arbeiten." >&2 exit 1 fi -cd "$PROJECT_DIR" +REPO_ROOT="$(git rev-parse --show-toplevel)" +cd "$REPO_ROOT" -if [ ! -d .git ]; then - git init +if [ ! -d "$PROJECT_DIR" ]; then + echo "ERROR: project directory '$PROJECT_DIR' not found relative to repo root '$REPO_ROOT'." >&2 + exit 1 fi +echo "Repo root: $REPO_ROOT" +echo "Legacy project: $PROJECT_DIR" + entire agent add copilot-cli entire status @@ -35,16 +41,18 @@ else git commit -m "baseline: Qt5/C++11 legacy benchmark before Qt6/C++23 migration" fi +echo +echo "== Checkpoints vor der Session ==" entire checkpoint list -cat <<'PROMPT' +cat <