Strip leading and trailing whitespace for unreleased_history entries (#11652)

Summary:
Some trailing whitespace has leaked into HISTORY.md entries. This can lead to unexpected changes when modifying HISTORY.md with hygienic editors (e.g. for a patch release). This change should protect against future cases.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/11652

Test Plan: manual

Reviewed By: akankshamahajan15

Differential Revision: D47882814

Pulled By: pdillinger

fbshipit-source-id: 148c3746d3b298cb6e1f655f0416d46619969086
oxigraph-main
Peter Dillinger 1 year ago committed by Facebook GitHub Bot
parent 6a0f637633
commit c205a217e6
  1. 8
      unreleased_history/release.sh

@ -34,8 +34,12 @@ awk '/#define ROCKSDB_MAJOR/ { major = $3 }
echo " (`date +%x`)" >> HISTORY.new
function process_file () {
# use awk to correct extra or missing newlines, missing '* ' on first line
awk '/./ { if (notfirstline || $1 == "*") print;
# use awk to correct
# * extra or missing newlines
# * leading or trailing whitespace
# * missing '* ' on first line
awk '/./ { gsub(/^[ \t]+/, ""); gsub(/[ \t]+$/, "");
if (notfirstline || $1 == "*") print;
else print "* " $0;
notfirstline=1; }' < $1 >> HISTORY.new
echo git rm $1

Loading…
Cancel
Save