Carlo Zancanaro <[email protected]> writes: > On Thu, May 14 2026, Tomas Volf wrote: >> I have encountered bug with the hook we install for adding Change-Id >> trailer. It for some reason inserts it as a first line of the commit >> message instead of at the end. > > The trailer is installed by git-interpret-trailers, which says in its > man page: > > This command can also operate on the output of git-format-patch(1), > which is more elaborate than a plain commit message. Namely, such output > includes a commit message (as above), a "---" divider line, and a patch > part. For these inputs, the divider and patch parts are not modified by > this command and are emitted as is on the output, unless --no-divider is > specified. > > It looks like we could just add the --no-divider option whenever we call > interpret-trailers. However, in the comments of the hook it mentions > avoiding using --in-place because it's only for git 2.8 and up. The > --no-divider option seems to have appeared in 2.19.2 based on the online > documentation[1], so presumably we would also like to avoid it.
Good research. :) > I'm not sure why we're limiting ourselves to git versions and features > from 2017. Given that the commit-msg hook has this header --8<---------------cut here---------------start------------->8--- # From Gerrit Code Review 3.11.1. # # Part of Gerrit Code Review (https://www.gerritcodereview.com/) # # Copyright (C) 2009 The Android Open Source Project --8<---------------cut here---------------end--------------->8--- I would not rule out the option that Maxim just added it without considering this particular detail. I took the liberty of CC-ing him, maybe he could answer this bit. Tomas -- There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.
