ciena-blueplanet / git-fat

Manage large binary files with git
BSD 2-Clause "Simplified" License
97 stars 20 forks source link

Committing binaries when executing git fat via python processor. #64

Open henrydobson opened 8 years ago

henrydobson commented 8 years ago

Hi guys,

git fat is commonly used in the macOS sys admin community and I'm working on a project that users a python processor to automatically git add, commit, fat push and regular push however git fat is seemingly being completely bypassed and the result is the newly added binaries are being committed.

Here's the project: https://github.com/henrydobson/ygini-recipes/tree/master/GitFatCommitAndPush

If I run the subprocess call commands directly in bash at the correct point in the workflow, git fat works perfectly. Not sure what I'm missing... Can you help?

H

abraithwaite commented 8 years ago

Would you happen to have your filter and hook configs available to share?

henrydobson commented 8 years ago

No hooks and here's my attributes file:

*.pkg filter=fat -crlf
*.mpkg filter=fat -crlf
*.dmg filter=fat -crlf
*.zip filter=fat -crlf
*.gz filter=fat -crlf
*.deb filter=fat -crlf
*.png filter=fat -crlf
abraithwaite commented 8 years ago

Okay, then we'll still need some more info.

Can you provide the git status of the repository and the logs of both situations (running from the python script vs shell) then another git status after each case?

henrydobson commented 8 years ago

Hi Alan,

So I hope this is all useful information... https://gist.github.com/henrydobson/6cbe3ef15341480ac2a4eae75819452e

I've included what you asked for using the following: git status git logs --stat -1 (post commit) git logs -p -1 -- (list of fat files) (post commit) Exports from Console for the AutoPkgr logs

If you need anything else, please let me know!

abraithwaite commented 8 years ago

This is an excellent log! Thanks!

However I forgot one thing. Can you export GIT_TRACE=1 before running those commands? It would be very helpful if you could set it for the Munki script as well. It'll tell us exactly what git commands are being run.

Sorry for the extra hassle.

henrydobson commented 8 years ago

No problem!

I've revised the original and put the output whilst GIT_TRACE=1 at the top.

https://gist.github.com/henrydobson/6cbe3ef15341480ac2a4eae75819452e

Edit: I realised I had forgotten to alter the processor to collect the trace output... and that's the important bit! As you can see from the logs, git-fat is not found. I can confirm that if the PATH is managed to add git-fat's parent directory, the processor works!

abraithwaite commented 8 years ago

The only thing I can think of at this point is the git that Munki is using is different from your system git. It doesn't look like the GIT_TRACE environment variable made it into the context of the munki plugin either.

It's possible that the version of git that munki is using doesn't support git-filters yet. That's my best bet given the current information. If you can figure out a way to get that data, then we might be able to move forward.