buzzfeed / caliendo

caliendo
MIT License
16 stars 5 forks source link

Automagically flag cachefiles as binary #51

Closed akellehe closed 10 years ago

akellehe commented 10 years ago

The cachefiles generated by caliendo should be added to .gitattributes as binary so they are not displayed in diffs on github.

We'll need to locate the nearest .gitattributes, .gitignore, or .git file (in that order) from the CALIENDO_CACHE_PREFIX directory and append the cachefiles as they're named to .gitattributes if it exists. If it does not exist it should be created in the parent directory of .gitignore or .git. Cachefile names should be added to .gitattributes as they're added and removed as they're deleted.

This functionality should be added to the caliendo.db.flatfiles.purge method since the behavior is general upkeep, or a new method should be added to wrap both purge and the described functionality. Perhaps upkeep describes the nature of the task. Up to the developer.

galarant commented 10 years ago

the .gitattributes strategy will work with local difftools, but not with github

what we need to do instead is prepend a non-ascii byte code to the beginning of the file which will (probably) trick github into thinking it's binary. this should be tested in github before we definitely go with that implementation.

akellehe commented 10 years ago

Thanks for the research on this, Jeff. We'll implement this approach asap.