My versioned project uses the contents of an upstream tarball. I would like to extract the contents in such a way as to be able to recreate the original tarball exactly. The reason is that I don't want to include big binary blobs in my versioned project. The retarring is unreliable, often producing slightly different tarballs. I suspect compression algorithm heuristics produce different results under different conditions.
EDIT: A further problem making the solution difficult is that some versioning systems (git) do not track empty dirs, thus excluding solutions than do not involve the creation of an auxiliary metadata file. See my comment to Hauke. (Thanks Hauke for this edit).