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

Run with a worktree #1718

Open
benjaminjkraft opened this issue May 7, 2024 · 0 comments
Open

Run with a worktree #1718

benjaminjkraft opened this issue May 7, 2024 · 0 comments

Comments

@benjaminjkraft
Copy link

We are using this action in a large repository (with a blobless clone to keep things efficient). We've found that in many cases the slowest step is actually the git clean! (It often takes 30-60s, whereas the actual fetch can be as fast as 15s, and the checkout 5-10s.) We don't want to skip that entirely -- who knows what mess the last job left in the repo.

What I'm thinking we should do is to have our jobs share a git directory, but run in a fresh worktree. This would make the checkout a bit slower (more files to write) but save the clean entirely (and perhaps make the fetch faster too, if it means we can share the git directory more aggressively than we can share a checkout).

So: I'd love to see this action able to run in that style! I can't imagine we're the only ones who have such needs. Is that something y'all would be open to as an option?

I'm thinking it would look something like this (although I'm very flexible on the details):

  • a config option to point at the shared git directory, which if set makes the checkout a worktree of that git directory
  • setup would run git worktree add instead of git clone (TBD: what if the worktree already exists?)
  • cleanup would run git worktree remove
  • most other things work fine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant