From 2163ea992e20eecaf0bd857144520bb1b1ae340d Mon Sep 17 00:00:00 2001 From: Jephte Clain Date: Sat, 1 Mar 2025 06:14:00 +0400 Subject: [PATCH] script post release/merge --- bash/src/pman.sh | 29 ++++++++++++++++++++++++++--- bin/pdev | 18 +++++++++++++++++- bin/prel | 19 ++++++++++++++++++- 3 files changed, 61 insertions(+), 5 deletions(-) diff --git a/bash/src/pman.sh b/bash/src/pman.sh index 9df7df9..8c12d1c 100644 --- a/bash/src/pman.sh +++ b/bash/src/pman.sh @@ -45,7 +45,7 @@ $0 !~ // { print } function _filter_changes() { # enlever les commits "inutiles" pour générer le fichier CHANGES.md grep -vE '^([+|] )?[0-9a-f]+ modifs\.mineures sans commentaires$' | - grep -vE '^([+|] )?[0-9a-f]+ (cosmetic|typo|bug|fix|maj projet|maj deps)\$' + grep -vE '^([+|] )?[0-9a-f]+ (cosmetic|typo|bug|fix|maj projet|maj deps)$' } function _format_md() { @@ -167,7 +167,17 @@ function load_branches() { "$HOTFIX"*) SrcType=hotfix; DestBranch="$MAIN";; "$MAIN") SrcType=main; DestBranch="$DIST";; "$DIST") SrcType=dist; DestBranch=;; - *) DestBranch=;; + *) SrcType=; DestBranch=;; + esac + case "$DestBranch" in + "$UPSTREAM") DestType=upstream;; + "$FEATURE"*) DestType=feature;; + "$DEVELOP") DestType=develop;; + "$RELEASE"*) DestType=release;; + "$HOTFIX"*) DestType=hotfix;; + "$MAIN") DestType=main;; + "$DIST") DestType=dist;; + *) DestType=;; esac local branch @@ -275,6 +285,11 @@ function _mscript_start() { #!/bin/bash $(qvals source "$NULIBDIR/load.sh") || exit 1 +$(echo_setv SrcBranch="$SrcBranch") +$(echo_setv SrcType="$SrcType") +$(echo_setv DestBranch="$DestBranch") +$(echo_setv DestType="$DestType") + merge= delete= push= @@ -330,6 +345,14 @@ function _rscript_start() { #!/bin/bash $(qvals source "$NULIBDIR/load.sh") || exit 1 +$(echo_setv SrcBranch="$SrcBranch") +$(echo_setv SrcType="$SrcType") +$(echo_setv Version="$Version") +$(echo_setv Tag="$Tag") +$(echo_setv ReleaseBranch="$ReleaseBranch") +$(echo_setv DestBranch="$DestBranch") +$(echo_setv DestType="$DestType") + create= merge= push= @@ -382,7 +405,7 @@ EOF # Enregistrer les changements _scripta "commit" <Init changelog & version $Version") +$(qvals git commit -m "Init changelog & version $Tag") EOF } diff --git a/bin/pdev b/bin/pdev index c0433e2..c5624a3 100755 --- a/bin/pdev +++ b/bin/pdev @@ -31,8 +31,9 @@ Ce script va - pousser les branches modifiées}" ask_yesno "Voulez-vous continuer?" O || die - local script=".git/rel-merge.sh" + local script=".git/pman-merge.sh" local -a push_branches delete_branches + local after local comment= local or_die=" || exit 1" @@ -44,6 +45,11 @@ if [ -n "\$merge" ]; then esection "Fusionner la branche" EOF _mscript_merge_branch + after="AFTER_MERGE_${SrcType^^}"; [ -n "${!after}" ] && _scripta <