From: Jeff King <peff@peff.net>
To: Eric Miao <eric.y.miao@gmail.com>
Cc: Michael J Gruber <git@drmicha.warpmail.net>, git@vger.kernel.org
Subject: Re: Support for a series of patches, i.e. patchset or changeset?
Date: Thu, 8 Nov 2012 14:09:44 -0500 [thread overview]
Message-ID: <20121108190944.GO15560@sigill.intra.peff.net> (raw)
In-Reply-To: <CAMPhdO-Z3E352KbTvnrxJqCecAUGfHCwOoFRUKzObh35uLnrSw@mail.gmail.com>
On Tue, Nov 06, 2012 at 08:58:35AM +0800, Eric Miao wrote:
> > So, then the question is: What do you know/have? Is your patch the
> > output of "git format-patch", "git diff", or just some sort of diff
> > without any git information?
>
> That doesn't matter, all the info can be obtained from the SHA1 id, the
> question is: do we have a mechanism in git (or hopefully we could add)
> to record the patchset or series the patch belongs to, without people to
> guess heuristically.
>
> E.g. when we merged a series of patches:
>
> [PATCH 00/08]
> [PATCH 01/08]
> ...
> [PATCH 08/08]
>
> How do we know this whole series after merged when only one of these
> commits are known?
Others have described how you can infer this structure from the history
graph, but as you noted, the graph does not always match the series that
was sent, nor does it contain some of the meta information about the
cover letter, associated discussions, etc.
If you want to track the mapping between mailed patches (or any other
form of changeset id) to commits, you can put it in git in one of two
places:
1. In a pseudo-header at the end of the commit message. E.g., you
could use the message-id of the cover letter as a unique identifier
for the changeset, and put "Changeset: $MID" at the end of each
commit message. Then you can use "--grep" to find other entries
from the same changeset.
2. You can use git-notes to store the same information outside of the
commit message. This doesn't get pushed around automatically with
the history, but it means your commit messages are not polluted,
and you can make annotations after the commits are set in stone.
I do not use Gerrit, but I recall that they do something like (1) to
mark changesets. For git development, one of the contributors does (2)
to point notes at mailing list threads (I think he uses a script to
match up mails and commits after the fact).
But fundamentally the idea of "this is a set of logical changes" is not
represented in git's DAG. It's up to you to store changeset tokens
if you care about them.
-Peff
next prev parent reply other threads:[~2012-11-08 19:10 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-05 2:26 Support for a series of patches, i.e. patchset or changeset? Eric Miao
2012-11-05 13:39 ` Michael J Gruber
2012-11-05 14:12 ` Eric Miao
2012-11-05 14:40 ` Michael J Gruber
2012-11-06 0:58 ` Eric Miao
2012-11-06 6:39 ` Johannes Sixt
2012-11-06 6:56 ` Eric Miao
2012-11-06 7:44 ` Johannes Sixt
2012-11-07 1:50 ` Eric Miao
2012-11-08 19:09 ` Jeff King [this message]
2012-11-09 2:14 ` Eric Miao
2012-11-10 8:52 ` Enrico Weigelt
2012-11-10 9:08 ` Eric Miao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121108190944.GO15560@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=eric.y.miao@gmail.com \
--cc=git@drmicha.warpmail.net \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).