* 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
* Re: [kernel.org users] b4 can now explode a pull request into an mbox file with patches
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 ` Greg KH
2020-03-31 2:06 ` [tools] " Konstantin Ryabitsev
0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2020-03-27 11:48 UTC (permalink / raw)
To: Konstantin Ryabitsev; +Cc: users, tools
On Thu, Mar 26, 2020 at 06:19:26PM -0400, Konstantin Ryabitsev wrote:
> 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.
Both sound really useful, thanks!
Now to just wait for someone to send me a pull request so I can try it
out, I just had caught up on all of them last night :)
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [tools] [kernel.org users] b4 can now explode a pull request into an mbox file with patches
2020-03-27 11:48 ` [kernel.org users] " Greg KH
@ 2020-03-31 2:06 ` Konstantin Ryabitsev
0 siblings, 0 replies; 3+ messages in thread
From: Konstantin Ryabitsev @ 2020-03-31 2:06 UTC (permalink / raw)
To: tools; +Cc: users
On Fri, Mar 27, 2020 at 12:48:24PM +0100, Greg KH wrote:
> > 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.
>
> Both sound really useful, thanks!
>
> Now to just wait for someone to send me a pull request so I can try it
> out, I just had caught up on all of them last night :)
The latest 0.4.0-dev master branch will also verify the signature at the
tip of FETCH_HEAD once it is fetched, so once the merge window closes
and you start processing pull requests again, you may find this useful.
E.g.:
$ b4 pr -b pstore-v5.7 202003292120.2BDCB41@keescook
Looking up https://lore.kernel.org/r/202003292120.2BDCB41@keescook
Grabbing thread from lore.kernel.org
Looking at: [GIT PULL] pstore updates for v5.7-rc1
Fetching https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git tags/pstore-v5.7-rc1
---
[✓] Attestation-by: Kees Cook <keescook@chromium.org> (pgp: 8972F4DFDC6DC026)
---
Fetched into branch pstore-v5.7
Best,
-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).