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

git step caches should act as proper reference repositories #61

Open
rtyler opened this issue Dec 1, 2020 · 0 comments
Open

git step caches should act as proper reference repositories #61

rtyler opened this issue Dec 1, 2020 · 0 comments
Labels
component/stdlib Step standard library issues good first issue Good for newcomers

Comments

@rtyler
Copy link
Owner

rtyler commented Dec 1, 2020

Right now the git step is doing some funny business to cache git repositories on the agent. The git2 crate which is itself based on libgit2 doesn't overtly support using a reference repository on the clone operation.

After some discussion in #libgit2, there's potentially a workaround:

13:26:00 rtyler | my understanding for cloning with a reference repository is that the reference is used primarily, and then the "upstream" repo 
                | is the alternate (to use this parlance)
13:27:55 qyliss | I'm not sure                                                                                                       
13:28:00 qyliss | but should be easy to test                                                                                          
13:30:41 qyliss | rtyler: it looks like the odb is a property of the repository                                                          
13:30:50 qyliss | see here: https://libgit2.org/libgit2/#HEAD/group/repository/git_repository_odb                                     
13:31:22 qyliss | so I think what you'd want to do is make an empty repository, set up your remote, get the odb, set up your alternate, and then
                | fetch
13:31:36 qyliss | I think in this case the alternate would be the other local repository.                                             
13:31:45 rtyler | yeah that makes sense                       

For this issue, first need to validate the experimental approach of:

  • Create bare repository
  • Add remote
  • Get odb
  • set up alternate(s)
  • fetch

If that actually works, replacing the clone() function in stdlib/git should be relatively straightforward.

@rtyler rtyler added component/stdlib Step standard library issues good first issue Good for newcomers labels Dec 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/stdlib Step standard library issues good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant