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

From: Junio C Hamano <[email-masked]>
Date: Thu, 09 May 2024 18:15:24 -0700

Alejandro Colomar <[email-masked]> 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

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.