From 5a023806b93ce24e998dadd95df357164746247f Mon Sep 17 00:00:00 2001 From: gilles soulier Date: Mon, 19 Jan 2026 20:52:08 +0100 Subject: [PATCH] Actualiser gitea_push/scripts/smart_commit.sh --- gitea_push/scripts/smart_commit.sh | 43 ++++++++++++------------------ 1 file changed, 17 insertions(+), 26 deletions(-) diff --git a/gitea_push/scripts/smart_commit.sh b/gitea_push/scripts/smart_commit.sh index 389740c..8b2701f 100644 --- a/gitea_push/scripts/smart_commit.sh +++ b/gitea_push/scripts/smart_commit.sh @@ -1,28 +1,21 @@ #!/usr/bin/env bash -SCOPE="plugin" -elif echo "$CHANGED_FILES" | grep -q "skill"; then -SCOPE="skill" -elif echo "$CHANGED_FILES" | grep -q "agent"; then -SCOPE="agent" -else -FIRST_FILE=$(echo "$CHANGED_FILES" | head -n 1) -if [[ "$FIRST_FILE" == */* ]]; then -SCOPE="${FIRST_FILE%%/*}" -fi fi -# Determine description -DESC="" +# Description (FR) if [[ "$TYPE" == "docs" ]]; then -DESC="update documentation" +DESC="mise à jour de la documentation" elif [[ "$TYPE" == "test" ]]; then -DESC="update tests" +DESC="mise à jour des tests" elif [[ "$TYPE" == "chore" ]]; then -DESC="update dependencies" +DESC="mise à jour des dépendances" +elif [[ "$TYPE" == "fix" ]]; then +DESC="correction" +elif [[ "$TYPE" == "refactor" ]]; then +DESC="refactorisation" else FILE_COUNT=$(echo "$CHANGED_FILES" | wc -l | tr -d ' ') -DESC="update ${FILE_COUNT} file(s)" +DESC="mise à jour de ${FILE_COUNT} fichier(s)" fi @@ -34,20 +27,20 @@ fi fi -info "Commit message: $COMMIT_MSG" +info "Message de commit : $COMMIT_MSG" # ----------------------------- # Commit # ----------------------------- -info "Creating commit..." -git commit -m "$COMMIT_MSG" -m "Generated with Claude Code" -m "Co-Authored-By: Claude " +info "Création du commit…" +git commit -m "$COMMIT_MSG" -m "Généré avec Claude Code" -m "Co-Authored-By: Claude " # ----------------------------- # Push # ----------------------------- -info "Pushing to remote '$REMOTE_NAME'..." +info "Push vers '$REMOTE_NAME'…" if git ls-remote --exit-code --heads "$REMOTE_NAME" "$BRANCH" >/dev/null 2>&1; then @@ -57,15 +50,14 @@ git push -u "$REMOTE_NAME" "$BRANCH" fi -info "Push complete" +info "Push terminé" echo "$DIFF_STAT" # ----------------------------- -# Gitea PR link (best-effort) +# Lien PR Gitea (best-effort) # ----------------------------- -# For Gitea, creating a PR is usually: -# https://host/owner/repo/compare/?expand=1 +# Format courant : https://host/owner/repo/compare/?expand=1 REMOTE_URL=$(git remote get-url "$REMOTE_NAME" 2>/dev/null || true) @@ -94,8 +86,7 @@ PATH_REPO="${HP#*|}" PATH_REPO="${PATH_REPO%.git}" -# If configured host matches (or no configured host) if [[ -z "${GITEA_HOST:-}" || "$HOST" == "$GITEA_HOST" ]]; then -warn "Create PR: https://${HOST}/${PATH_REPO}/compare/${BRANCH}?expand=1" +warn "Créer une PR : https://${HOST}/${PATH_REPO}/compare/${BRANCH}?expand=1" fi fi \ No newline at end of file