HomeSoftware Heritage

Consider special files as empty ones when computing content hashes

Description

Consider special files as empty ones when computing content hashes

Closes T255
Ref. D179

Details

Auditors
zack
Provenance
ardumontAuthored on Feb 23 2017, 2:20 PM
ardumontPushed on Feb 23 2017, 3:49 PM
Parents
rDMODe0dbae331f22: identifiers: properly escape newlines in author specifications
Branches
Unknown
Tags
Unknown
Tasks
T255: Don't let swh.loader.dir block on special files (block devices, fifos)

Event Timeline

zack raised a concern with this commit.Feb 23 2017, 7:02 PM
zack added subscribers: olasd, zack.
zack added inline comments.
/swh/model/git.py
176–177

This test will consider "special" any symlink, hence (as I understand it) considering symlinks empty file.
Is that what we really want here?

cc: @ardumont , @olasd

/swh/model/git.py
156

here, the link function mentioned before.

176–177

Yes, if called directly.
No otherwise (our case).

Symlinks are treated in the compute_link_metadata function (line 129).
This function is called in os.walk context (here and in loader-svn) and the links are filtered before calling that function.

What's implied here is that there must be a filter on the link type prior to that function call.
This certainly need to be said in the docstring.

zack added inline comments.
/swh/model/git.py
176–177

Symlinks are treated in the compute_link_metadata function (line 129).
This function is called in os.walk context (here and in loader-svn) and the links are filtered before calling that function.

Awesome, thanks for clarifying!