tools.linux.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Konstantin Ryabitsev" <konstantin@linuxfoundation.org>
To: users@linux.kernel.org, tools@linux.kernel.org
Subject: b4 can now explode a pull request into an mbox file with patches
Date: Thu, 26 Mar 2020 18:19:26 -0400	[thread overview]
Message-ID: <20200326221926.jfsbtvnb7bfjahov@chatter.i7.local> (raw)

Hi, all:

While working on "pull-request exploder" stuff for achiving on 
lore.kernel.org, I realized that this may be a useful set of features 
for developers as well, as I imagine you sometimes want to comment on 
something in a pull request and end up having to go hunting for the 
proper commit, from/to/cc, etc information.

So, the master branch of b4 just landed initial "b4 pr" implementation, 
which will let you do "b4 pr --explode <msgid>" to get an mbox file
with that pull request converted into a patch series with various 
headers set so it's convenient to fire off "mutt -f" and reply to the 
exact bits that you want and send it to the proper places.

In more details:

b4 pr <msgid>

  - downloads that message
  - parses the pull request
  - checks that the remote tip is where the message says it should be
  - makes sure the base-commit is present in the tree
  - makes sure the tip commit isn't already in one of the branches
  - checks if FETCH_HEAD already is at that commit
  - if all looks good, performs a git fetch
  - (optionally, can then do a checkout into a branch for you)

b4 pr --check <msgid>

  Runs all of the checks above, but doesn't perform the actual fetch.
  Useful if you don't remember if you've already processed a pull
  request or not.

b4 pr --explode <msgid>

  Runs basic sanity checks and then:

  - performs a git fetch
  - runs a "git format-patch" for base-commit..FETCH_HEAD
  - adds the same to/from/cc headers as in the pull request
  - properly threads each patch below the pull request
  - saves that into a <msgid>.mbox file

I mostly imagine that it's the --explode functionality that you'd be 
interested in, but since that required writing most of the other 
pull-request handling functionality, there's basic handling for that as 
well.

Please let me know if that is useful.

You can grab the master here:
https://git.kernel.org/pub/scm/utils/b4/b4.git

Using the "b4.sh" wrapper in should let you run it straight from the 
checkout.

-K

             reply	other threads:[~2020-03-26 22:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-26 22:19 Konstantin Ryabitsev [this message]
2020-03-27 11:48 ` [kernel.org users] b4 can now explode a pull request into an mbox file with patches Greg KH
2020-03-31  2:06   ` [tools] " Konstantin Ryabitsev

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=20200326221926.jfsbtvnb7bfjahov@chatter.i7.local \
    --to=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 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 NNTP newsgroup(s).