]> git.ozlabs.org Git - next-scripts/commitdiff
replace empty fields in the control file with '-'
authorStephen Rothwell <sfr@canb.auug.org.au>
Wed, 13 Aug 2025 10:31:18 +0000 (20:31 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 13 Aug 2025 10:31:18 +0000 (20:31 +1000)
So that they are easier to see

common.sh
do_merge

index 667c0ebaffde6789bae34b7387599674770be1a0..50dab592e10f7f7e79d3b17e4dffe5e93e509dc3 100644 (file)
--- a/common.sh
+++ b/common.sh
@@ -77,7 +77,8 @@ _TAB=$(printf '\t')
 
 get_control_field()
 {
-       awk -F "$_TAB" -v branch="$1" -v field="$2" '/^[^-#]/ && $3==branch { print $field; }' "$CTRL_FILE"
+       # if the field is just '-' print nothing
+       awk -F "$_TAB" -v branch="$1" -v field="$2" '/^[^-#]/ && $3==branch { if ($f=="-") print""; else print $field; }' "$CTRL_FILE"
 }
 
 get_branches()
index c3e1785bbdcec436b961922b2ee4cdc41b5b9831..509b7c5c3cd57dcb030ebb18b848958fc09a3e0a 100755 (executable)
--- a/do_merge
+++ b/do_merge
@@ -123,6 +123,9 @@ for h in $heads; do
 
        tree=$arg1
        branch=$arg2
+       if [ "X$branch" = 'X-' ]; then
+               branch=''
+       fi
        h="$tree${branch:+/$branch}"
        hlog=$(git log -1 --oneline "$h") 2>/dev/null
        old_head=$(git rev-parse HEAD)