aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/release
diff options
context:
space:
mode:
authorGravatar Damien Martin-Guillerez <dmarting@google.com>2015-10-07 14:58:06 +0000
committerGravatar Han-Wen Nienhuys <hanwen@google.com>2015-10-08 12:11:21 +0000
commit0052b80307f0cbfc27994d097bcb074e8c2a6ed9 (patch)
tree91b9a51ccb921a1c7ba1982ee4c8fdba2d1338b3 /scripts/release
parent1940933a4191846f9349ecd45976dff3cab976d6 (diff)
[release] Truncate git hash to 7 characters
With that change, all the git hash will have the same length in the release notes, even when specifying the full commit hash. -- MOS_MIGRATED_REVID=104861463
Diffstat (limited to 'scripts/release')
-rwxr-xr-xscripts/release/relnotes.sh4
-rwxr-xr-xscripts/release/relnotes_test.sh6
2 files changed, 5 insertions, 5 deletions
diff --git a/scripts/release/relnotes.sh b/scripts/release/relnotes.sh
index ff6035d7d2..adbfe9e918 100755
--- a/scripts/release/relnotes.sh
+++ b/scripts/release/relnotes.sh
@@ -153,10 +153,10 @@ function create_release_notes() {
# message will be wrapped into 70 columns.
# + CHERRY_PICK2: commit message summary of the CHERRY_PICK2.
function create_revision_information() {
- echo "Baseline: $1"
+ echo "Baseline: $(git rev-parse --short "${1}")"
shift
while [ -n "${1-}" ]; do
- local hash="$1"
+ local hash="$(git rev-parse --short "${1}")"
local subject=$(git show -s --pretty=format:%s $hash)
local lines=$(echo "$subject" | wrap_text 56) # 14 leading spaces.
echo " + $hash: $lines" | head -1
diff --git a/scripts/release/relnotes_test.sh b/scripts/release/relnotes_test.sh
index 964cff0fa5..92538ffc59 100755
--- a/scripts/release/relnotes_test.sh
+++ b/scripts/release/relnotes_test.sh
@@ -80,9 +80,9 @@ TEST_CHANGE='Important changes:
function test_release_notes() {
assert_equals "$TEST_INC_CHANGE$(echo)$TEST_NEW_CHANGE$(echo)$TEST_CHANGE" \
- "$(release_notes 965c392)"
+ "$(release_notes 965c392ab1d68d5bc23fdef3d86d635ec9d2da8e)"
assert_equals "$TEST_NEW_CHANGE$(echo)$TEST_CHANGE" \
- "$(release_notes 965c392 bb59d88)"
+ "$(release_notes 965c392ab1d68d5bc23fdef3d86d635ec9d2da8e bb59d88)"
}
function test_get_last_release() {
@@ -198,7 +198,7 @@ function test_create_revision_information() {
should produce additional information about aspect
dependencies when --output is set to {xml, proto}.'
assert_equals "$expected" \
- "$(create_revision_information 965c392 bb59d88 14d905b)"
+ "$(create_revision_information 965c392ab1d68d5bc23fdef3d86d635ec9d2da8e bb59d88 14d905b5cce9a1bbc2911331809b03679b23dad1)"
}
run_suite "Release notes generation tests"