Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

josh _(just one simple history)_ #427

Open
11 of 12 tasks
Byron opened this issue May 24, 2022 · 2 comments
Open
11 of 12 tasks

josh _(just one simple history)_ #427

Byron opened this issue May 24, 2022 · 2 comments
Labels
C-integrate-gitoxide "Oxidize" crates even more by replacing git2 with gitoxide

Comments

@Byron
Copy link
Owner

Byron commented May 24, 2022

  • lookup references by name
  • http with authentication
  • init bare repository
  • open repository directly, without discovery
  • build a tree in memory (needs ability to obtain hashes, maybe with `sink()
    • make it nice to use
  • hash objects into memory
  • tree walking
  • walk commit graph
  • list references by glob
  • rev parsing (rev-spec)
  • find commits/trees by oid
  • a whole lot of commands are delegated to git CLI, that's fine

https://github.com/esrlabs/josh

Related PRs

@Byron Byron created this issue from a note in Collaboration Board (Oxidization) May 24, 2022
@Byron Byron added the C-integrate-gitoxide "Oxidize" crates even more by replacing git2 with gitoxide label May 24, 2022
@Byron Byron changed the title **josh** _(just one simple history)_ josh _(just one simple history)_ May 24, 2022
Byron added a commit that referenced this issue May 24, 2022
Byron added a commit that referenced this issue May 25, 2022
Byron added a commit that referenced this issue May 25, 2022
Byron added a commit that referenced this issue May 25, 2022
Byron added a commit that referenced this issue May 25, 2022
Also partially done with experimentation using `git rev-parse`.
Byron added a commit that referenced this issue May 25, 2022
Byron added a commit that referenced this issue May 25, 2022
Benefit of this is that the basic structure of the parser is setup
early.
Byron added a commit that referenced this issue May 25, 2022
Byron added a commit that referenced this issue May 26, 2022
more structure for tests
Byron added a commit that referenced this issue May 28, 2022
Byron added a commit that referenced this issue May 28, 2022
This will be useful for all methods/functions that want to take a
single spec only.

Whenever a range is set, even if no other actual revision is provided,
it indicates the input has different intentions than what we require.
Byron added a commit that referenced this issue May 29, 2022
Byron added a commit that referenced this issue May 29, 2022
Byron added a commit that referenced this issue May 29, 2022
Byron added a commit that referenced this issue May 29, 2022
Byron added a commit that referenced this issue May 29, 2022
Also partially done with experimentation using `git rev-parse`.
Byron added a commit that referenced this issue May 29, 2022
Byron added a commit that referenced this issue May 29, 2022
Benefit of this is that the basic structure of the parser is setup
early.
Byron added a commit that referenced this issue May 29, 2022
Byron added a commit that referenced this issue May 29, 2022
more structure for tests
Byron added a commit that referenced this issue May 29, 2022
Byron added a commit that referenced this issue May 29, 2022
This will be useful for all methods/functions that want to take a
single spec only.

Whenever a range is set, even if no other actual revision is provided,
it indicates the input has different intentions than what we require.
Byron added a commit that referenced this issue May 29, 2022
This is something for git-repository anyway, but it seems like
a lot of work for a rarely used feature and a big dependency which
might not ever be faithfully implemented as the regex engines will
probably differ.
Byron added a commit that referenced this issue Aug 2, 2022
Now only the lazy-load portion will double-check for a race to avoid
loading the resource multiple times if threads are very racy or
the resource loading takes time.

In other cases, which should occour more rarely, we assume what we saw
is still the case now.
Byron added a commit that referenced this issue Aug 2, 2022
Byron added a commit that referenced this issue Aug 2, 2022
Byron added a commit that referenced this issue Aug 2, 2022
Byron added a commit that referenced this issue Aug 2, 2022
Byron added a commit that referenced this issue Aug 2, 2022
Byron added a commit that referenced this issue Aug 2, 2022
Byron added a commit that referenced this issue Aug 2, 2022
Byron added a commit that referenced this issue Aug 2, 2022
What's nice is that it keeps track of the reference as well, which is
a benefit. It will also do its best to not fail if the branch doesn't
exist anymore but instead resorts to the id available in the reflog.
Byron added a commit that referenced this issue Aug 3, 2022
Byron added a commit that referenced this issue Aug 3, 2022
Byron added a commit that referenced this issue Aug 3, 2022
Byron added a commit that referenced this issue Aug 3, 2022
Byron added a commit that referenced this issue Aug 3, 2022
Byron added a commit that referenced this issue Aug 3, 2022
Byron added a commit that referenced this issue Aug 3, 2022
@vlad-ivanov-name
Copy link

Hello @Byron,

I'm one of contributors of josh-project/josh, and I wanted to comment a bit on the list of features you posted above.

Currently Josh uses two git implementations underneath - git and libgit2. Git is responsible for:

  • upstream interaction, such as fetch or push
  • repo init
  • serving repositories to the user

libgit2 is used to:

  • traverse commit graph
  • create new histories
  • perform other operations involving actual repo objects

While it would certainly be an improvement to use gitoxide as a drop-in git replacement and git-repository as a library, it would be much better if we could drop the whole concept of running a git subprocess completely, and only use git-repository as a library. So current design choices are not as much a result of choosing the best architecture, but are rather dictated by the available software libraries.

In a long-term perspective, here are some of the things we would need to implement in Josh to overcome existing git limitations:

  • make josh serve repositories itself, instead of relying on git-upload-pack / git-receive-pack / git-http-backend (issue Server-side of fetch/pull #307)
  • abstract away from storing object files and other data on the filesystem; use object storage (with cache) instead

So overall, we want to move away from running git CLI.

Btw -- if you're interested in more details on how Josh works internally, I dropped you a keybase message, the authors of the project will be more than happy to discuss it with you.

@Byron
Copy link
Owner Author

Byron commented Dec 27, 2022

Thanks for chiming in. It will probably be a while until gitoxide can serve all your needs, but if it helps, I will push hard towards a server implementation to be ready by the end of 2023. Your participation in the process should help to make it general enough to provide building blocks for josh as well.

About abstracting away the actual object storage, that should be possible as gitoxide already has a couple of traits to work with around writing objects and retrieving them, but at the moment one implementation of these is hard-coded. I don't have any plans yet to change this, but thanks to the layering of crates it should always be possible to re-use lower-level bits and pieces.

I replied to the keybase message so we can have a chat about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-integrate-gitoxide "Oxidize" crates even more by replacing git2 with gitoxide
Projects
Development

No branches or pull requests

2 participants