jedbrown / git-fat

Simple way to handle fat files without committing them to git, supports synchronization using rsync
BSD 2-Clause "Simplified" License
621 stars 137 forks source link

git fat doesn't properly track the running out of git repo #45

Closed slavkoja closed 10 years ago

slavkoja commented 10 years ago

Hi, while testing the git-fat, i run:

git fat

out of git tree, to i can see usage message, but i get this ugly exception traceback:

git fat
fatal: Not a git repository (or any parent up to mount point /home)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Traceback (most recent call last):
  File "/usr/local/bin/git-fat", line 581, in <module>
    fat = GitFat()
  File "/usr/local/bin/git-fat", line 125, in __init__
    self.gitroot = subprocess.check_output('git rev-parse --show-toplevel'.split()).strip()
  File "/usr/lib/python2.7/subprocess.py", line 573, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['git', 'rev-parse', '--show-toplevel']' returned non-zero exit status 128

I am not sure, if raising the exception is good solution in this case.

regards

slavkoja commented 10 years ago

Simmilar exception i get when i run:

git fat status

in empty (nothing commited yet) working tree:

git fat status
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Traceback (most recent call last):
  File "/usr/local/bin/git-fat", line 590, in <module>
    fat.cmd_status(sys.argv[2:])
  File "/usr/local/bin/git-fat", line 360, in cmd_status
    referenced = self.referenced_objects(**refargs)
  File "/usr/local/bin/git-fat", line 296, in referenced_objects
    rev = self.revparse('HEAD')
  File "/usr/local/bin/git-fat", line 177, in revparse
    return subprocess.check_output(['git', 'rev-parse', revname]).strip()
  File "/usr/lib/python2.7/subprocess.py", line 573, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['git', 'rev-parse', 'HEAD']' returned non-zero exit status 128