git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Core and Not-So Core

From
Jon Seymour <jon.seymour@gmail.com>
Date
May 11, 2005, 21:09 UTC
Message-ID
<2cfc403205051114096117e62f@mail.gmail.com>
In-Reply-To
<2cfc403205051114087d283279@mail.gmail.com>
On 5/12/05, Daniel Barkalow <barkalow@iabervon.org> wrote:
Show 16 quoted lines
> On Wed, 11 May 2005, Jon Seymour wrote:
>
> > The repository API would contain functionality equivalent to cat-file,
> > ls-tree, most of fsck-cache, rev-list, rev-tree, diff-tree, most of
> > the transport code - things that don't involve use of the index.
> >
> > The workspace API would contain read-tree, write-tree, commit-tree,
> > etc - things that do involve use of the the index.
>
> Unfortunately for this idea, you can't actually check files into or out of
> the repository using the git tools without the index (in memory at least,
> if not on disk). This is a bit like having a libc with all the system
> calls except read and write. Sure, there are a number of programs that
> would be fine that way, but it makes the API unintuitive, and most serious
> programs need the extension anyway.
>
Daniel,

Checking in/checking out is definitely a workspace API function that involves an index (almost certainly) an on-disk index, but reading and writing from and to the repository is purely a repository API function.

There is no reason why the workspace API can't make use of "lower-level" functions in the repository API. I guess I would argue that the repository API really shouldn't need much, if any knowledge, of the workspace API.

The repository API knows about the on-disk structure of repository objects - it knows how to write writing compressed, SHA1 signed objects, it also knows how to pack and unpack the various object types from their on-disk representation into structures manipulated by the workspace API.

On the otherhand the workspace API knows about managing index (workspace) state. It knows how to determine whether the pre-conditions for a commit have been reached. It knows how to read the workspace structures and coordinate read and writes from and to the repository.

I really don't think this makes the API unintuitive, but then I don't really understand why you think this is the case.

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

Previous: Daniel Barkalow
Message 40 of 40 in “Core and Not-So Core”
  1. Jon SeymourMay 10, 2005
  2. David WoodhouseMay 10, 2005
  3. Eduardo Teixeira DiasMay 10, 2005
  4. David WoodhouseMay 10, 2005
  5. Eduardo Teixeira DiasMay 10, 2005
  6. Diego CallejaMay 10, 2005
  7. Eduardo Teixeira DiasMay 10, 2005
  8. Diego CallejaMay 10, 2005
  9. Eduardo Teixeira DiasMay 10, 2005
  10. Eduardo Teixeira DiasMay 10, 2005
  11. Petr BaudisMay 10, 2005
  12. Andreas GalMay 10, 2005
  13. James PurserMay 10, 2005
  14. Christoph HellwigMay 11, 2005
  15. Jon SeymourMay 11, 2005
  16. Jon SeymourMay 10, 2005
  17. David WoodhouseMay 10, 2005
  18. Daniel BarkalowMay 10, 2005
  19. Petr BaudisMay 10, 2005
  20. Jon SeymourMay 11, 2005
  21. Peter WilliamsMay 11, 2005
  22. Nicolas PitreMay 11, 2005
  23. Jon SeymourMay 11, 2005
  24. Noel GrandinMay 11, 2005
  25. Jon SeymourMay 11, 2005
  26. Juliusz ChroboczekMay 18, 2005
  27. Jon SeymourMay 10, 2005
  28. David WoodhouseMay 10, 2005
  29. Jon SeymourMay 10, 2005
  30. Christoph HellwigMay 10, 2005
  31. Rik van RielMay 11, 2005
  32. Jon SeymourMay 11, 2005
  33. Petr BaudisMay 11, 2005
  34. Jon SeymourMay 10, 2005
  35. Davide LibenziMay 10, 2005
  36. Jon SeymourMay 10, 2005
  37. Petr BaudisMay 10, 2005
  38. Jon SeymourMay 10, 2005
  39. Daniel BarkalowMay 11, 2005
  40. Jon SeymourMay 11, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.