#Hey Erik, `git status` needs to read

1 messages · Page 1 of 1 (latest)

cold granite
#

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

cold granite
# cold granite > This optimization is doable, but the more I get my hands dirty, the more it se...

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

cold granite
torn dirge
#

I know that Alex pinged recently an alternative which is faster

torn dirge
torn dirge
# cold granite > This optimization is doable, but the more I get my hands dirty, the more it se...

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

cold granite
torn dirge
#

We could dumbify the dirty method ...