git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: cherry-pick --message?

From
Jeff King <peff@peff.net>
Date
Mar 21, 2017, 17:33 UTC
Message-ID
<20170321173335.n56veklbh4iginoa@sigill.intra.peff.net>
In-Reply-To
<20170321170734.GI28331@inner.h.apk.li>
On Tue, Mar 21, 2017 at 06:07:34PM +0100, Andreas Krey wrote:
Show 9 quoted lines
> > There's "cherry-pick --edit".
> 
> Yes, but. I'm in a toolchain, not a user. I'm a command that let
> the user cherry-pick specific things, and I need to edit out the things
> that made the original commit eligible to be picked in the first place.
> 
> Can't quite rely on the tool's user to do that. :-(
> 
> I'm not familiar with the plumbing to know where to look there.
You can do:
  GIT_EDITOR='sed -i d/^PROP:/' git cherry-pick --edit

but if there's a conflict, the user has resume it with that environment variable set. If you can rely on the user using your tool, that might work. If they might run arbitrary git commands, then no.

Probably "format-patch | sed | am -3" is your best bet if you want to modify the patches in transit _and_ have the user just use normal git tools.

-Peff
Previous: Andreas KreyNext: Andreas Krey
Message 4 of 6 in “cherry-pick --message?”
  1. Andreas KreyMar 21, 2017
  2. Jeff KingMar 21, 2017
  3. Andreas KreyMar 21, 2017
  4. Jeff KingMar 21, 2017
  5. Andreas KreyMar 28, 2017
  6. Jonathan NiederMar 28, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.