From: jim.cromie@gmail.com
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: git format-patch -s enhancement
Date: Mon, 16 Aug 2021 15:49:21 -0600 [thread overview]
Message-ID: <CAJfuBxxuGf4aHjD6S0sLHgM0_SkqwY5tgEVBPvTANbak+5DFLA@mail.gmail.com> (raw)
In-Reply-To: <YRqUK3cRFJmANzDd@coredump.intra.peff.net>
On Mon, Aug 16, 2021 at 10:37 AM Jeff King <peff@peff.net> wrote:
>
> On Sun, Aug 15, 2021 at 05:07:34PM -0600, jim.cromie@gmail.com wrote:
>
> > git format-patch -s is sub-optimal :
> > it appends the SoB,
> > which falls after the snips
> > ---
> > changelog ...
> > that the commit message may contain
> >
> >
> > So it misfires on any maintainer scripts
> > expecting the SoB above the 1st snip.
> >
> > The workaround is manual SoBs above any snips.
> >
> > I note this in -s doc,
> >
> > Add a Signed-off-by trailer to the commit message, using
> > the committer identity of yourself.
> > See the signoff option in git-commit(1) for more information.
> >
> > "trailer" is really "document current working behavior"
> > (normative docu-speak, so to speak;)
> >
> > Ideal behavior is to find 1st in-body --- snip
> > and insert there
>
> The big disconnect here is that "---" snip lines are not meant to be
> meaningful within commit messages themselves. They are part of the
> process of sticking a commit message into an email. So format-patch and
> git-am know about them, but "git commit" for example doesn't.
>
> So "git commit --signoff" probably shouldn't take them into account when
> deciding the end of a commit message. The user might or might not have
> meant "---" to be syntactically meaningful, depending on whether they
> plan to send the message with format-patch (and changing the behavior
> now is questionable).
>
> Doing so with "git format-patch --signoff" is a slightly different
> question. The current behavior is working as intended, in the sense
> that it signs off just as "commit -s" would, and then separately sticks
> the result into the email. The fact that "---" in the commit message is
> indistinguishable from the ones added by format-patch is mostly an
> accident.
>
> That said, it's kind of a useful accident for some workflows, exactly
> because you can carry these non-commit-message notes inside the commit
> message. And since we know how any in-commit-message "---" will be
> treated by git-am on the other side, it might be reasonable for
> format-patch to start considering them to be syntactically significant.
>
> So I guess I would disagree that it's a bug exactly, in that the
> workflow you're advocating was never meant to be supported. But I don't
> see any reason we couldn't be a little friendlier to it, if somebody
> wanted to teach format-patch to do so.
>
agreed, notabug.
but it might fall afoul of others' mail handler scripts,
Ive had a couple replys implying missed delivery,
maybe because of details like '---'
Im just gonna add my SoB either at commit time, or manually.
It will be interesting to see what happens to an SoB in a commit
when its revised and --- changelogged
thanks
> An alternative workflow would be to use git-notes to attach the
> changelog data to the commit. Those are shown after the "---" by
> format-patch already. Unfortunately, keeping them up to date is kind of
> annoying. Ages ago, I had a patch to let you modify them while editing
> the commit message, which makes it pretty seamless:
>
> https://lore.kernel.org/git/20110225133056.GA1026@sigill.intra.peff.net/
>
> I carried the patch in my local build for a while, but never really
> ended up using it. So I never polished it further. But I think it's
> still fundamentally a reasonable idea, if somebody is interested in
> carrying it forward. If so, here's the version I've been rebasing
> forward over the years:
>
> https://github.com/peff/git jk/commit-notes-wip
>
> but it doesn't seem to actually pass its own tests anymore (so it may or
> may not be a helpful starting point. ;) ).
>
> -Peff
prev parent reply other threads:[~2021-08-16 21:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-15 23:07 git format-patch -s enhancement jim.cromie
2021-08-16 7:56 ` Bagas Sanjaya
2021-08-16 16:36 ` Jeff King
2021-08-16 21:49 ` jim.cromie [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAJfuBxxuGf4aHjD6S0sLHgM0_SkqwY5tgEVBPvTANbak+5DFLA@mail.gmail.com \
--to=jim.cromie@gmail.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).