pour -m,-l,-d, possibilité de spécifier la branche concernée, qui vaut par défaut la branche courante
This commit is contained in:
parent
de7d12aba6
commit
2f173c2660
28
pdev
28
pdev
|
@ -7,7 +7,8 @@ function display_help() {
|
|||
uecho "$scriptname: basculer sur une branche de développement
|
||||
|
||||
USAGE
|
||||
$scriptname [options] [FEATURE [SOURCE]]
|
||||
$scriptname [FEATURE [SOURCE]]
|
||||
$scriptname -m|-l|-d [FEATURE]
|
||||
|
||||
- Vérifier l'existence de la branche develop. La créer si nécessaire en la
|
||||
basant sur [origin/]master.
|
||||
|
@ -85,31 +86,40 @@ if [ "$action" == branch ]; then
|
|||
Vous allez créer la nouvelle feature branch ${COULEUR_VERTE}$feature${COULEUR_NORMALE}
|
||||
à partir de la branche source ${COULEUR_BLEUE}$source${COULEUR_NORMALE}"
|
||||
ask_yesno "Voulez-vous continuer?" O || die
|
||||
|
||||
git_ensure_branch "$feature" "$source" "$origin"
|
||||
[ $? -eq 2 ] && die "Impossible de créer la branche $feature. Veuillez vérifier que la branche $source existe"
|
||||
git checkout "$feature"
|
||||
fi
|
||||
|
||||
elif [ "$action" == merge ]; then
|
||||
is_feature_branch || exit 0
|
||||
exit $?
|
||||
fi
|
||||
|
||||
feature="$1"
|
||||
[ -n "$feature" ] || feature="$branch"
|
||||
is_feature_branch "$feature" || exit 0
|
||||
git_is_branch "$feature" || die "$feature: branche invalide"
|
||||
|
||||
if [ "$action" == merge ]; then
|
||||
estepn "\
|
||||
Intégration de la feature branch ${COULEUR_VERTE}$feature${COULEUR_NORMALE}
|
||||
dans la branche de destination ${COULEUR_BLEUE}develop${COULEUR_NORMALE}"
|
||||
ask_yesno "Voulez-vous continuer?" O || die
|
||||
|
||||
estepn "Intégration de la feature branch ${COULEUR_VERTE}$branch${COULEUR_NORMALE} dans ${COULEUR_BLEUE}develop${COULEUR_NORMALE}"
|
||||
git checkout develop
|
||||
git merge "$branch" -m "Intégration de la feature branch $branch" --no-ff || die
|
||||
git merge "$feature" -m "Intégration de la feature branch $feature" --no-ff || die
|
||||
|
||||
estepi "Suppression de la branche locale"
|
||||
git branch -d "$branch"
|
||||
git branch -d "$feature"
|
||||
|
||||
if git_have_remote origin; then
|
||||
estepi "Suppression de la branche distante"
|
||||
git push origin ":$branch"
|
||||
git push origin ":$feature"
|
||||
fi
|
||||
|
||||
elif [ "$action" == log ]; then
|
||||
is_feature_branch || exit 0
|
||||
git log develop.."$branch"
|
||||
|
||||
elif [ "$action" == diff ]; then
|
||||
is_feature_branch || exit 0
|
||||
git diff develop..."$branch"
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue