Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clearly notify about errors when pulling of fat files failed #32

Open
cztomczak opened this issue Jan 9, 2015 · 3 comments
Open

Clearly notify about errors when pulling of fat files failed #32

cztomczak opened this issue Jan 9, 2015 · 3 comments
Labels

Comments

@cztomczak
Copy link

Here are the logs from when cloning repository (which executes git fat pull command via git hook):

Cloning into 'cybase2'...
Updating git-fat files
ERROR:git_fat.py: Downloaded digest (e1843ad87b38b6f6e3c150bc6222121cb249c228) did not match stored digest for orphan: 2f3a61fe9c5306cbdc2d6da61863364c0c9492dd
ERROR:git_fat.py: Downloaded digest (86cbba2f1cf234401faa00b4533299da1e28381b) did not match stored digest for orphan: 5a34ddf19d37c741f74652ee847df9568a8b81e1
Setting filters in .git/config
Creating .git/fat/objects
Initialized git-fat
Downloading: c292cd45b51e29c558c4d9cacf93c4616ed738b9
Downloading: ad428fc9cefeb8219712bcceaf96d622f8593b56
Downloading: 54ffad3aa1a02719dad48c6a85a71015304f034e
Downloading: dffdffcfc4c508a528d438f71a05093a8a842ea5
Downloading: 3c1592e3d3cadd8a72127e520b106536feb9ab74
Downloading: e7535e1de394549a6facd6a1e44d64c72a43bf8e
Downloading: c4f6dd16f8f4d81396371c8b08f2eab9956467ee
Downloading: 3f73ff9231a1c15e28e6e259ef5cc35a72b34059
Downloading: ace563563a8f6f367ba82236e5bea240adea0d94
Downloading: 18982edc236a1d87e4eef018928358c925aa5b17
Downloading: f4427f241652dd656be856fa96b8ae8f390935ab
.... 100 morefiles ...

The error messages are displayed at the very top due to issues with flushing output buffer. After downloading 100 files you don't see no error messages when git fat pull completes. Files are not restored and cloning really failed. There is no clear indication whether git fat pull succeeded or failed.

There are two issues:

  1. At the end of git fat pull function, if downloading of any files failed there should be displayed an error message like: "ERROR: git fat pull failed.. failed to download 3 files. Restoring of files was aborted.".
  2. Order of log messages is wrong, there are problems with flushing the buffer. The "Downloading..." messages are displayed using the print() function, while the error messages are displayed using logger.error(). This is causing the wrong order of log messages. Using logger.info() instead of print() should fix the issue.

Currently you see:

ERROR:git_fat.py: Downloaded digest (86cbba2f1cf234401faa00b4533299da1e28381b) did not match stored digest for orphan: 5a34ddf19d37c741f74652ee847df9568a8b81e1
Initialized git-fat
Downloading: c292cd45b51e29c558c4d9cacf93c4616ed738b9
Downloading: ad428fc9cefeb8219712bcceaf96d622f8593b56
Downloading: 54ffad3aa1a02719dad48c6a85a71015304f034e

But instead I think it should be:

Initialized git-fat
Downloading: c292cd45b51e29c558c4d9cacf93c4616ed738b9
Downloading: ad428fc9cefeb8219712bcceaf96d622f8593b56
ERROR:git_fat.py: Downloaded digest (86cbba2f1cf234401faa00b4533299da1e28381b) did not match stored digest for orphan: 5a34ddf19d37c741f74652ee847df9568a8b81e1
Downloading: 54ffad3aa1a02719dad48c6a85a71015304f034e
@abraithwaite
Copy link

I agree with this. I've wanted to consolidate error handling when I moved to a single backend interface but I never got around to it.

@justinclift
Copy link

@CzarekTomczak Want to do a Pull Request with the fix(es)?

@cztomczak
Copy link
Author

@justinclift Not right now. Later, maybe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants