From: Stephen Rothwell Date: Wed, 13 Aug 2025 10:31:18 +0000 (+1000) Subject: replace empty fields in the control file with '-' X-Git-Url: http://git.ozlabs.org/?a=commitdiff_plain;h=8fc45466036dc3e34bece94e6c85ca5cd21355a7;p=next-scripts replace empty fields in the control file with '-' So that they are easier to see --- diff --git a/common.sh b/common.sh index 667c0eb..50dab59 100644 --- 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() diff --git a/do_merge b/do_merge index c3e1785..509b7c5 100755 --- 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)