I've looked at this again.  Sorry it's been so long.

Sean Whitton writes ("Bug#1031793: dgit: Treat single-debian-patch as implying 
--quilt=single"):
> I still regret that this change went into bookworm, and would like to
> simplify things again.  I still think that this is a case where the cost
> of correctness-in-all-cases is too high.

I hadn't appreciated that, from your (legitimate) point of view, this
was a regression.  I'm sorry.

> I think we can revert the behavioural change and come up with an
> appropriate warning in the workflow manpage.  It might be relevant to
> recommend users consider using source format 1.0, even.

But, I'm still not sure which behavioural change you're talking about.
Are we talking about this, in 9.0:

  * Reject split brain quilt modes with single-debian-patch.
    (Previously this would malfunction; now we reject it.)

?  That doesn't seem likely since 9.0 was July 2019 and this bug is
February 2023.  But maybe that's the one.  If so, the commit is
75b7a4c72614 which says "Right now, this malfunctions in dgit: we do
not do the split brain stuff".  So although dgit tries to honour d/s/o
single-debian-patch (by invoking dpkg-source) it doesn't manage to do
it in the quilt modes where you evidently want it.

(Looking at the context, I think maybe this was a side effect of other
changes making this complicated to get right.)

#1018984 is scary reading, but doesn't seem to involve anything but
docs changes except

  * With dpkg single-debian-patch, pass --include-removal to dpkg-source -b.

but that doesn't seem like it's what is in your way.


Going back to possible options:

Re somehow discovering this information from git tags: since this is
the same branch format, just a different way of generating patches, it
seems like fishing it out of the last git tag would be possible.
My concern in
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1031793#25
"if the branch format is converted without making a tag"
seems misplaced.  But fishing this out of the tag in dgit still feels
very weird to me.  It's not a thing dgit ever does the rest of the
time (git-debpush does, but that's different).

You wrote, as an argument in favour of writing single-debian-patch:

> You might want to allow non-dgit users to use 'dpkg-source --commit',

I agree that this is desirable.  But the failure modes I previously
described in #1018984 are terrifying.  I'm particularly bothered by
"I was able to make a source package [where] as soon as you try to
edit *an unrelated file* dpkg-source craps out terribly".

I don't think we can have both your goal, of letting people
dpkg-source --commit and fold in their changes into an existing patch,
*and* my goal of not ever getting people into the terrifyingly broken
source package situation (or encouraging things that may lead to that).

You also wrote:

> if you think the bugs aren't going to arise for your package

You can know that for the things *you* do to the package.  But, you
don't know what changes downstream users are going to try to make.  In
my experience, people further from centres of knowledge do
increasingly strange things.

I very much prefer, as an ideological position, to favour the
interests of downstreams, even arguably deragned downstream users,
over upstreams such as ourselves.


So I agree that something should be done.  I still think
debian/source/options single-debian-patch is too bad to recommend.

I'm not opposed to trying to honour it, even so.  Currently the
rejection is implemented in `build_maybe_quilt_fixup`, near l.6234.

I don't think we can use `quilt_fixup_git_singlepatch` in this case,
because dpkg-source wants to regenerate the patch each time, so we
must produce *our* patch with dpkg-source, or the source package isn't
a fixed point.

So we *have* to generate the patch with
`quilt_fixup_dpkgsource_singlepatch`.  AFAICT from the git history and
the source code, that currently just doesn't work in split brain mode
(presumably for reasons to do with playtree juggling etc.


I still think it would be better to invent our own dropping to control
this, and have it modify the default quilt mode.  That could cause the
fixup call to be `quilt_fixup_git_singlepatch` and wouldn't need to
interact with dpkg-source's ideas.

We've ruled out our own option in d/s/options, but we could have
debian/source/dgit-options containing `quilt-single-patch` or maybe
even `single-debian-patch` or something.


What a tangled web we weave.  I hope this is of some use.

Ian.


-- 
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