Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#1005321: gpb pq: obliterates un-committed changes without warning

21 views
Skip to first unread message

Julian Gilbey

unread,
Feb 11, 2022, 4:30:03 AM2/11/22
to
Package: git-buildpackage
Version: 0.9.25
Severity: normal

I ran "gbp pq import" on my main branch, but had forgotten to commit
some staged changes first. The command failed, as there was an issue
with debian/patches/series. However, the changes in staging were all
lost: the repository was effectively hard-reset back to HEAD. There
was no warning about this.

I would suggest that the command should abort without doing anything
if there are uncommitted changes.

Best wishes,

Julian

Guido Günther

unread,
Feb 11, 2022, 8:40:04 AM2/11/22
to
tag 1005321 pending
thanks

Date: Fri Feb 11 11:35:01 2022 +0100
Author: Guido Günther <a...@sigxcpu.org>
Commit ID: 8db5af7326c581014ca07dcd98beac30f2c90d4f
Commit URL: https://git.sigxcpu.org/cgit/git-buildpackage//commit/?id=8db5af7326c581014ca07dcd98beac30f2c90d4f
Patch URL: https://git.sigxcpu.org/cgit/git-buildpackage//patch/?id=8db5af7326c581014ca07dcd98beac30f2c90d4f

pq: Check if repo is clean before importing patches

Closes: #1005321


Andrej Shadura

unread,
Feb 16, 2022, 8:50:03 AM2/16/22
to
Hi,

On Fri, 11 Feb 2022 14:30:50 +0100 (CET) Guido Günther <a...@sigxcpu.org>
wrote:
Defaulting to --no-ignore-new breaks dgit --gbp push-source when there
are patches. As a workaround, I had to stick pq.ignore-new = False into
my gbp.conf:

$ dgit push-source
Format `3.0 (quilt)', need to check/update patch stack
canonical suite name is bullseye-backports
dgit: split brain (separate dgit view) may be needed (--quilt=gbp).
examining quilt state (multiple patches, gbp mode)
dgit: base trees orig=a2b0298f5ffa80788851 o+d/p=17982c3db326770dc1b2
dgit: quilt differences: src: == orig ## gitignores: == orig ==
dgit: quilt differences: HEAD ## o+d/p HEAD == o+d/p
dgit view: creating patches-applied version using gbp pq
gbp:error: You have uncommitted changes in your source tree:
gbp:error: On branch dgit-view
Untracked files:
(use "git add <file>..." to include in what will be committed)
.pc/

nothing added to commit but untracked files present (use "git add" to track)

gbp:error: Use --ignore-new to ignore.
dgit: failed command: sh -ec 'exec >/dev/null; exec "$@"' x gbp pq import

dgit: error: subprocess failed with error exit status 1
! Push failed, before we got started.
! You can retry the push, after fixing the problem, if you like.


--
Cheers,
Andrej

Andrej Shadura

unread,
Feb 16, 2022, 10:00:03 AM2/16/22
to
Hello,

On 16/02/2022 14:39, Andrej Shadura wrote:
> dgit: error: subprocess failed with error exit status 1
> ! Push failed, before we got started.
> ! You can retry the push, after fixing the problem, if you like.

Here’s a log of a session in which I reproduced the issue from the
scratch. Sorry for the line wrapping.

andrewsh@nuevo /t/test-gbp> dgit clone hello
canonical suite name for unstable is sid
starting new git history
last upload to archive: NO git hash
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
100 708k 100 708k 0 0 1868k 0 --:--:-- --:--:-- --:--:--
1865k
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
100 6132 100 6132 0 0 1174 0 0:00:05 0:00:05 --:--:--
1436
dpkg-source: info: extracting hello in hello-2.10
dpkg-source: info: unpacking hello_2.10.orig.tar.gz
dpkg-source: info: unpacking hello_2.10-2.debian.tar.xz
synthesised git commit from .dsc 2.10-2
HEAD is now at a72f60c8c312 hello (2.10-2) unstable; urgency=medium
dgit ok: ready for work in hello
andrewsh@nuevo /t/test-gbp> cd hello
andrewsh@nuevo /t/t/hello (dgit/sid)> gbp pq import
gbp:info: Trying to apply patches at
'a72f60c8c31288e3e3715d0409c74faee35b3b18'
gbp:info: 0 patches listed in 'debian/patches/series' imported on
'patch-queue/dgit/sid'
andrewsh@nuevo /t/t/hello (patch-queue/dgit/sid)> echo super important
change >> README
andrewsh@nuevo /t/t/hello (patch-queue/dgit/sid)> git diff
diff --git a/README b/README
index cf22cf9d3e7f..4353e9e0eef3 100644
--- a/README
+++ b/README
@@ -74,3 +74,4 @@ order to be a canonical example of a GNU package.
Many people have
contributed; please see the AUTHORS and ChangeLog files.

GNU Hello is free software. See the file COPYING for copying conditions.
+super important change
andrewsh@nuevo /t/t/hello (patch-queue/dgit/sid)> git commit -a -m "A
super important change"
[patch-queue/dgit/sid 61571bd130b0] A super important change
1 file changed, 1 insertion(+)
andrewsh@nuevo /t/t/hello (patch-queue/dgit/sid)> gbp pq export
gbp:info: On 'patch-queue/dgit/sid', switching to 'dgit/sid'
gbp:info: Generating patches from git (dgit/sid..patch-queue/dgit/sid)
andrewsh@nuevo /t/t/hello (dgit/sid)> git status
On branch dgit/sid
Untracked files:
(use "git add <file>..." to include in what will be committed)
debian/patches/

nothing added to commit but untracked files present (use "git add" to track)
andrewsh@nuevo /t/t/hello (dgit/sid)> git add debian/patches/
andrewsh@nuevo /t/t/hello (dgit/sid)> git commit -a -m "Add a patch for
a super important change"
[dgit/sid 67da756416d3] Add a patch for a super important change
2 files changed, 18 insertions(+)
create mode 100644 debian/patches/0001-A-super-important-change.patch
create mode 100644 debian/patches/series
andrewsh@nuevo /t/t/hello (dgit/sid)> dgit build-source
Format `3.0 (quilt)', need to check/update patch stack
dgit: split brain (separate dgit view) may be needed (--quilt=gbp).
examining quilt state (multiple patches, gbp mode)
dgit: base trees orig=d05377ef3e3d210f0b5c o+d/p=1c1466eaf095c2031ea6
dgit: quilt differences: src: == orig ## gitignores: == orig ==
dgit: quilt differences: HEAD ## o+d/p HEAD == o+d/p
dgit view: creating patches-applied version using gbp pq
gbp:error: You have uncommitted changes in your source tree:
gbp:error: On branch dgit-view
Untracked files:
(use "git add <file>..." to include in what will be committed)
.pc/

nothing added to commit but untracked files present (use "git add" to track)

gbp:error: Use --ignore-new to ignore.
dgit: failed command: sh -ec 'exec >/dev/null; exec "$@"' x gbp pq import

dgit: error: subprocess failed with error exit status 1
andrewsh@nuevo /t/t/hello (dgit/sid)>


--
Cheers,
Andrej

Ian Jackson

unread,
Feb 17, 2022, 5:40:04 AM2/17/22
to
Sean Whitton writes ("Bug#1005873: [git-buildpackage/master] pq: Check if repo is clean before importing patches"):
> On Wed 16 Feb 2022 at 02:39PM +01, Andrej Shadura wrote:
> > gbp:error: Use --ignore-new to ignore.
> > dgit: failed command: sh -ec 'exec >/dev/null; exec "$@"' x gbp pq import
>
> Sounds like dgit should start passing --ignore-new in this case?

Well, maybe. If done via the command line, dgit ought to do some kind
of dance to work with old gbp, which compplicates matters. But maybe
dgit should provide a .git/gbp.conf in the playtree, which could be
used to override any other troublesome settings.

The difficulty here is just the .pc directory. Perhaps dgit ought to
remove it or move it aside, before running gbp pq.

If we did that then we might want to explicitly *enable* the new
checks.

Ian.

--
Ian Jackson <ijac...@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.

Paul Gevers

unread,
May 28, 2022, 10:30:04 AM5/28/22
to
Control: severity -1 serious

Hi,

On Thu, 17 Feb 2022 10:30:31 +0000 Ian Jackson
<ijac...@chiark.greenend.org.uk> wrote:
> Sean Whitton writes ("Bug#1005873: [git-buildpackage/master] pq: Check if repo is clean before importing patches"):
> > On Wed 16 Feb 2022 at 02:39PM +01, Andrej Shadura wrote:
> > > gbp:error: Use --ignore-new to ignore.
> > > dgit: failed command: sh -ec 'exec >/dev/null; exec "$@"' x gbp pq import
> >
> > Sounds like dgit should start passing --ignore-new in this case?
>
> Well, maybe. If done via the command line, dgit ought to do some kind
> of dance to work with old gbp, which compplicates matters. But maybe
> dgit should provide a .git/gbp.conf in the playtree, which could be
> used to override any other troublesome settings.
>
> The difficulty here is just the .pc directory. Perhaps dgit ought to
> remove it or move it aside, before running gbp pq.
>
> If we did that then we might want to explicitly *enable* the new
> checks.

Seems like the autopkgtest of dgit is now blocking progression of
git-buildpackage related to this change.

Paul
OpenPGP_signature
0 new messages