pman: améliorer l'ergonomie
This commit is contained in:
		
							parent
							
								
									0cfad79ec0
								
							
						
					
					
						commit
						9a2378ba74
					
				| @ -224,13 +224,15 @@ function load_config() { | |||||||
|     if [ -n "$ConfigFile" ]; then |     if [ -n "$ConfigFile" ]; then | ||||||
|         source "$ConfigFile" || die || return |         source "$ConfigFile" || die || return | ||||||
|     elif [ -n "$ConfigBranch" ]; then |     elif [ -n "$ConfigBranch" ]; then | ||||||
|  |         # c'est le seul cas où ConfigFile reste vide | ||||||
|         if ! array_contains LocalBranches "$ConfigBranch"; then |         if ! array_contains LocalBranches "$ConfigBranch"; then | ||||||
|             die "$ConfigBranch: branche de configuration introuvable" || return |             die "$ConfigBranch: branche de configuration introuvable" || return | ||||||
|         else |         else | ||||||
|             ac_set_tmpfile ConfigFile |             local config | ||||||
|             git show "$ConfigBranch:.pman.conf" >"$ConfigFile" 2>/dev/null |             ac_set_tmpfile config | ||||||
|             [ -s "$ConfigFile" ] || die "$ConfigBranch: aucune configuration trouvée sur cette branche" || return |             git show "$ConfigBranch:.pman.conf" >"$config" 2>/dev/null | ||||||
|             source "$ConfigFile" |             [ -s "$config" ] || die "$ConfigBranch: aucune configuration trouvée sur cette branche" || return | ||||||
|  |             source "$config" | ||||||
|         fi |         fi | ||||||
|     elif [ -f .pman.conf ]; then |     elif [ -f .pman.conf ]; then | ||||||
|         ConfigFile="$(pwd)/.pman.conf" |         ConfigFile="$(pwd)/.pman.conf" | ||||||
|  | |||||||
							
								
								
									
										44
									
								
								bin/pdev
									
									
									
									
									
								
							
							
						
						
									
										44
									
								
								bin/pdev
									
									
									
									
									
								
							| @ -25,6 +25,9 @@ function ensure_branches() { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function merge_action() { | function merge_action() { | ||||||
|  |     [ -z "$ShouldPush" ] && enote "\ | ||||||
|  | L'option --no-push a été forcée puisque ce dépôt n'a pas d'origine" | ||||||
|  | 
 | ||||||
|     enote "\ |     enote "\ | ||||||
| Ce script va | Ce script va | ||||||
| - fusionner la branche ${COULEUR_BLEUE}$SrcBranch${COULEUR_NORMALE} dans ${COULEUR_ROUGE}$DestBranch${COULEUR_NORMALE}${Push:+ | - fusionner la branche ${COULEUR_BLEUE}$SrcBranch${COULEUR_NORMALE} dans ${COULEUR_ROUGE}$DestBranch${COULEUR_NORMALE}${Push:+ | ||||||
| @ -54,7 +57,7 @@ EOF | |||||||
| fi | fi | ||||||
| EOF | EOF | ||||||
| 
 | 
 | ||||||
|     if [ -z "$ForbidDelete" ]; then |     if [ -n "$ShouldDelete" ]; then | ||||||
|         _scripta <<EOF |         _scripta <<EOF | ||||||
| ################################################################################ | ################################################################################ | ||||||
| # delete | # delete | ||||||
| @ -94,26 +97,25 @@ EOF | |||||||
| fi | fi | ||||||
| EOF | EOF | ||||||
| 
 | 
 | ||||||
|     [ -n "$Delete" -o "$ForbidDelete" ] && Deleted=1 || Deleted= |     [ -n "$ShouldDelete" -a -n "$Delete" ] && ShouldDelete= | ||||||
|     [ -n "$Push" -o "$CantPush" ] && Pushed=1 || Pushed= |     [ -n "$ShouldPush" -a -n "$Push" ] && ShouldPush= | ||||||
|     if [ -n "$_NoRunScript" ]; then |     if [ -n "$_NoRunScript" ]; then | ||||||
|         einfo "Veuillez consulter le script $script pour le détail des opérations à effectuer" |         einfo "Veuillez consulter le script $script pour le détail des opérations à effectuer" | ||||||
|     elif ! "$script" merge ${Delete:+delete} ${Push:+push}; then |     elif ! "$script" merge ${Delete:+delete} ${Push:+push}; then | ||||||
|         eimportant "\ |         eimportant "\ | ||||||
| Le script $script a été lancé avec les arguments 'merge${Delete:+ delete}${Push:+ push}' | Le script $script a été lancé avec les arguments 'merge${Delete:+ delete}${Push:+ push}' | ||||||
| Veuillez le consulter pour le détail des opérations qui n'ont pas pu êtres effectuées" | En cas d'erreur de merge, veuillez corriger les erreurs puis continuer avec | ||||||
|  |     git merge --continue | ||||||
|  | Sinon, veuillez consulter le script et/ou le relancer | ||||||
|  |     ./$script${Delete:+ delete}${Push:+ push}" | ||||||
|         die |         die | ||||||
|     elif [ -n "$Deleted" -a -n "$Pushed" ]; then |     elif [ -n "$Delete" -a -n "$Push" ]; then | ||||||
|         [ -n "$_KeepScript" ] || rm "$script" |         [ -n "$_KeepScript" ] || rm "$script" | ||||||
|     else |     else | ||||||
|         local cmd |  | ||||||
|         [ -n "$Deleted" ] || cmd="$cmd |  | ||||||
|     ./$script delete" |  | ||||||
|         [ -n "$Pushed" ] || cmd="$cmd |  | ||||||
|     ./$script push" |  | ||||||
|         einfo "\ |         einfo "\ | ||||||
| Le script $script a été lancé avec les arguments 'merge${Delete:+ delete}${Push:+ push}' | Le script $script a été lancé avec les arguments 'merge${Delete:+ delete}${Push:+ push}' | ||||||
| Veuillez le consulter pour le détail des autres opérations à effectuer$cmd" | Vous pouvez consulter le script et/ou le relancer | ||||||
|  |     ./$script${ShouldDelete:+ delete}${ShouldPush:+ push}" | ||||||
|     fi |     fi | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| @ -184,13 +186,12 @@ load_branches all | |||||||
| load_config "$MYNAME" | load_config "$MYNAME" | ||||||
| load_branches current "$1" | load_branches current "$1" | ||||||
| 
 | 
 | ||||||
| CantPush= | ShouldPush=1 | ||||||
| [ -n "$Origin" ] || Origin=origin | [ -n "$Origin" ] || Origin=origin | ||||||
| if ! git_have_remote "$Origin" && [ -n "$Push" ]; then | if ! git_have_remote "$Origin" && [ -n "$Push" ]; then | ||||||
|     ewarn "L'option --no-push a été forcée puisque ce dépôt n'a pas d'origine" |     ShouldPush= | ||||||
|     CantPush=1 |  | ||||||
| fi | fi | ||||||
| [ -n "$CantPush" ] && Push= | [ -z "$ShouldPush" ] && Push= | ||||||
| 
 | 
 | ||||||
| # puis faire l'action que l'on nous demande | # puis faire l'action que l'on nous demande | ||||||
| case "$action" in | case "$action" in | ||||||
| @ -200,21 +201,26 @@ show) | |||||||
|     show_action "$@" |     show_action "$@" | ||||||
|     ;; |     ;; | ||||||
| merge) | merge) | ||||||
|     ForbidDelete= |     ShouldDelete=1 | ||||||
|     case "$SrcType" in |     case "$SrcType" in | ||||||
|     develop|release|hotfix) |     develop|release|hotfix) | ||||||
|         die "$SrcBranch: cette branche doit être fusionnée dans $DestBranch avec prel" |         die "$SrcBranch: cette branche doit être fusionnée dans $DestBranch avec prel" | ||||||
|         ;; |         ;; | ||||||
|     *) |     *) | ||||||
|         # n'autoriser la suppression que pour feature |         # n'autoriser la suppression que pour feature | ||||||
|         [ "$SrcType" == feature ] || ForbidDelete=1 |         [ "$SrcType" == feature ] || ShouldDelete= | ||||||
|         ;; |         ;; | ||||||
|     esac |     esac | ||||||
|     [ -n "$ForbidDelete" ] && Delete= |     [ -z "$ShouldDelete" ] && Delete= | ||||||
|     git_ensure_cleancheckout |     git_ensure_cleancheckout | ||||||
|     if ! array_contains LocalBranches "$SrcBranch"; then |     if ! array_contains LocalBranches "$SrcBranch"; then | ||||||
|         # si la branche source n'existe pas, la créer |         # si la branche source n'existe pas, la créer | ||||||
|         exec "$MYDIR/pman" "$FEATURE${SrcBranch#$FEATURE}" |         args=(--origin "$Origin") | ||||||
|  |         if [ -n "$ConfigFile" ]; then args+=(--config-file "$ConfigFile") | ||||||
|  |         elif [ -n "$ConfigBranch" ]; then args+=(--config-branch "$ConfigBranch") | ||||||
|  |         fi | ||||||
|  |         [ -z "$Push" ] && args+=(--no-push) | ||||||
|  |         exec "$MYDIR/pman" "${args[@]}" "$FEATURE${SrcBranch#$FEATURE}" | ||||||
|     else |     else | ||||||
|         ensure_branches |         ensure_branches | ||||||
|         merge_action "$@" |         merge_action "$@" | ||||||
|  | |||||||
							
								
								
									
										98
									
								
								bin/pman
									
									
									
									
									
								
							
							
						
						
									
										98
									
								
								bin/pman
									
									
									
									
									
								
							| @ -34,6 +34,16 @@ function show_action() { | |||||||
| # Initialisation | # Initialisation | ||||||
| ################################################################################ | ################################################################################ | ||||||
| 
 | 
 | ||||||
|  | function resolve_should_push() { | ||||||
|  |     ShouldPush=1 | ||||||
|  |     [ -n "$Origin" ] || Origin=origin | ||||||
|  |     if ! git_have_remote "$Origin" && [ -n "$Push" ]; then | ||||||
|  |         enote "L'option --no-push a été forcée puisque ce dépôt n'a pas d'origine" | ||||||
|  |         ShouldPush= | ||||||
|  |     fi | ||||||
|  |     [ -z "$ShouldPush" ] && Push= | ||||||
|  | } | ||||||
|  | 
 | ||||||
| function _init_config() { | function _init_config() { | ||||||
|     if [ ! -f .pman.conf -o -n "$ForceCreate" ]; then |     if [ ! -f .pman.conf -o -n "$ForceCreate" ]; then | ||||||
|         ac_set_tmpfile config |         ac_set_tmpfile config | ||||||
| @ -59,10 +69,11 @@ function _init_config() { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function init_repo_action() { | function init_repo_action() { | ||||||
|  |     local -a push_branches; local config | ||||||
|  | 
 | ||||||
|     [ ${#LocalBranches[*]} -eq 0 ] || die "Ce dépôt a déjà été initialisé" |     [ ${#LocalBranches[*]} -eq 0 ] || die "Ce dépôt a déjà été initialisé" | ||||||
| 
 | 
 | ||||||
|     local -a push_branches |     [ -n "$Origin" ] || Origin=origin | ||||||
| 
 |  | ||||||
|     _init_config || exit_with ewarn "Initialisation du dépôt annulée" |     _init_config || exit_with ewarn "Initialisation du dépôt annulée" | ||||||
| 
 | 
 | ||||||
|     einfo "Création de la branche $MAIN" |     einfo "Création de la branche $MAIN" | ||||||
| @ -78,9 +89,11 @@ function init_repo_action() { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function init_config_action() { | function init_config_action() { | ||||||
|     [ -f .pman.conf ] && die "La configuration pman a déjà été initialisée" |     local -a push_branches; config | ||||||
| 
 | 
 | ||||||
|     local -a push_branches |     [ -f .pman.conf -a -z "$ForceCreate" ] && die "La configuration pman a déjà été initialisée" | ||||||
|  | 
 | ||||||
|  |     resolve_should_push | ||||||
| 
 | 
 | ||||||
|     _init_config || exit_with ewarn "Initialisation de la configuration annulée" |     _init_config || exit_with ewarn "Initialisation de la configuration annulée" | ||||||
|     git commit -m "configuration pman" |     git commit -m "configuration pman" | ||||||
| @ -89,17 +102,33 @@ function init_config_action() { | |||||||
|     _push_branches |     _push_branches | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | function _ensure_main_branch() { | ||||||
|  |     [ -n "$MAIN" ] || die "La branche MAIN n'a pas été définie" | ||||||
|  |     [ -n "$MainBranch" ] || die "$MAIN: cette branche n'existe pas (le dépôt a-t-il été initialisé?)" | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | function checkout_main_action() { | ||||||
|  |     _ensure_main_branch | ||||||
|  |     git checkout -q "$MAIN" | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | function _ensure_develop_branch() { | ||||||
|  |     [ -n "$DEVELOP" ] || die "La branche DEVELOP n'a pas été définie" | ||||||
|  |     [ -n "$DevelopBranch" ] || die "$DEVELOP: cette branche n'existe pas (le dépôt a-t-il été initialisé?)" | ||||||
|  | } | ||||||
|  | 
 | ||||||
| function init_develop_action() { | function init_develop_action() { | ||||||
|  |     local -a push_branches | ||||||
|  | 
 | ||||||
|     if [ -z "$DevelopBranch" ]; then |     if [ -z "$DevelopBranch" ]; then | ||||||
|         [ -n "$DEVELOP" ] || die "La branche DEVELOP n'a pas été définie" |         _ensure_main_branch | ||||||
|         [ -n "$MAIN" ] || die "La branche MAIN n'a pas été définie" |         _ensure_develop_branch | ||||||
|         [ -n "$MainBranch" ] || die "$MAIN: cette branche n'existe pas (le dépôt a-t-il été initialisé?)" | 
 | ||||||
|  |         resolve_should_push | ||||||
| 
 | 
 | ||||||
|         enote "Vous allez créer la branche ${COULEUR_VERTE}$DEVELOP${COULEUR_NORMALE} <-- ${COULEUR_BLEUE}$MAIN${COULEUR_NORMALE}" |         enote "Vous allez créer la branche ${COULEUR_VERTE}$DEVELOP${COULEUR_NORMALE} <-- ${COULEUR_BLEUE}$MAIN${COULEUR_NORMALE}" | ||||||
|         ask_yesno "Voulez-vous continuer?" O || die |         ask_yesno "Voulez-vous continuer?" O || die | ||||||
| 
 | 
 | ||||||
|         local -a push_branches |  | ||||||
| 
 |  | ||||||
|         einfo "Création de la branche $DEVELOP" |         einfo "Création de la branche $DEVELOP" | ||||||
|         git checkout -b "$DEVELOP" "$MAIN" || die |         git checkout -b "$DEVELOP" "$MAIN" || die | ||||||
|         push_branches+=("$DEVELOP") |         push_branches+=("$DEVELOP") | ||||||
| @ -109,17 +138,23 @@ function init_develop_action() { | |||||||
|     git checkout -q "$DEVELOP" |     git checkout -q "$DEVELOP" | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | function _ensure_upstream_branch() { | ||||||
|  |     [ -n "$UPSTREAM" ] || die "La branche UPSTREAM n'a pas été définie" | ||||||
|  |     [ -n "$UpstreamBranch" ] || die "$UPSTREAM: cette branche n'existe pas (le dépôt a-t-il été initialisé?)" | ||||||
|  | } | ||||||
|  | 
 | ||||||
| function init_upstream_action() { | function init_upstream_action() { | ||||||
|  |     local -a push_branches; local config | ||||||
|  | 
 | ||||||
|     if [ -z "$UpstreamBranch" ]; then |     if [ -z "$UpstreamBranch" ]; then | ||||||
|         [ -n "$UPSTREAM" ] || die "La branche UPSTREAM n'a pas été définie" |         _ensure_develop_branch | ||||||
|         [ -n "$DEVELOP" ] || die "La branche DEVELOP n'a pas été définie" |         _ensure_upstream_branch | ||||||
|         [ -n "$DevelopBranch" ] || die "$DEVELOP: cette branche n'existe pas (le dépôt a-t-il été initialisé?)" | 
 | ||||||
|  |         resolve_should_push | ||||||
| 
 | 
 | ||||||
|         enote "Vous allez créer la branche ${COULEUR_VERTE}$UPSTREAM${COULEUR_NORMALE}" |         enote "Vous allez créer la branche ${COULEUR_VERTE}$UPSTREAM${COULEUR_NORMALE}" | ||||||
|         ask_yesno "Voulez-vous continuer?" O || die |         ask_yesno "Voulez-vous continuer?" O || die | ||||||
| 
 | 
 | ||||||
|         local -a push_branches; local config |  | ||||||
| 
 |  | ||||||
|         # faire une copie de la configuration actuelle |         # faire une copie de la configuration actuelle | ||||||
|         ac_set_tmpfile config |         ac_set_tmpfile config | ||||||
|         cp "$ConfigFile" "$config" |         cp "$ConfigFile" "$config" | ||||||
| @ -145,17 +180,23 @@ function init_upstream_action() { | |||||||
|     git checkout -q "$UPSTREAM" |     git checkout -q "$UPSTREAM" | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | function _ensure_dist_branch() { | ||||||
|  |     [ -n "$DIST" ] || die "La branche DIST n'a pas été définie" | ||||||
|  |     [ -n "$DistBranch" ] || die "$DIST: cette branche n'existe pas (le dépôt a-t-il été initialisé?)" | ||||||
|  | } | ||||||
|  | 
 | ||||||
| function init_dist_action() { | function init_dist_action() { | ||||||
|  |     local -a push_branches | ||||||
|  | 
 | ||||||
|     if [ -z "$DistBranch" ]; then |     if [ -z "$DistBranch" ]; then | ||||||
|         [ -n "$DIST" ] || die "La branche DIST n'a pas été définie" |         _ensure_main_branch | ||||||
|         [ -n "$MAIN" ] || die "La branche MAIN n'a pas été définie" |         _ensure_dist_branch | ||||||
|         [ -n "$MainBranch" ] || die "$MAIN: cette branche n'existe pas (le dépôt a-t-il été initialisé?)" | 
 | ||||||
|  |         resolve_should_push | ||||||
| 
 | 
 | ||||||
|         enote "Vous allez créer la branche ${COULEUR_VERTE}$DIST${COULEUR_NORMALE} <-- ${COULEUR_BLEUE}$MAIN${COULEUR_NORMALE}" |         enote "Vous allez créer la branche ${COULEUR_VERTE}$DIST${COULEUR_NORMALE} <-- ${COULEUR_BLEUE}$MAIN${COULEUR_NORMALE}" | ||||||
|         ask_yesno "Voulez-vous continuer?" O || die |         ask_yesno "Voulez-vous continuer?" O || die | ||||||
| 
 | 
 | ||||||
|         local -a push_branches |  | ||||||
| 
 |  | ||||||
|         einfo "Création de la branche $DIST" |         einfo "Création de la branche $DIST" | ||||||
|         git checkout -b "$DIST" "$MAIN" || die |         git checkout -b "$DIST" "$MAIN" || die | ||||||
|         push_branches+=("$DIST") |         push_branches+=("$DIST") | ||||||
| @ -166,18 +207,21 @@ function init_dist_action() { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function init_feature_action() { | function init_feature_action() { | ||||||
|     local branch="${1#$FEATURE}" |     local -a push_branches; local branch | ||||||
|     [ -n "$branch" ] || die "Vous devez définir la nom de la branche à créer" | 
 | ||||||
|  |     [ -n "$FEATURE" ] || die "La branche FEATURE n'a pas été définie" | ||||||
|  |     branch="${1#$FEATURE}" | ||||||
|  |     [ -n "$branch" ] || die "Vous devez spécifier le nom de la branche" | ||||||
|     branch="$FEATURE$branch" |     branch="$FEATURE$branch" | ||||||
|  | 
 | ||||||
|     if ! array_contains AllBranches "$branch"; then |     if ! array_contains AllBranches "$branch"; then | ||||||
|         [ -n "$DEVELOP" ] || die "La branche DEVELOP n'a pas été définie" |         _ensure_develop_branch | ||||||
|         [ -n "$DevelopBranch" ] || die "$DEVELOP: cette branche n'existe pas (le dépôt a-t-il été initialisé?)" | 
 | ||||||
|  |         resolve_should_push | ||||||
| 
 | 
 | ||||||
|         enote "Vous allez créer la branche ${COULEUR_VERTE}$branch${COULEUR_NORMALE} <-- ${COULEUR_BLEUE}$DEVELOP${COULEUR_NORMALE}" |         enote "Vous allez créer la branche ${COULEUR_VERTE}$branch${COULEUR_NORMALE} <-- ${COULEUR_BLEUE}$DEVELOP${COULEUR_NORMALE}" | ||||||
|         ask_yesno "Voulez-vous continuer?" O || die |         ask_yesno "Voulez-vous continuer?" O || die | ||||||
| 
 | 
 | ||||||
|         local -a push_branches |  | ||||||
| 
 |  | ||||||
|         einfo "Création de la branche $branch" |         einfo "Création de la branche $branch" | ||||||
|         git checkout -b "$branch" "$DEVELOP" || die |         git checkout -b "$branch" "$DEVELOP" || die | ||||||
|         push_branches+=("$branch") |         push_branches+=("$branch") | ||||||
| @ -192,7 +236,7 @@ function init_action() { | |||||||
|     case "$what" in |     case "$what" in | ||||||
|     init|repo|r) init_repo_action "$@";; |     init|repo|r) init_repo_action "$@";; | ||||||
|     config) init_config_action "$@";; |     config) init_config_action "$@";; | ||||||
|     main|m) git checkout -q "$MAIN";; |     main|m) checkout_main_action;; | ||||||
|     develop|dev|d) init_develop_action "$@";; |     develop|dev|d) init_develop_action "$@";; | ||||||
|     upstream|up|u) init_upstream_action "$@";; |     upstream|up|u) init_upstream_action "$@";; | ||||||
|     dist|x) init_dist_action "$@";; |     dist|x) init_dist_action "$@";; | ||||||
| @ -209,7 +253,7 @@ ConfigBranch= | |||||||
| ConfigFile= | ConfigFile= | ||||||
| action=init | action=init | ||||||
| Origin= | Origin= | ||||||
| Push=1 | [ -z "$PMAN_NO_PUSH" ] && Push=1 || Push= | ||||||
| ForceCreate= | ForceCreate= | ||||||
| args=( | args=( | ||||||
|     "gérer un projet git" |     "gérer un projet git" | ||||||
|  | |||||||
							
								
								
									
										28
									
								
								bin/prel
									
									
									
									
									
								
							
							
						
						
									
										28
									
								
								bin/prel
									
									
									
									
									
								
							| @ -44,6 +44,8 @@ function create_release_action() { | |||||||
| 
 | 
 | ||||||
|     [ -n "$ManualRelease" ] && ewarn "\ |     [ -n "$ManualRelease" ] && ewarn "\ | ||||||
| L'option --no-merge a été forcée puisque ce dépôt ne supporte pas les releases automatiques" | L'option --no-merge a été forcée puisque ce dépôt ne supporte pas les releases automatiques" | ||||||
|  |     [ -z "$ShouldPush" ] && enote "\ | ||||||
|  | L'option --no-push a été forcée puisque ce dépôt n'a pas d'origine" | ||||||
| 
 | 
 | ||||||
|     if [ -z "$Version" -a -n "$CurrentVersion" -a -f VERSION.txt ]; then |     if [ -z "$Version" -a -n "$CurrentVersion" -a -f VERSION.txt ]; then | ||||||
|         Version="$(<VERSION.txt)" |         Version="$(<VERSION.txt)" | ||||||
| @ -129,26 +131,25 @@ EOF | |||||||
| fi | fi | ||||||
| EOF | EOF | ||||||
| 
 | 
 | ||||||
|     [ -n "$Merge" ] && Merged=1 || Merged= |     [ -z "$ManualRelease" -a -n "$Merge" ] && ShouldMerge= || ShouldMerge=1 | ||||||
|     [ -n "$Push" -o "$CantPush" ] && Pushed=1 || Pushed= |     [ -n "$ShouldPush" -a -n "$Push" ] && ShouldPush= | ||||||
|     if [ -n "$_NoRunScript" ]; then |     if [ -n "$_NoRunScript" ]; then | ||||||
|         einfo "Veuillez consulter le script $script pour le détail des opérations à effectuer" |         einfo "Veuillez consulter le script $script pour le détail des opérations à effectuer" | ||||||
|     elif ! "$script" create ${Merge:+merge} ${Push:+push}; then |     elif ! "$script" create ${Merge:+merge} ${Push:+push}; then | ||||||
|         eimportant "\ |         eimportant "\ | ||||||
| Le script $script a été lancé avec les arguments 'create${Merge:+ merge}${Push:+ push}' | Le script $script a été lancé avec les arguments 'create${Merge:+ merge}${Push:+ push}' | ||||||
| Veuillez le consulter pour le détail des opérations qui n'ont pas pu êtres effectuées" | En cas d'erreur de merge, veuillez corriger les erreurs puis continuer avec | ||||||
|  |     git merge --continue | ||||||
|  | Veuillez aussi consulter le script et/ou le relancer | ||||||
|  |     ./$script${Push:+ push}" | ||||||
|         die |         die | ||||||
|     elif [ -n "$Merged" -a -n "$Pushed" ]; then |     elif [ -n "$Merge" -a -n "$Pushe" ]; then | ||||||
|         [ -n "$_KeepScript" ] || rm "$script" |         [ -n "$_KeepScript" ] || rm "$script" | ||||||
|     else |     else | ||||||
|         local cmd |  | ||||||
|         [ -n "$Merged" ] || cmd="$cmd |  | ||||||
|     ./$script merge" |  | ||||||
|         [ -n "$Pushed" ] || cmd="$cmd |  | ||||||
|     ./$script push" |  | ||||||
|         einfo "\ |         einfo "\ | ||||||
| Le script $script a été lancé avec les arguments 'create${Merge:+ merge}${Push:+ push}' | Le script $script a été lancé avec les arguments 'create${Merge:+ merge}${Push:+ push}' | ||||||
| Veuillez le consulter pour le détail des autres opérations à effectuer$cmd" | Vous pouvez consulter le script et/ou le relancer | ||||||
|  |     ./$script${ShouldMerge:+ merge}${ShouldPush:+ push}" | ||||||
|     fi |     fi | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| @ -238,13 +239,12 @@ load_branches current "$1"; shift | |||||||
| [ -n "$ManualRelease" ] && Merge= | [ -n "$ManualRelease" ] && Merge= | ||||||
| [ -z "$Merge" ] && Push= | [ -z "$Merge" ] && Push= | ||||||
| 
 | 
 | ||||||
| CantPush= | ShouldPush=1 | ||||||
| [ -n "$Origin" ] || Origin=origin | [ -n "$Origin" ] || Origin=origin | ||||||
| if ! git_have_remote "$Origin" && [ -n "$Push" ]; then | if ! git_have_remote "$Origin" && [ -n "$Push" ]; then | ||||||
|     ewarn "L'option --no-push a été forcée puisque ce dépôt n'a pas d'origine" |     ShouldPush= | ||||||
|     CantPush=1 |  | ||||||
| fi | fi | ||||||
| [ -n "$CantPush" ] && Push= | [ -z "$ShouldPush" ] && Push= | ||||||
| 
 | 
 | ||||||
| # puis faire l'action que l'on nous demande | # puis faire l'action que l'on nous demande | ||||||
| case "$action" in | case "$action" in | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user