Skip to content
Snippets Groups Projects

Preserve trailing newlines during rebase

Merged Ryan Gonzalez requested to merge wip/refi64/fix-trailing-newline into main
Files
26
@@ -296,6 +296,9 @@ publish app org.test.Test-1 (x86_64):
origin https://upload-host.xyz/main
- |-
set -e
trap 'echo "\`$BASH_COMMAND\` exited with status $?" >&2' ERR
pushd repo-app-org.test.Test-1 > /dev/null
for ref in $refs; do
echo "Rebasing $ref..."
@@ -325,7 +328,12 @@ publish app org.test.Test-1 (x86_64):
message=$(ostree show "$prev" \
| grep '^ ' \
| sed 's/^ *//g')
metadata=$(ostree cat "$prev" metadata)
# Trick to preserve any trailing newlines:
# https://unix.stackexchange.com/a/383411/117660
# (The '|| :' at the end is because read always returns an exit code of 1 in
# this case: https://stackoverflow.com/a/67066283/2097780)
IFS= read -rd '' metadata < <(ostree cat "$prev" metadata) || :
echo 'Applying new changes on top of remote...'
ostree commit -b "$ref" -m "$message" \
@@ -377,6 +385,9 @@ publish app org.test.Test-1 (aarch64):
origin https://upload-host.xyz/main
- |-
set -e
trap 'echo "\`$BASH_COMMAND\` exited with status $?" >&2' ERR
pushd repo-app-org.test.Test-1 > /dev/null
for ref in $refs; do
echo "Rebasing $ref..."
@@ -406,7 +417,12 @@ publish app org.test.Test-1 (aarch64):
message=$(ostree show "$prev" \
| grep '^ ' \
| sed 's/^ *//g')
metadata=$(ostree cat "$prev" metadata)
# Trick to preserve any trailing newlines:
# https://unix.stackexchange.com/a/383411/117660
# (The '|| :' at the end is because read always returns an exit code of 1 in
# this case: https://stackoverflow.com/a/67066283/2097780)
IFS= read -rd '' metadata < <(ostree cat "$prev" metadata) || :
echo 'Applying new changes on top of remote...'
ostree commit -b "$ref" -m "$message" \
@@ -458,6 +474,9 @@ publish app org.test.Test-1 (arm):
origin https://upload-host.xyz/main
- |-
set -e
trap 'echo "\`$BASH_COMMAND\` exited with status $?" >&2' ERR
pushd repo-app-org.test.Test-1 > /dev/null
for ref in $refs; do
echo "Rebasing $ref..."
@@ -487,7 +506,12 @@ publish app org.test.Test-1 (arm):
message=$(ostree show "$prev" \
| grep '^ ' \
| sed 's/^ *//g')
metadata=$(ostree cat "$prev" metadata)
# Trick to preserve any trailing newlines:
# https://unix.stackexchange.com/a/383411/117660
# (The '|| :' at the end is because read always returns an exit code of 1 in
# this case: https://stackoverflow.com/a/67066283/2097780)
IFS= read -rd '' metadata < <(ostree cat "$prev" metadata) || :
echo 'Applying new changes on top of remote...'
ostree commit -b "$ref" -m "$message" \
@@ -539,6 +563,9 @@ publish app org.test.Test-2 (x86_64):
origin https://upload-host.xyz/main
- |-
set -e
trap 'echo "\`$BASH_COMMAND\` exited with status $?" >&2' ERR
pushd repo-app-org.test.Test-2 > /dev/null
for ref in $refs; do
echo "Rebasing $ref..."
@@ -568,7 +595,12 @@ publish app org.test.Test-2 (x86_64):
message=$(ostree show "$prev" \
| grep '^ ' \
| sed 's/^ *//g')
metadata=$(ostree cat "$prev" metadata)
# Trick to preserve any trailing newlines:
# https://unix.stackexchange.com/a/383411/117660
# (The '|| :' at the end is because read always returns an exit code of 1 in
# this case: https://stackoverflow.com/a/67066283/2097780)
IFS= read -rd '' metadata < <(ostree cat "$prev" metadata) || :
echo 'Applying new changes on top of remote...'
ostree commit -b "$ref" -m "$message" \
@@ -620,6 +652,9 @@ publish app org.test.Test-2 (aarch64):
origin https://upload-host.xyz/main
- |-
set -e
trap 'echo "\`$BASH_COMMAND\` exited with status $?" >&2' ERR
pushd repo-app-org.test.Test-2 > /dev/null
for ref in $refs; do
echo "Rebasing $ref..."
@@ -649,7 +684,12 @@ publish app org.test.Test-2 (aarch64):
message=$(ostree show "$prev" \
| grep '^ ' \
| sed 's/^ *//g')
metadata=$(ostree cat "$prev" metadata)
# Trick to preserve any trailing newlines:
# https://unix.stackexchange.com/a/383411/117660
# (The '|| :' at the end is because read always returns an exit code of 1 in
# this case: https://stackoverflow.com/a/67066283/2097780)
IFS= read -rd '' metadata < <(ostree cat "$prev" metadata) || :
echo 'Applying new changes on top of remote...'
ostree commit -b "$ref" -m "$message" \
@@ -701,6 +741,9 @@ publish app org.test.Test-2 (arm):
origin https://upload-host.xyz/main
- |-
set -e
trap 'echo "\`$BASH_COMMAND\` exited with status $?" >&2' ERR
pushd repo-app-org.test.Test-2 > /dev/null
for ref in $refs; do
echo "Rebasing $ref..."
@@ -730,7 +773,12 @@ publish app org.test.Test-2 (arm):
message=$(ostree show "$prev" \
| grep '^ ' \
| sed 's/^ *//g')
metadata=$(ostree cat "$prev" metadata)
# Trick to preserve any trailing newlines:
# https://unix.stackexchange.com/a/383411/117660
# (The '|| :' at the end is because read always returns an exit code of 1 in
# this case: https://stackoverflow.com/a/67066283/2097780)
IFS= read -rd '' metadata < <(ostree cat "$prev" metadata) || :
echo 'Applying new changes on top of remote...'
ostree commit -b "$ref" -m "$message" \
Loading