summaryrefslogtreecommitdiff
path: root/release-info
diff options
context:
space:
mode:
authorGabriel Scherer <gabriel.scherer@gmail.com>2022-03-03 16:06:41 +0100
committerGabriel Scherer <gabriel.scherer@gmail.com>2022-03-03 16:08:19 +0100
commitd4f9435ac47bd401f844aa4a52c3504e3009b253 (patch)
tree4d90bb09e3c153cf4f98ae11639dfd1b28cf0b85 /release-info
parente59e682c57f66d65b72fc180097438855a24e31e (diff)
downloadocaml-d4f9435ac47bd401f844aa4a52c3504e3009b253.tar.gz
tweak markdown-add-pr-links.sh for idempotency
Diffstat (limited to 'release-info')
-rw-r--r--release-info/markdown-add-pr-links.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/release-info/markdown-add-pr-links.sh b/release-info/markdown-add-pr-links.sh
index 4b3a37a879..3955a40782 100644
--- a/release-info/markdown-add-pr-links.sh
+++ b/release-info/markdown-add-pr-links.sh
@@ -23,8 +23,15 @@
# It was only tested with GNU sed. Sorry!
+# Note: we turn #1234 into #[1234](.../issues/1234), with the '#'
+# outside the link. This gives the property that the script is
+# idempotent, it can be run on its own output and keeps it
+# unchanged. This makes it possible, for example, to run the script,
+# then add yet more non-linkified content, and run the script again on
+# the whole file.
+
GITHUB=https://github.com/ocaml/ocaml
sed "s,(Changes#\(.*\)),[Changes file for \\1]($GITHUB/blob/\\1/Changes),g" $1 \
-| sed "s,#\([0-9]\+\),[#\\1]($GITHUB/issues/\\1),g" \
+| sed "s,#\([0-9]\+\),#[\\1]($GITHUB/issues/\\1),g" \
| sed "s/^*/* [*breaking change*]/g"