Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
git fat checkout / git fat pull: Print digest of restored filenames t…
…oo in verbose mode.
  • Loading branch information
purdeaandrei committed Jul 13, 2015
commit 8449d4aaf456ff9c2a3ed2e648b4403853e86e7f
12 changes: 9 additions & 3 deletions git-fat
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ def gitconfig_set(name, value, file=None):
class GitFat(object):
DecodeError = RuntimeError
def __init__(self):
self.verbose = verbose_stderr if os.environ.get('GIT_FAT_VERBOSE') else verbose_ignore
self.is_verbose = os.environ.get('GIT_FAT_VERBOSE')
self.verbose = verbose_stderr if self.is_verbose else verbose_ignore
try:
self.gitroot = subprocess.check_output('git rev-parse --show-toplevel'.split()).strip()
except subprocess.CalledProcessError:
Expand Down Expand Up @@ -422,8 +423,13 @@ class GitFat(object):

filenames_str = "\n".join(filenames_to_restore) + "\n"

print('Restoring %d Files' % (len(filenames_to_restore),))
self.verbose(filenames_str)
if not self.is_verbose:
print('Restoring %d Files' % (len(filenames_to_restore),))
else:
print('Restoring %d Files:' % (len(filenames_to_restore),))
for digest, fname, accessible in orphan_files_is_accessible:
if accessible:
print('%s: %s' % (digest, fname))

if filenames_to_restore:
# This re-smudge is essentially a copy that restores permissions.
Expand Down