wagoodman / dive

A tool for exploring each layer in a docker image
MIT License
45.76k stars 1.75k forks source link

what's the usage of `doubleWhiteoutPrefix` #391

Open sify21 opened 2 years ago

sify21 commented 2 years ago

Hi @wagoodman, I'm trying to port the parsing logic of this tool as a rust library here, which I want to use in a personal project, but I don't understand the usage of doubleWhiteoutPrefix defined here: https://github.com/wagoodman/dive/blob/64880972b0726ec2ff2b005b0cc97801067c1bb5/dive/filetree/file_tree.go#L20

I know from the spec that whiteoutPrefix means deleted files, but I can't find explanations in the spec for doubleWhiteoutPrefix. Could you kindly explain the usage of it? Thanks in advance.

sergkondr commented 2 months ago

I know from the spec that whiteoutPrefix means deleted files, but I can't find explanations in the spec for doubleWhiteoutPrefix. Could you kindly explain the usage of it? Thanks in advance.

As far as I understand, .wh..wh..opq is the flag(kind of), that indicates that all content of the directory should be deleted("whited out"). So in general, in case like this: /data/{file1,file2} these situations are similar:

We can not just use /.wh.data, because the whole directory is deleted then, not just its content