Skip to content

Commit b7093c7

Browse files
committed
Problem: sit-mr produces garbled details/summary on macOS
More specifically, the summary message's instructions are shown without leading hash signs (#) and such commented out lines are not subsequently removed. Similarly, while details instructions are prepended with hash signs, those are not subsequently removed. Solution: enforce use of regular expressions in sed with -E (For some reason, GNU sed didn't need -E (POSIX) or -r to work)
1 parent 8db49b9 commit b7093c7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cli/sit-mr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ run() {
2525
echo " If your patchset contained more than one commit, you will see a few options below. Please choose one." >> "${tmpdir}/summary"
2626
echo " (ALL LINES STARTING WITH '#' WILL BE REMOVED)" >> "${tmpdir}/summary"
2727
git log --reverse --pretty=format:"%s" "${range}" >> "${tmpdir}/summary" || exit 2
28-
sed -i 's/^/#/' "${tmpdir}/summary"
29-
sed -i '4s/^#//' "${tmpdir}/summary"
28+
sed -iE 's/^/#/' "${tmpdir}/summary"
29+
sed -iE '4s/^#//' "${tmpdir}/summary"
3030
$editor "${tmpdir}/summary" || exit 2
31-
sed -i '/^#/ d' "${tmpdir}/summary"
31+
sed -iE '/^#/ d' "${tmpdir}/summary"
3232

3333
# Details
3434
echo "# Details of the merge request" >> "${tmpdir}/details"
3535
echo "# (ALL LINES STARTING WITH '#' WILL BE REMOVED)" >> "${tmpdir}/details"
3636
git log --reverse --pretty=format:"%b%n" "${range}" >> "${tmpdir}/details" || exit 2
3737
$editor "${tmpdir}/details" || exit 2
38-
sed -i '/^#/ d' "${tmpdir}/details"
38+
sed -iE '/^#/ d' "${tmpdir}/details"
3939

4040
item=$(${sit} item)
4141
item_branch=${item}
@@ -45,7 +45,7 @@ run() {
4545
echo "# (ALL LINES STARTING WITH '#' WILL BE REMOVED)" >> "${tmpdir}/text"
4646
git log --reverse --pretty=format:"%s%n%n%b" "${range}" >> "${tmpdir}/text" || exit 2
4747
$editor "${tmpdir}/text" || exit 2
48-
sed -i '/^#/ d' "${tmpdir}/text"
48+
sed -iE '/^#/ d' "${tmpdir}/text"
4949

5050
last_record=$(${sit} records ${item} | tail -1)
5151
item_branch="${item}-${last_record}-$(date +%s)"

0 commit comments

Comments
 (0)