#1111194 git-debpush: please upload without tripping submodule check if .gitmodules is empty

Package:
git-debpush
Source:
git-debpush
Submitter:
Simon McVittie
Date:
2025-08-24 12:51:02 UTC
Severity:
normal
Tags:
#1111194#5
Date:
2025-08-15 11:45:30 UTC
From:
To:
src:gnome-desktop (among others) has an empty (0 byte) .gitmodules at
top level. I'm assuming this means that upstream previously used
submodules, decided they were not the right answer, and did the
necessary amount of `git rm -r` to stop using them, but did not go as
far as also deleting the resulting 0-byte metadata file. I've
successfully uploaded projects in this situation with dgit in the past:
because there are no actual submodules, they pass the "git tree ==
result of unpacking .dsc" check.

When I tried uploading src:gnome-desktop with `git debpush`, the tool
complained about the apparent existence of submodules, but when I told
it to ignore the potential problem:

git-debpush: check failed: git submodule(s) detected; these are not supported ('submodule' check)
git-debpush: proceed anyway? (y/N) y
git-debpush: fetching from https://salsa.debian.org/gnome-team/gnome-desktop to check existing state
...

everything seems to have gone well, uploading version 44.3-4 via
tag2upload job ID 500.

Would it be possible to skip this check if .gitmodules is completely
empty (0 bytes)?

(Perhaps even if it exists but contains only whitespace? But that's
probably harder to achieve, since it would require dgit/git-debpush to
actually look at and understand the file contents, not just the
filesystem metadata.)

Thanks,
    smcv

#1111194#10
Date:
2025-08-15 14:07:55 UTC
From:
To:
Hi.  Thanks for the report.

Simon McVittie writes ("Bug#1111194: git-debpush: please upload without tripping submodule check if .gitmodules is empty"):
...

Right.  Good, I'm glad it worked for you.  That's what I would have
hoped.  You were right to override this check.

At least one of these ideas ought to be doable, yes.  Only whitespace
should be easy.

It's also possible that we could use git-submodule(1) to parse the
file but that would depend on someone knowing how to drive it.  Maybe
"git-submodule foreach" is the right thing.

Ian.

#1111194#19
Date:
2025-08-18 15:09:40 UTC
From:
To:
Hello,

Birger reported another case where the submodule check gave a false
positive: the 0.14.0-1 upload of waybar, salsa:swaywm-team/waybar.git

It may be the same or a different problem to the one reported in this
bug.

#1111194#24
Date:
2025-08-18 17:50:49 UTC
From:
To:
Sean Whitton writes ("Bug#1111194: git-debpush: please upload without tripping submodule check if .gitmodules is empty"):

No, that was a false negative.

What actually causes the real failure is not the presence of the
`.gitmodules` files in the toplevel.  It's the weird git object
structure, where the tree object references a commit object rather
than a blob or another tree.

In principle I think the git submodule tooling is supposed to maintain
these two things sort of roughly maybe in sync.  Ha ha ha.

Probably we should be checking for anomalous objects in the tree.

Ian.

#1111194#29
Date:
2025-08-18 18:15:45 UTC
From:
To:
Sort of. The contents of a non-empty /.gitmodules are a statement about
what the (upstream) maintainer wants `git submodule update` to do: "if
$path is a submodule, update it to the latest from $url". It doesn't
usually contain a specific commit sha1, only a remote URL and an
optional non-default ref to fetch. Typically it's maintained by letting
`git submodule` subcommands edit it, but it is equally possible to
change it with a text editor.

The submodule itself is the commit-object-as-child, which contains a
specific commit sha1, but no remote URL or ref name. The redundancy
between the two is that /.gitmodules and the tree both contain a list of
(possible or actual) paths-that-are-submodules.

Even a non-empty .gitmodules doesn't *necessarily* indicate a problem,
as seen in src:gnome-control-center. In the upstream project,
subprojects/gvc is a submodule (it's a "copylib" with an unstable API,
intended to be vendored), but in the version packaged in Debian, our
upstream branch is based on upstream's `meson dist` output, which
converts submodules into the full content of its corresponding tree,
leaving the overall tree as the same thing we'd get if upstream had been
using `git subtree` instead of `git submodule`. However, the `meson
dist` tarball does contain the /.gitmodules file (it isn't special-cased
to be removed, unlike the /.git/ directory), therefore so does our
upstream branch. dgit can upload this successfully, because there is
actually no inconsistency between the upstream branch and the orig
tarball when you try it, but git-debpush warns.

I think ideally git-debpush would check for the actual submodule (or more
generally, a tree containing object types that it doesn't/can't support)
rather than .gitmodules, if that is something that can be done
reasonably efficiently at tagging time.

     smcv

#1111194#34
Date:
2025-08-18 18:21:08 UTC
From:
To:
Simon McVittie writes ("Bug#1111194: git-debpush: please upload without tripping submodule check if .gitmodules is empty"):

Proof of concept:

git-ls-tree -r HEAD: --format='%(objecttype)' | grep -v blob

Ian.

#1111194#39
Date:
2025-08-18 18:23:04 UTC
From:
To:
Ian Jackson writes ("Re: Bug#1111194: git-debpush: please upload without tripping submodule check if .gitmodules is empty"):

We should maybe tolerate "tree" in the output in case git-ls-tree ever
prints that for empty subdirectories.  (Which can't exist normally
because the index can't represent them.)

#1111194#44
Date:
2025-08-24 12:49:22 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
dgit, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1111194@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Ian Jackson <ijackson@chiark.greenend.org.uk> (supplier of updated dgit package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Sun, 24 Aug 2025 11:43:28 +0100
Source: dgit
Architecture: source
Version: 13.13
Distribution: unstable
Urgency: medium
Maintainer: Debian tag2upload Delegates <dgit-owner@debian.org>
Changed-By: Ian Jackson <ijackson@chiark.greenend.org.uk>
Closes: 1111194 1111504 1111527 1111696
Changes:
 dgit (13.13) unstable; urgency=medium
 .
   tag2upload:
   * git-debpush: Don't become confused and warn about nonexistent pristine-tar
     metadata.  Closes: #1111504.  [Sean Whitton; report from Birger Schacht]
   * git-debpush: Make submodule check precise.
     Closes: #1111194.  [Report from Simon McVittie]
   * dgit, t2u: --quilt=gbp no longer minds patches editing .gitignore
     Closes: #1111696.  [Report from Simon Josefsson]
   * dgit: Reject --quilt=baredebian+barball in tag2upload builder mode.
 .
   i18n [Américo Monteiro]:
   * dgit-user(7) manpage: Provide Portuguese translation.
   * git-deborig(1): Update Portuguese translation.  Closes: #1111527.
 .
   Documentation:
   * git-debpush(1): Fix link markup.  [Sean Whitton]
   * git-debpush(1): Add references to other tag2upload docs.  [Sean Whitton]
   * dgit(7): Give advice for if upstream source relies on gitattributes.
   * dgit-nmu-simple(7): Document this as the best way to do a git-based NMU.
   * git-debpush(1): Document --quilt=unapplied, not just --quilt=gbp.
   * changelog: 13.12: Add missing Closes for #1108181.  [Sean Whitton]
 .
   dgit bugfix:
   * dgit: baredebian: Fix diff instruction if upstream files discrepant.
 .
   Packaging improvements:
   * git-deborig: Replace several Perl module dependencies
     with inline code and/or use of Dgit::Core.  [Sean Whitton]
 .
   Testing:
   * git-deborig: New tests.  [Sean Whitton]
   * git-debpush: Test that we push the upstream tag.  Re #1111305.
   * CI: Disable some more useless jobs.
   * CI: add t2u-integration-trixie job.
 .
   Other changes:
   * git-deborig: Improve an error message.  [Sean Whitton]
   * Internal tidying and refactoring.  [Sean Whitton and Ian Jackson]
Checksums-Sha1:
 71672e643670e101739762e3ae81a0e14dd1ba95 2519 dgit_13.13.dsc
 e76586fc73a0a2550d26380967cec670509200da 806445 dgit_13.13.tar.gz
 bfa9aaa4086bd42011e2d6d368b27adaca63acf0 1029984 dgit_13.13.git.tar.xz
 996549c0bca4a7b6e724fb9e274ad0cb46ca091f 18034 dgit_13.13_source.buildinfo
Checksums-Sha256:
 dd9112c14ed49f183d2bf27d7c52276a21cbc8c2bcb35a4e3c7ce4a5dbcda9d4 2519 dgit_13.13.dsc
 5a7551692c8d9cc27ce08ce0ef44411a28fa974edb85c0588f717b0c4e3eae1e 806445 dgit_13.13.tar.gz
 c497478f8582155efc6749c438d34f1260c4a6408784b25769354d475eb3ad88 1029984 dgit_13.13.git.tar.xz
 9a27cff474354a426959315929dbffcff3fa959dcc5879eb6ba712265d5a7b23 18034 dgit_13.13_source.buildinfo
Files:
 13c26e70f8285f9e7ff6c0be62a219b9 2519 devel optional dgit_13.13.dsc
 e6d90a4f1b240b98f96cb296c912724d 806445 devel optional dgit_13.13.tar.gz
 35a54d2251c5e2e97ad18af8d4a61918 1029984 devel optional dgit_13.13.git.tar.xz
 3b96dffa6e7de387d21ad02dadd718d3 18034 devel optional dgit_13.13_source.buildinfo
Git-Tag-Info: tag=937352782edf8d25b5c6d7f3de1180e8566b7c40 fp=559ae46c2d6b6d3265e7cba1e3e3392348b50d39
Git-Tag-Tagger: Ian Jackson <ijackson@chiark.greenend.org.uk>
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEN02M5NuW6cvUwJcqYG0ITkaDwHkFAmirBPwACgkQYG0ITkaD
wHnSiBAAvpwy+CwIjftch1a7PO5Du30rb40g113jJryAAu1Qn+wVIAgoCr/1BL8C
s66ZpBpb1V7iec4ivwyU2id5pib2BNrN/KgH/qaXtvd/CoMBV9iP1+UOrqGaCjBL
4AqLLzVT/52T5vdcDR8t3MzZOayypr70Fre8RSXmg0rFjQOW4a25fkti7hIP583Z
5sKPwT9bwvWmNekvi8uUK69KWoVmwsQnBCzrXr6TggoSt4J16xkREXZOW+mulVeY
qdzG+5RtAlUdfwSbCgi4Eev6Gjj33SuIp35YFzoWnL6UJNcAZo1pD4KUCiH7bPXX
JqCThfdeqNzxYVOyzKnQNwRU1Tu65P1aumOdZJaNo5z3y6WXiyx1hxrH2bh8sbdX
WEMQjEuDXdUrixBRDDhFaMhRm3T8WKuXMnBsjFobhzZiVblEu22epjkTYf8mlZu6
z2sGqRvgkaCNNthglRgFOWQxy2udJDOTOP6R/jm9swS2/5LIEqwCmQCHR1AY+2rL
NpS8McFV8+zYkc8Sbel/JAvjWMaEAU4wBGbByc5I9NI88Ag5BsXEq/PKh4TixsC0
MD3ZCUxnQRvN0m0/8w2XIK23XDAxlnb/1i5SpWze7a/87+7PDg1cLK0GJ0i/7NVr
Umltm5KG8BrZIfsNCQVui3qyN9SMumsH/g6eiMXENnySvgPJd90=
=ARrq
-----END PGP SIGNATURE-----