Control: clone -1 -2
Control: reassign -2 debhelper
Control: retitle -2 Please adjust debian/source/options

Hi.

FTR, I didn't intend to draw this bug to your attention as the
debhelper maintainer.  #1050709 was addressed to dgit maintainers
about about how to deal with this situation in dgit.

I suggested in dgit that we might do one or more of the following
(numbering addded):

| 1. File a bug or MR against debhelper
| 2. Somehow ask that dpkg-source do something about this, but what ?
| 3. Have dgit detect this situation and at least explain it to the user
| 4. Have dgit generate a non-roundtrippable source package
|    (probably very hard and also undesirable)

I am working on (3).  (4) seems wrong.  As for (2), that's already
#908742 and #908747.

Since you've engaged, let me do (1) now, and clone this bug
and address you as debhelper maintainer:

The fundamental principle of operation of dgit is that the git tree[1]
is *identical*[2] to result of dpkg-source -x.

Niels Thykier writes ("Bug#1050709: tar-ignore debian/source/options"):
> So this is a common pattern in my packages although it sometimes appears 
> in d/s/local-options rather than d/s/options.

dgit refuses to work with d/s/local-options, because they cannot be
included in the source package.  In debhelper it seems that someone
moved the ignores to d/s/options, probably for this reason.

> Basically, the issue is when you have something you want to have 
> locally, not in git and also not in the archive.

That's fine.  The correct approach is to make dpkg-source and git
agree with each other.  The problem with plain tar-ignore is that it
ignores .gitignore, which *is* in your git tree and is not ignored by
git.

See https://bugs.debian.org/908747

> Here the "local" directory is listed both in .gitignore and in 
> "tar-ignore", because I do not want it in git nor in the archive when I 
> do an upload.

Yes, that makes sense.

> To solve this, I add `tar-ignore=...` (for native packages) to 
> debian/source/(local-)options.  However, if you add that option, you end 
> up with the entire *.git* directory in the tarball.  To avoid that, I 
> add the `tar-ignore` on its own to get the sane defaults back.

Please change this to --tar-ignore=.git.  I.e., I think,
`tar-ignore=.git` in d/s/options.

I think that will cause dpkg-source to do the right things.  I tested
this locally and it seems to fix the problem.

Patch attached.

> PS: Not sure if this problem is specific to native packages, which I 
> happen to maintain a lot of (relative to other maintainers).

It's somewhat worse with non-native packages because things are more
complicated and there's all the different git workflows, but the basic
issue is the same.

Thanks,
Ian.

[1] The git tree uploaded to the dgit git server and seen via "dgit
clone".  There are split view modes for handling some, but not all,
deviations from this principle, notably patches-unapplied git trees.

[2] Except that there is no .pc directory in the git tree.

>From a1d7a8a5ef09938b372d3ae28b954552f6dd9e8e Mon Sep 17 00:00:00 2001
From: Ian Jackson <ijack...@chiark.greenend.org.uk>
Date: Sat, 2 Sep 2023 12:40:40 +0100
Subject: [PATCH] Update d/s/options to use less broad tarignore syntax

---
 debian/source/options | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/source/options b/debian/source/options
index edbbfb5b..2ac64523 100644
--- a/debian/source/options
+++ b/debian/source/options
@@ -1,2 +1,2 @@
-tar-ignore
+tar-ignore=.git
 tar-ignore=debhelper/.idea
-- 
2.20.1

-- 
Ian Jackson <ijack...@chiark.greenend.org.uk>   These opinions are my own.  

Pronouns: they/he.  If I emailed you from @fyvzl.net or @evade.org.uk,
that is a private address which bypasses my fierce spamfilter.

Reply via email to