All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Toke Høiland-Jørgensen" <toke@toke.dk>
To: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Cc: users@linux.kernel.org, tools@linux.kernel.org,
	Jens Axboe <axboe@kernel.dk>,
	Arnaldo Carvalho de Melo <acme@kernel.org>
Subject: Re: b4: encouraging using the cover letter in merge commits?
Date: Sat, 19 Dec 2020 13:29:07 +0100	[thread overview]
Message-ID: <871rfmnfn0.fsf@toke.dk> (raw)
In-Reply-To: <20201218220916.p2yzwotpantfqtss@chatter.i7.local>

Konstantin Ryabitsev <konstantin@linuxfoundation.org> writes:

> On Fri, Dec 18, 2020 at 10:32:11PM +0100, Toke Høiland-Jørgensen wrote:
>> I notice b4 will already save the cover letter along with the patch mbox
>> file, but maybe it would be possible to automate the workflow some more?
>> A 'b4 merge' command that wraps 'git merge' and pre-populates the commit
>> message with the text from the cover letter? Or some other trick? WDYT?
>
> I've been careful to operate on the "principle of least surprise," which is
> why I try not to make any changes to the git repository directly. B4 will use
> git commands, but in a way that don't modify the tree (only prepopulate
> objects behind the scenes, etc). For this reason, I'm wary of wrapping any
> git commands directly with b4.

Fair enough :)

> One way I can think of is to save the payload of the cover letter into the
> .cover file, if we recognize that we're in a git repository. Then, when
> performing the merge, you would run:
>
> git merge -F .cover --edit --log branchname
>
> This will preload the cover letter into the merge message and let you edit it
> before performing the merge.
>
> What do you think?

I think the above would work - just putting the text of the cover letter
(without the email headers and diffstat) into a file for easy inclusion
like you suggested would likely be helpful. I'd probably name it for the
branch, though (e.g., .cover.$BRANCH ?) so that it's possible to create
multiple branches, flip around between them, and still have the cover
file be there when merging later.

I played around with creating an alias for the merge command itself, and
while having to include the branch name in the filename rules out a
simple alias, just dropping a script like this into $PATH and naming it
"git-mergedesc":

#!/bin/bash
exec git merge -F .cover.$1 --edit "$@"

makes it possible to just run 'git mergedesc branch' and get the right
behaviour (although obviously a real script should be a bit smarter
about argument parsing and validation!).

-Toke

  reply	other threads:[~2020-12-19 12:29 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-18 21:32 b4: encouraging using the cover letter in merge commits? Toke Høiland-Jørgensen
2020-12-18 22:09 ` Konstantin Ryabitsev
2020-12-19 12:29   ` Toke Høiland-Jørgensen [this message]
2020-12-18 22:38 ` [kernel.org users] " James Bottomley
2020-12-19 12:34   ` Toke Høiland-Jørgensen
2020-12-19 17:03     ` James Bottomley
2020-12-19 17:21       ` Jakub Kicinski
2020-12-19 17:32         ` James Bottomley
2020-12-21 19:05         ` Jason Gunthorpe
2020-12-21 21:13           ` Michal Kubeček
2020-12-21 21:30           ` Arnaldo Carvalho de Melo
2020-12-22  6:30             ` Leon Romanovsky
2020-12-22  8:14               ` Geert Uytterhoeven
2020-12-22 12:36                 ` Leon Romanovsky
2021-01-05 13:38                 ` Jason Gunthorpe
2020-12-19 18:45       ` Jonathan Corbet
2020-12-19 18:49         ` James Bottomley
2020-12-19 18:57           ` Jonathan Corbet
2020-12-19 19:03             ` James Bottomley
2020-12-19 20:48               ` Arnaldo Carvalho de Melo
2020-12-19 21:01                 ` James Bottomley
2020-12-19 21:43                   ` Arnaldo Carvalho de Melo
2020-12-19 21:57                     ` James Bottomley
2020-12-19 22:17                       ` Arnaldo Carvalho de Melo
2020-12-19 23:34                         ` James Bottomley
2020-12-21 17:34       ` [tools] " Mark Brown

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871rfmnfn0.fsf@toke.dk \
    --to=toke@toke.dk \
    --cc=acme@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=konstantin@linuxfoundation.org \
    --cc=tools@linux.kernel.org \
    --cc=users@linux.kernel.org \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.