Skip to content

Commit

Permalink
BF: status - report annexed files even if no bytesize known
Browse files Browse the repository at this point in the history
Inspired by a fix we needed for push:
datalad#7049

I looked into status to realize that we do not even consider those files
for which git-annex would not report bytesize.  This commit makes them
considered in count but would assume 0 bytesize for "recorded" etc.

It would not address the issue that we would still not
consider/interrogate sizes for those files even if their content
available:

	$> datalad status --annex=all
	2 annex'd files (0.0 B/0.0 B present/total size)

	$> ls -lL *
	-r-------- 1 yoh yoh   0 Sep 20 15:52 123.dat
	-r-------- 1 yoh yoh 723 Sep 20 15:57 sample3.csv

where sample3.csv is the relaxed one.
  • Loading branch information
yarikoptic committed Jun 9, 2023
1 parent 7db210f commit 47199aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions datalad/core/local/status.py
Expand Up @@ -461,10 +461,10 @@ def custom_result_summary_renderer(results): # pragma: more cover
# fish out sizes of annexed files. those will only be present
# with --annex ...
annexed = [
(int(r['bytesize']), r.get('has_content', None))
(int(r.get('bytesize', 0)), r.get('has_content', None))
for r in results
if r.get('action', None) == 'status' \
and 'key' in r and 'bytesize' in r]
and 'key' in r]
if annexed:
have_availability = any(a[1] is not None for a in annexed)
total_size = bytes2human(sum(a[0] for a in annexed))
Expand Down

0 comments on commit 47199aa

Please sign in to comment.