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:00 UTC
Message-ID
<20170321170005.35ryjh4pr3jvvmx3@sigill.intra.peff.net>
In-Reply-To
<20170321160520.GA15550@inner.h.apk.li>
On Tue, Mar 21, 2017 at 05:05:20PM +0100, Andreas Krey wrote:
Show 13 quoted lines
> Hi all,
> 
> I have an slightly unusual usecase for cherry-pick:
> I want to modify the commit message that is used in the process,
> e.g. do an d/^PROP:/ on it, but unfortunately -m does something
> else here.
> 
> And there is no --message here for good reason, as cherry-pick
> can pick multiple commits and so on. Bad for me, though.
> 
> So, am I down to the combo of format-patch and apply, or is there
> an easier way? (I'd also like to end up in the same state as with
> cherry-pick should there be conflicts.)
There's "cherry-pick --edit".

I had to look it up, though. For a single message I'd have probably done "git cherry-pick $commit && git commit --amend". For multiple I'd just cherry-pick them all first, then follow-up with "git rebase -i".

-Peff
Previous: Andreas KreyNext: Andreas Krey
Message 2 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.