git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jon Seymour <jon.seymour@gmail.com>
To: Christian Meder <chris@absolutegiganten.org>
Cc: Jan Harkes <jaharkes@cs.cmu.edu>, git@vger.kernel.org
Subject: Re: First web interface and service API draft
Date: Sat, 23 Apr 2005 16:39:19 +1000	[thread overview]
Message-ID: <2cfc403205042223393a769e57@mail.gmail.com> (raw)
In-Reply-To: <1114203423.3207.24.camel@localhost>

On 4/23/05, Christian Meder <chris@absolutegiganten.org> wrote:
> On Fri, 2005-04-22 at 10:23 -0400, Jan Harkes wrote:
> > On Fri, Apr 22, 2005 at 12:41:56PM +0200, Christian Meder wrote:
> > > -------
> > > /<project>/blob/<blob-sha1>
> > > /<project>/commit/<commit-sha1>
> >
> > It is trivial to find an object when given a sha, but to know the object
> > type you'd have to decompress it and check inside. Also the way git
> > stores these things you can't have both a blob and a commit with the
> > same sha anyways.
> >
> > So why not use,
> >     /<project/<hexadecimal sha1 representation>
> >       will give you the raw object.
> 
> Hmm. I'm not sure about throwing away the <objecttype> information in
> the url. I think I'd prefer to retain the blob, tree and commit
> namespaces because I think they help API users to explicitly state what
> kind of object they expect. I can't think of a scenario where I'd want a
> <sha1> of unknown type. Do you have a specific use case in mind ?
> 

I was initially inclined to agree with Jan, but on brief reflection I
think Christian is correct to want to preserve the type info in the
URI. There are numerous reasons why this is a good idea:

- both carbon and silicon users of the URI who don't have direct
access to the repository can infer what the URI refers to without
actually fetching it

- programmatically the web server can make request routing decisions
based on the URI alone and is not forced to perfom a relatively
expensive and unnecessary db hit to derive the type.

That said, I can see some value in providing a web-based
type-resolution service.

So, given a URI of the form

     /<project>/object/<hexadecimal sha1 representation>

the server should resolve the type of the named object and issue an
HTTP re-direct to the typed URI, e.g.

     /<project>/blob/<hexadecimal sha1 representation>

Because browsers tend not to remember redirection sources, external
entities end up recording the typed URIs, but all the benefits of
Jan's suggestion still accrue.

jon.
-- 
homepage: http://www.zeta.org.au/~jon/
blog: http://orwelliantremors.blogspot.com/

  reply	other threads:[~2005-04-23  6:35 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-22 10:41 First web interface and service API draft Christian Meder
2005-04-22 11:34 ` Jon Seymour
2005-04-22 12:10   ` Petr Baudis
2005-04-22 12:27     ` Jon Seymour
2005-04-22 13:32       ` Christian Meder
2005-04-22 13:30     ` Christian Meder
2005-04-22 12:10 ` Petr Baudis
     [not found]   ` <1114176579.3233.42.camel@localhost>
2005-04-22 22:57     ` Petr Baudis
2005-04-24 22:29       ` Christian Meder
2005-04-22 12:37 ` El Draper
2005-04-22 13:44   ` Christian Meder
2005-04-22 13:47     ` Jon Seymour
2005-04-22 14:23 ` Jan Harkes
2005-04-22 20:57   ` Christian Meder
2005-04-23  6:39     ` Jon Seymour [this message]
2005-04-22 22:45   ` Petr Baudis

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2cfc403205042223393a769e57@mail.gmail.com \
    --to=jon.seymour@gmail.com \
    --cc=chris@absolutegiganten.org \
    --cc=git@vger.kernel.org \
    --cc=jaharkes@cs.cmu.edu \
    --cc=jon@zeta.org.au \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).