Re: Support for a series of patches, i.e. patchset or changeset?
- From
Michael J Gruber <git@drmicha.warpmail.net>
- Date
- Nov 5, 2012, 13:39 UTC
- Message-ID
- <5097C190.80406@drmicha.warpmail.net>
- In-Reply-To
- <CAMPhdO_33CPJv2hAvPuJ10KZ7v_fgP9P2kV_WLVK2tapjQQ5=A@mail.gmail.com>
Eric Miao venit, vidit, dixit 05.11.2012 03:26:
Show 12 quoted lines
> Hi All, > > Does anyone know if git has sort of support for a series of patches, i.e. > a patchset or changeset? So whenever we know the SHA1 id of a single > patch/commit, we know the patchset it belongs to. This is normal when > we do big changes and split that into smaller pieces and doing only one > simple thing in a single commit. > > This will be especially useful when tracking and cherry-picking changes, > i.e. monitoring on the changes of some specific files, and if a specific > patch is interesting, we may want to apply the whole changeset, not only > that specific one.
First of all, if you know the sha1 of a commit, then all its ancestors are determined by that. If you want to describe a set of patches, say based on rev1 and leading up to rev2, then the expression
rev2 ^rev1
describes that set uniquely. Often you can do without ^rev1, e.g. if you know that all patch series are developed bases on origin/master, then specifying rev2 is enough as "git rev-list rev2 ^origin/master" will give you all commits in the series (unless they have been integrated, i.e. merged).
Or are you thinking about patches "independent" of a base?
Cheers, Michael