#Hey Erik, `git status` needs to read
1 messages · Page 1 of 1 (latest)
This optimization is doable, but the more I get my hands dirty, the more it seems creating a very focused "version" module that gets away from the dagger world
That was my concern too, but tbh I'd be okay with it as an intermediate step because the transfering of 100s of MBs of data that is not technically really needed makes building the engine w/ PARC so incredibly painful
git status needs to read the HEAD commit object, which in CI fresh clones only exists inside the pack files we're excluding (getting a loot of errors).
Which git status call? I was able to avoid all the errors in the diff I commented with
For the longer term, I do wonder if we should just bite the bullet and support running some read-only git ops on the client-side through session attachables. I'd be especially okay with that approach if we could do it w/out a client-side dep on git being installed, which would require there to be a go library that supports the ops we need. e.g. a go library that can tell us whether the filesystem has dirty changes w/out shelling out to the git cli
I'd love that !
I know that Alex pinged recently an alternative which is faster
retesting one last time, i might have made a mistake
Ok sorry, confirmed the behavior.
Your patch seems to work locally but fails in CI because of how git stores objects:
- Locally: We have loose objects (from commits, git add, etc.) in objects/xx/ directories. Git can resolve HEAD → commit → tree.
- CI fresh clone: ALL objects are in pack files only. No loose objects exist.
When we exclude objects/pack/, git status fails with "fatal: bad object HEAD" because it can't read the commit object to compare against the working tree.
The Dirty() function mounts .git without pack files, then runs git status, which needs to dereference HEAD to a tree
Ah okay, that makes sense! Yeah maybe the route of adding a session attachable for querying git status w/out pulling the whole thing is the better route, honestly might not be all that bad?
We could dumbify the dirty method ...