git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robin Rosenberg <robin.rosenberg.lists@dewire.com>
To: "Shawn O. Pearce" <spearce@spearce.org>
Cc: Nigel Magnay <nigel.magnay@gmail.com>, Git ML <git@vger.kernel.org>
Subject: Re: [PATCH JGIT] Minor : Make ObjectId, RemoteConfig Serializable
Date: Sun, 8 Feb 2009 20:45:22 +0100	[thread overview]
Message-ID: <200902082045.22703.robin.rosenberg.lists@dewire.com> (raw)
In-Reply-To: <20090208191024.GA30557@spearce.org>

söndag 08 februari 2009 20:10:24 skrev Shawn O. Pearce:
> Nigel Magnay <nigel.magnay@gmail.com> wrote:
> > > A problem (big problem) with serialization is that it often leads to
> > > fragile interfaces. One might want to have precise control over
> > > the serialization so a change in the implementation doesn't affect
> > > compatibility. Serializing AnyObjectId should not depend on the
> > > implementation de jour. Second, how do we handle subclasses?
> > >
> > > But maybe leaving it this way would be our way of saying that
> > > the interface may break at any time, promise.
> > 
> > Well, we can of course implement writeObject / readObject (or do so
> > if/when compatibility breaks, and it's cared about)
> > 
> > That's how I tend to view it anyway (may break at any time) - you
> > can't just update a jar library to a significantly new version and
> > expect it all to stay compatible. Also for half my use, it's not for
> > persistence, it's for transferring over the wire to a slave process.

Over-the wire has the same issue. Clients and servers often run with
slightly different versions.

> > Thinking a bit more clearly, I probably don't need AnyObjectId, just
> > ObjectId - but I've also missed RefSpec and URIish as they're used in
> > RemoteConfig..
> 
> Here's my two cents... we can do this, but only if we implement
> Externalizable and do the read and write ourselves so we have a
> stable format.

> In the case of any of the types you are discussing there is an easy
> canonical form for them to be written on the wire, or to read back:
> 
>   ObjectId     - the 20 byte SHA-1
>   RefSpec      - the string form as it appears in the config file
>   URIish       - the string form as it appears in the config file
with our without the password?

>   RemoteConfig - a map of keys/values as it appears in the config

I lean toward the do it correctly side too. Don't forget a few test cases
with pre-recorded serializations to verify compatibility over different
versions of jgit.

-- robin

  reply	other threads:[~2009-02-08 19:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <320075ff0902060702n7573aaecu9054626ee9a6991@mail.gmail.com>
2009-02-06 21:15 ` [PATCH JGIT] Minor : Make ObjectId, RemoteConfig Serializable Nigel Magnay
2009-02-08  2:13   ` Robin Rosenberg
2009-02-08 13:26     ` Nigel Magnay
2009-02-08 19:10       ` Shawn O. Pearce
2009-02-08 19:45         ` Robin Rosenberg [this message]
2009-02-08 19:47           ` 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=200902082045.22703.robin.rosenberg.lists@dewire.com \
    --to=robin.rosenberg.lists@dewire.com \
    --cc=git@vger.kernel.org \
    --cc=nigel.magnay@gmail.com \
    --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).