Skip to content
This repository has been archived by the owner on Aug 15, 2022. It is now read-only.

Latest commit

 

History

History
22 lines (11 loc) · 1.49 KB

NOTES.md

File metadata and controls

22 lines (11 loc) · 1.49 KB

#Notes

I found some interesting facts when developing this, here they are.

##Git and standard error

Git (even in version 2.6.0) does not get along with the standard error and sends any kind of unpredictable output to it. Since check-repo executes git commands (via subprocess), it needs to handle git errors so the user knows what happened. Since just checking stdrr is not enough, a naive helper function checks for the keyword 'fatal' in the standard error to raise a Python Exception.

Right now, it works. Since the most common error is to run git commands on a directory that does not have a git repository, hopefully this will also catch some other 'fatal' errors.

##On checking git history

As it is mentioned on the README file, checking only at the differences between commits is faster than checking out each commit. To check such differences, the library relies on git diff, which introduces a couple limitations and design caveats, such limitations are explained below.

###git diff and extensions

###git diff and file size

###git diff and binary files

By default, git diff does not show changes in binary files. That make things easier since we do not need to check if the file we are dealing with is binary before applying the regular expressions. However, what git interprets as a binary file depends on your configuration. That being said, check-repo will not look at binary files and will only print a warning.