summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2020-08-22 17:48:11 -0400
committerKyle Meyer <kyle@kyleam.com>2020-08-22 17:48:11 -0400
commit8e48f5e1e6026c98686484c036ca65010b9fcfb2 (patch)
tree49a67efaf4a9930f627b86bcf77e42a0e5689748
parent5684a4fa0a25089752c04f59172f9708601314e9 (diff)
downloadpiem-8e48f5e1e6026c98686484c036ca65010b9fcfb2.tar.gz
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.
-rwxr-xr-xpost-applypatch9
1 files 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