Hi Aidan,

Aidan <aidg...@gmail.com> writes:

> OK, thank you for your quick feedback.
> If the implementation is fundamentally flawed then I think I'll just leave
> it.

I liked the user-facing UI of your proposed solution, I agree that it
can be hard to learn how to work with git in Debian packaging, and it
can be hard to understand Debian upstream version numbers.

  https://wiki.debian.org/Packaging/SourcePackage
  https://www.debian.org/doc/debian-policy/ch-source.html

Please note that many Debian packages are not child branches of upstream
git history.  Instead they import tarballs of git snapshots, but that's
not to say that the metadata is lost!

Might you be interested in writing a decoder of Debian upstream versions
that already embed upstream git metadata?  Some examples of existing
versions are:

  1.1+14.gb364e08
  tagged_release + commits_since_that_release . letter_for_VCS_used hash
  
  0.0~git20220110.1ce338b
  a_release_has_not_been_tagged ~ VCS_used date . hash

  1.2.1+git20190611.dadb6258
  tagged_release + VCS_used date . hash

  https://manpages.debian.org/bookworm/dpkg-dev/deb-version.7.en.html

Between that, and the remote defined at
debian/upstream/metadata:Repository for many packages, you can also
write a simple program that searches upstream history for a confirmed
match.

  https://wiki.debian.org/UpstreamMetadata

Upstreams possess their git history, so they can just run the decoder on
the Debian version.  ie:

  $ git-upstream-decoder 1.1+14.gb364e08-2
  b364e08009fe0062cf0927d8a0582fad5a12b8e7

The second third of this project could be the encoder, which

  1. Generates a Debian Policy-compliant upstream version with embedded
  committish info (see the three examples included in this email).  Some
  examples of how to do this can be found in dh-make-golang.
  2. For workflows where upstream git history is merged, the encoder
  could also make it easier to tag an upstream committish for Debian
  use, which is just an extension of solution at #1.
  3. Generates a watch file that uses mode=git, and that encodes the
  upstream committish into the Debian upstream version.  If I remember
  correctly uscan already has built-in support for a format compatible
  with git-describe.

The final third letting people know about your tool, encouraging
upstreams to use it, etc.  One problem I noticed with dh-git is that it
would require upstreams to have access to a Debian system.  Not all do,
and not all want to.

Please let me know if you're interested, please consider CCing your
reply (in-line style, not top-posting) to debian-de...@debian.org, and
please keep me in CC.

Regards,
Nicholas

Attachment: signature.asc
Description: PGP signature

Reply via email to