From 8e48f5e1e6026c98686484c036ca65010b9fcfb2 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sat, 22 Aug 2020 17:48:11 -0400 Subject: post-applypatch: Add Message-Id trailer rather than using notes I think it's valuable to expose this information without requiring that the user discover and configure the notes. Another option would be to use git-am's --message-id, but that doesn't add a space after the body, which I want. --- post-applypatch | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/post-applypatch b/post-applypatch index 49e226a..160b21c 100755 --- a/post-applypatch +++ b/post-applypatch @@ -46,10 +46,9 @@ if test -n "$message_id" && then echo "$head $message_id" >>"$GIT_DIR"/am.log && ( - GIT_NOTES_REF=refs/notes/amlog - export GIT_NOTES_REF - git notes add -f -m "Message-Id: $message_id" "$head" - blob=$(git notes list "$head") && - git notes append -m "$head" $blob + git show --format="%B" --no-patch HEAD | + git interpret-trailers --no-divider \ + --trailer "Message-Id: $message_id" | + git commit --amend --file - ) fi -- cgit v1.2.3