diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2024-12-02 20:04:42 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2024-12-02 20:04:42 +0100 |
commit | 46048ac9b5610b7790bbf6cf8b1a51cd5cd522d0 (patch) | |
tree | 4ed0db01df9304e6f204c8230597cfcd10d9d157 | |
parent | 0636b1ab58e38810c564c3e80cfeace7d85b0428 (diff) | |
download | scripts-46048ac9b5610b7790bbf6cf8b1a51cd5cd522d0.tar.gz scripts-46048ac9b5610b7790bbf6cf8b1a51cd5cd522d0.zip |
Update aid for backporting commits:
+ Change usage from comment to here document displayed as a hint
+ Allow to process multiple patches in bulk
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rwxr-xr-x | misc/patch-update-for-r14-1-x | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/misc/patch-update-for-r14-1-x b/misc/patch-update-for-r14-1-x index ad5dea7..855f565 100755 --- a/misc/patch-update-for-r14-1-x +++ b/misc/patch-update-for-r14-1-x @@ -6,28 +6,38 @@ # This script is intented to reduce/eliminate those conflicts by undoing the # API changes done in master. # -# Usage: -# 1. save the changes of the commit to backport to a file -# git format-patch -1 <commit hash> -o <output_folder> -# 2. run this script on the saved file -# ./patch-update-for-r14-1-x <output_folder>/<patch_filename> -# 3. apply changes to r14.1.x branch -# git am <output_folder>/<patch_filename> -# 4. edit commit message to add cherry pick note under signed off clause -# git commit --amend --no-edit -S -# and add: -# (cherry picked from commit hash>) +if [ -z "$1" ]; then + cat <<USAGE +Preparing patches for backporting from master to r14.1.x branch. +Usage: +1. save the changes of the commit to backport to a file + git format-patch -1 <commit hash> -o <output_folder> + +2. run this script on the saved file + $(basename "$0") <output_folder>/<patch_filename> [...] + +3. apply changes to r14.1.x branch + git am <output_folder>/<patch_filename> + +4. edit commit message to add cherry pick note under signed off clause + git commit --amend --no-edit -S + and add: + (cherry picked from commit hash>) + +USAGE + exit 1 +fi # TDEUniqueApplication --> KUniqueApplication -sed -i "$1" \ +sed -i "$@" \ -e "s|TDEUniqueApplication|KUniqueApplication|g" \ -e "s|\btdeuniqueapp|kuniqueapp|g" \ -e "s|\btdeunique_|kunique_|g" \ -e "s|TDEUNIQUEAPP|KUNIQUEAPP|g" \ # TDEAppDCOPInterface --> KAppDCOPInterface -sed -i "$1" \ +sed -i "$@" \ -e "s|TDEAppDCOPInterface|KAppDCOPInterface|g" \ -e "s|tdeappdcopinterface|kappdcopiface|g" \ -e "s|tdeappdcopiface|kappdcopiface|g" \ @@ -35,5 +45,5 @@ sed -i "$1" \ -e "s|TDEAPPDCOP_INTERFACE_H|KAPPDCOP_INTERFACE_H|g" # tdeprocess --> kprocess -sed -i "$1" \ +sed -i "$@" \ -e "s|tdeprocess|kprocess|g" |