git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: demerphq <demerphq@gmail.com>
To: "Shawn O. Pearce" <spearce@spearce.org>
Cc: Nicolas Pitre <nico@fluxnic.net>, git <git@vger.kernel.org>
Subject: Re: extra headers in commit objects
Date: Wed, 3 Feb 2010 20:40:17 +0100	[thread overview]
Message-ID: <9b18b3111002031140u66acfebbu9e398a600cbcabaa@mail.gmail.com> (raw)
In-Reply-To: <20100203192612.GD14799@spearce.org>

On 3 February 2010 20:26, Shawn O. Pearce <spearce@spearce.org> wrote:
> 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.

Ignores but passes through?

> 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.

Right, which seems to sum to up to "that boat sailed, forget about
it", which is fair enough.

Which I say from the point of view of arbitrary headers not approved
by the git dev team. You can ensure that any new *approved* headers
have the semantics that "if they arent passed through it doesnt
matter", whereas you cant know whether a header should be passed
through or not that comes from some other source.

Well unless you introduced a convention that some header prefix is to
be preserved on amend, but other prefixes shouldnt be.

I can imagine that might be a nasty place to go tho. :-)

Anyway, thanks a lot for taking the time to explain this a bit more.

cheers,
Yves





-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

  reply	other threads:[~2010-02-03 19:40 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
2010-02-03 19:40       ` demerphq [this message]
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=9b18b3111002031140u66acfebbu9e398a600cbcabaa@mail.gmail.com \
    --to=demerphq@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=nico@fluxnic.net \
    --cc=spearce@spearce.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).