Re: First web interface and service API draft
- From
- Christian Meder <chris@absolutegiganten.org>
- Date
- Apr 22, 2005, 20:57 UTC
- Message-ID
- <1114203423.3207.24.camel@localhost>
- In-Reply-To
- <20050422142342.GG30915@delft.aura.cs.cmu.edu>
On Fri, 2005-04-22 at 10:23 -0400, Jan Harkes wrote:
Show 23 quoted lines
> 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. > > /<project/<hexadecimal sha1 representation>.html (.xml/.txt) > will give you a parsed version for user presentation > > And since hexadecimal numbers only have [0-9a-f] as valid characters, > you can still have additional directories that can be guaranteed unique > as long as the first two characters are not a valid hexadecimal value. > So things like /branch/linus, or /changelog/, /log/, /diff/. Yeah, you > can't use /delta/ without looking at more than the first two characters, > but that's where dictionaries can come in handy.
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 ?
Christian
--
Christian Meder, email: chris@absolutegiganten.org
The Way-Seeking Mind of a tenzo is actualized
by rolling up your sleeves.
(Eihei Dogen Zenji)