You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is this essentially "contextual git repo" arguments?
Here's my suggestion:
We extend // +defaultPath=<path> to allow annotating dagger.Git args. The path in this case becomes a path to a .git directory (or maybe to a directory containing a .git directory).
We extend // +defaultPath=<path> to allow annotating dagger.GitRef args. The path in this case becomes a path to a checkout of a directory.
Then, we modify the core Git type - the default implementation is still created from the dag.Git query, but we also allow sourcing it from the client automatically using a session attachable.
While we're here, we could also allow creating a git directory using Directory.AsGit.
We extend the Git API to allow getting better information about the current commit/branch/tags, working out dirtiness, remotes, etc.
We need to be careful though, and make sure that this behaves the same as the contextual directory - i.e. loading from the callee. When I get a contextual git repo, I want the repo for the callee. But need to think through this - I think it's a much less common use case, the common case is going to be things like our suggestion version module.
Design still up in the air, but essentially you'll get back a Git type in the API - whatever you can do with that, you can do with the current git context.
I don't think diff will directly be supported - but you'll still be able to call Git.tree and then mount it into a container with git installed to do the operation yourself. We'll see 🎉
Activity
jedevc commentedon Sep 23, 2024
Is this essentially "contextual git repo" arguments?
Here's my suggestion:
// +defaultPath=<path>to allow annotatingdagger.Gitargs. Thepathin this case becomes a path to a.gitdirectory (or maybe to a directory containing a.gitdirectory).// +defaultPath=<path>to allow annotatingdagger.GitRefargs. Thepathin this case becomes a path to a checkout of a directory.dag.Gitquery, but we also allow sourcing it from the client automatically using a session attachable.Directory.AsGit.We need to be careful though, and make sure that this behaves the same as the contextual directory - i.e. loading from the callee. When I get a contextual git repo, I want the repo for the callee. But need to think through this - I think it's a much less common use case, the common case is going to be things like our suggestion
versionmodule.shykes commentedon Dec 6, 2024
@jedevc did I understand correctly that you're working on this? If so, I'll assign so you can take it over
beingminimal commentedon Dec 10, 2024
@jedevc git diff command will be supported?
jedevc commentedon Dec 19, 2024
x-linking #8720 (which is related, because it establishes the concept of "git backends", which we'd use for this)
jedevc commentedon Dec 19, 2024
Design still up in the air, but essentially you'll get back a
Gittype in the API - whatever you can do with that, you can do with the current git context.I don't think
diffwill directly be supported - but you'll still be able to callGit.treeand then mount it into a container with git installed to do the operation yourself. We'll see 🎉