diff options
Diffstat (limited to 'release-info/markdown-add-pr-links.sh')
-rw-r--r-- | release-info/markdown-add-pr-links.sh | 9 |
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" |