From c0bdafd864f751826da9c04514974039bcff015f Mon Sep 17 00:00:00 2001 From: Jephte Clain Date: Fri, 20 Feb 2015 23:00:29 +0400 Subject: [PATCH] =?UTF-8?q?autos=C3=A9lection=20de=20la=20feature=20branch?= =?UTF-8?q?,=20ou=20choix=20dans=20un=20menu=20pour=20merge?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pdev | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/pdev b/pdev index afbc1f4..40b779f 100755 --- a/pdev +++ b/pdev @@ -96,11 +96,28 @@ Vous allez créer la nouvelle feature branch ${COULEUR_VERTE}$feature${COULEUR_N fi feature="$1" -[ -n "$feature" ] || feature="$branch" -is_feature_branch "$feature" || exit 0 -git_is_branch "$feature" || die "$feature: branche invalide" +if [ -n "$feature" ]; then + is_feature_branch "$feature" || die "$feature: ce n'est pas une feature branch" + git_have_branch "$feature" || die "$feature: branche invalide" +elif is_feature_branch "$branch"; then + feature="$branch" +fi if [ "$action" == merge ]; then + if [ -z "$feature" ]; then + setx -a branches=list_feature_branches + if [ ${#branches[*]} -eq 0 ]; then + die "Aucune feature branch n'a été trouvée" + elif [ ${#branches[*]} -eq 1 ]; then + feature="${branches[0]}" + estepn "Autosélection de $feature" + else + simple_menu feature branches -d "$branch" \ + -t "Choix de la feature branch" \ + -m "Veuillez choisir la branche" + fi + fi + estepn "\ Intégration de la feature branch ${COULEUR_VERTE}$feature${COULEUR_NORMALE} dans la branche de destination ${COULEUR_BLEUE}develop${COULEUR_NORMALE}" @@ -118,8 +135,10 @@ dans la branche de destination ${COULEUR_BLEUE}develop${COULEUR_NORMALE}" fi elif [ "$action" == log ]; then - git log develop.."$branch" + [ -z "$feature" ] && exit 0 + git log develop.."$feature" elif [ "$action" == diff ]; then - git diff develop..."$branch" + [ -z "$feature" ] && exit 0 + git diff develop..."$feature" fi