tools.linux.kernel.org archive mirror
 help / color / mirror / Atom feed
* b4 can now explode a pull request into an mbox file with patches
@ 2020-03-26 22:19 Konstantin Ryabitsev
  2020-03-27 11:48 ` [kernel.org users] " Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Konstantin Ryabitsev @ 2020-03-26 22:19 UTC (permalink / raw)
  To: users, tools

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-31  2:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-26 22:19 b4 can now explode a pull request into an mbox file with patches Konstantin Ryabitsev
2020-03-27 11:48 ` [kernel.org users] " Greg KH
2020-03-31  2:06   ` [tools] " Konstantin Ryabitsev

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).