From: "Shawn O. Pearce" <spearce@spearce.org>
To: demerphq <demerphq@gmail.com>
Cc: Nicolas Pitre <nico@fluxnic.net>, git <git@vger.kernel.org>
Subject: Re: extra headers in commit objects
Date: Wed, 3 Feb 2010 11:26:12 -0800 [thread overview]
Message-ID: <20100203192612.GD14799@spearce.org> (raw)
In-Reply-To: <9b18b3111002031101p3385ecdfo638433bc269791aa@mail.gmail.com>
demerphq <demerphq@gmail.com> wrote:
> On 3 February 2010 19:15, Nicolas Pitre <nico@fluxnic.net> wrote:
> > On Wed, 3 Feb 2010, Shawn O. Pearce wrote:
> >
> >> Am I correct that core C developers are still under the opinion
> >> that extra headers in a commit object aren't encouraged?
> >
> > I would say so.
> >
> > [...]
> >> At the end of the day, is it a bug that C git doesn't support
> >> working with extra commit headers? ?IMHO, no, because, we've
> >> rejected these in the past, and its not part of the Git standard.
> >> And other implementations shouldn't be trying to sell it that way.
> >
> > Agreed. ?And this was discussed in great length on this list on few
> > occasions already (probably more than a year back).
>
> One problem, is that if you take the approach you say then you
> basically guarantee that a new git that DOES add new headers will
> break an old git that doesnt know about the headers, and actually
> doesnt care about them either.
As I understand it, the current stance is:
1) A compliant Git implementation ignores any headers it doesn't
recognize that appear *after* the optional "encoding" header.
2) A compliant Git implementation does not produce any additional
headers in a commit object, because other implementations cannot
perform any machine based reasoning on them.
3) All implementations would (eventually) treat all headers equally,
that is they all understand what author, committer, encoding are
and process them the same way. Any new headers should equally
be fully cross-implementation.
> So it would essentially mean that if you ever have to change the
> commit format you will be in a position where new git commits will be
> incompatible by design with old git commits.
So, we can change the format by adding a new header, after the
optional "encoding" header.
But such a change needs to be something that an older Git will
safely ignore (due to rule 1), and something that a newer Git can
make really effective use of (due to rule 2 and 3). And that newer
Git must also safely deal with commits missing that new header, due
to the huge number of commits out in the wild without said header.
And don't even get me started on amending commits with new unknown
headers. Existing implementions of Git tools will drop the extra
headers during the amend, because the headers are viewed as part
of the commit object data... and during an amend you are making a
totally new object.
For example, git-gui would drop any extra headers during an amend,
because its running `git commit-tree` directly without any way to
tell commit-tree this is for an amend of an existing commit, vs. a
completely new commit... because either way its a new commit object.
> Shouldn't an old git just ignore headers from a new git?
Yes, see above.
--
Shawn.
next prev parent reply other threads:[~2010-02-03 19:26 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-03 17:40 extra headers in commit objects Shawn O. Pearce
2010-02-03 18:15 ` Nicolas Pitre
2010-02-03 19:01 ` demerphq
2010-02-03 19:26 ` Shawn O. Pearce [this message]
2010-02-03 19:40 ` demerphq
2010-02-03 20:42 ` Junio C Hamano
2010-02-03 21:04 ` Shawn O. Pearce
2010-02-04 0:38 ` Junio C Hamano
2010-02-04 0:41 ` A Large Angry SCM
2010-02-03 19:26 ` Petr Baudis
2010-02-03 19:43 ` demerphq
2010-02-03 20:31 ` Shawn O. Pearce
2010-02-03 20:03 ` Nicolas Pitre
2010-02-03 19:53 ` Sverre Rabbelier
2010-02-03 19:58 ` Scott Chacon
2010-02-03 22:48 ` Shawn O. Pearce
2010-02-04 6:24 ` Mike Hommey
2010-02-03 20:58 ` Jelmer Vernooij
2010-02-03 21:17 ` Nicolas Pitre
2010-02-03 22:39 ` Shawn O. Pearce
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=20100203192612.GD14799@spearce.org \
--to=spearce@spearce.org \
--cc=demerphq@gmail.com \
--cc=git@vger.kernel.org \
--cc=nico@fluxnic.net \
/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).