mr = "!f() { \
      # usage: git mr \"message du commit\" [titre MR] [labels] \
      MSG=\"$1\"; TITLE=\"${2:-$(git log -1 --pretty=%s 2>/dev/null || echo \"MR\")}\"; LABELS=\"$3\"; \
      BR=$(git rev-parse --abbrev-ref HEAD); \
      if [ \"$BR\" = \"HEAD\" ]; then echo \"❌ Branche détachée\"; exit 1; fi; \
      if [ -z \"$MSG\" ]; then echo \"❌ Message de commit manquant\"; echo \"   usage: git mr \\\"feat: xxx\\\" [Titre MR] [labels]\"; exit 1; fi; \
      if [ \"$BR\" = \"main\" ]; then echo \"⚠️ Tu es sur 'main' : refuse de pousser directement.\"; exit 1; fi; \
      git add -A && git commit -m \"$MSG\" || true; \
      git push -u origin \"$BR\" || exit 1; \
      echo \"🟢 Branche poussée: $BR\"; \
      # crée la MR vers main
      if [ -n \"$LABELS\" ]; then \
        glab mr create --source \"$BR\" --target main --title \"$TITLE\" --labels \"$LABELS\" --assignee @me --fill --yes; \
      else \
        glab mr create --source \"$BR\" --target main --title \"$TITLE\" --assignee @me --fill --yes; \
      fi; \
      # ouvre la MR dans le navigateur
      glab mr view --web; \
    }; f"
    
