On Mon Jul 28, 2025 at 8:44 PM CEST, Sean Whitton wrote:
On Sun 27 Jul 2025 at 04:11pm +02, Andrea Pappacoda wrote:
I tried to add to the tag2upload.5 manpage the pristine-tar handling design outlined in our discussions, which is inline below. Still, I have a few questions:

What should we do with that upstream commit metadata?

Sorry, but which metadata is that?

It's likely that I didn't explain myself correctly. I meant the existing upstream= and upstream-tag= metadata fields which git-debpush already uses. The pristine-tar tool does not need those to generate a tarball, but I believe it's still useful to include them alongside the pristine-tar= metadata field to compare the pristine-tar tree to the tree of the git commit contained in the upstream= metadata field.

Hope it's clearer now! If not, here's some code which should express my intent less ambiguously than in English.

   pristine_tar_tree_id=$(git cat-file -- blob 
"${s_pristine_tar}:${tarball}.id")
   upstream_commit_tree_id=$(git rev-parse --verify --end-of-options 
"${s_u}^{tree}")
   if [ "$pristine_tar_tree_id" != "$upstream_commit_tree_id" ]; then
       fail 'pristine-tar tree id differs from the upstream commit one'
   fi

Trying to read your patch, I think the fact I don't use pristine-tar is really showing. Is the .id file defined somewhere? Is your knowledge of the pristine-tar branch contents from reading a spec, or empirical?

Kind of both. The pristine-tar(1) manpage says, under the `pristine-tar commit _tarball_ _upstream_` section:

The upstream parameter specifies the tag or branch [or commit, Ed.] that contains the same content that is present in the tarball. The name of the tree it points to will be recorded for later use by pristine-tar checkout.

So yes, pristine-tar specifies that it stores the tree id somewhere. It does not explicitly say where (well, not in the manpages), but it does store that tree id inside a file named as the input tarball with ".id" appended (as shown in its source code). This is not configurable, and pristine-tar also looks for such file when running `pristine-tar checkout`, so it cannot change really, otherwise new pristine-tar versions would be unable to extract old tarballs, which defeats the purpose of the tool.

The ".delta" file is explicitly mentioned in the manpage, just below the paragraph I quoted before.

Glad we have someone who knows it better working on it.

Thanks!

Reply via email to