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

Re: git-cherry-pick(1) -- path

From
ACAlejandro Colomar <alx@kernel.org>
Date
May 10, 2024, 09:05 UTC
Message-ID
<kk244kap6lhuvtfot55u4yb5k5eddwlzl4izlzqhe4pdj52cx7@slghmpvdswkt>
In-Reply-To
<xmqqv83mqxg3.fsf@gitster.g>
Hi Junio,
On Thu, May 09, 2024 at 06:15:24PM GMT, Junio C Hamano wrote:
Show 14 quoted lines
> Alejandro Colomar <alx@kernel.org> writes:
> 
> > I'd be interested in being able to partially cherry-pick commits, based
> > on a path filter (similar to how many other git(1) commands behave with
> > -- path).
> >
> > Do you have any opinions on that?
> 
> Opinions?  
> 
> Personally it is a "Meh" for me, because I would instead do
> 
>     $ git format-patch --stdout -1 $ThatCommit -- $ThisPath |
>       git am -3
Hmmm, I hadn't thought of that; very interesting!

Although I have some concerns with git-am(1); basically that it's almost clueless when there's a conflict. With git-cherry-pick(1), at least I have the ability to resolve the conflict manually.

If I find some time, I'll check if I can program that (although it would be the first time I do some contribution like that to git(1), so I may need some help). :-)

Have a lovely day! Alex

Show 7 quoted lines
> which would be mostly sufficient for my purpose, but I do not see
> any fundamental reason why it should not exist.
> 
> It is already well known that future merges from the same branch
> will have to deal with duplicated changes brought in by picking
> commits with "git cherry-pick".  Having a pathspec-limited variant
> of "git cherry-pick" would not make the world a worse place.
-- 
<https://www.alejandro-colomar.es/>
Previous: Junio C HamanoNext: Phillip Wood
Message 3 of 10 in “git-cherry-pick(1) -- path”
  1. Alejandro ColomarMay 9, 2024
  2. Junio C HamanoMay 10, 2024
  3. Alejandro ColomarMay 10, 2024
  4. Phillip WoodMay 10, 2024
  5. Junio C HamanoMay 10, 2024
  6. Alejandro ColomarMay 11, 2024
  7. Phillip WoodMay 11, 2024
  8. Alejandro ColomarMay 11, 2024
  9. Alejandro ColomarMay 12, 2024
  10. Phillip WoodMay 13, 2024

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.