#900781 import-orig: fails to switch to debian-branch before import possibly losing patch-queue branch

#900781#5
Date:
2018-06-04 20:00:23 UTC
From:
To:
Both the git-buildpackage documentation and
https://wiki.debian.org/Python/GitPackagingPQ

invite the user to first run 'gbp pq import' before using 'import-orig'.

However, since the 'replace' merge mode, which is actually the default mode
for most packages, 'import-orig' resets the patch queue branch at the end.

Which means that all patches are lost and executing
'gbp pq rebase' + 'gbp pq export' do nothing.

#900781#10
Date:
2018-06-05 05:43:07 UTC
From:
To:
Hi,

import-orig does not the pq branch at all. You need to give an example
what you think is wrong.
 -- Guido

#900781#15
Date:
2018-06-05 10:22:59 UTC
From:
To:
$ gbp clone git@salsa.debian.org:python-team/modules/zc-lockfile.git
gbp:info: Cloning from 'git@salsa.debian.org:python-team/modules/zc-lockfile.git'
$ cd zc-lockfile
$ git branch
* debian/master
  pristine-tar
  upstream
$ gbp pq import
gbp:info: Trying to apply patches at '8c7a785b55b4b94093dd2b634ebfcb5d4f238371'
gbp:warning: Patch 'no_doc_txt.patch' has no authorship information, using 'Debian/Ubuntu Zope Team <pkg-zope-developers@lists.alioth.debian.org>'
gbp:info: 1 patches listed in 'debian/patches/series' imported on 'patch-queue/debian/master'
$ git log -2 --oneline --graph debian/master @
* 8e236e0 (HEAD -> patch-queue/debian/master) no_doc_txt
*   8c7a785 (origin/debian/master, origin/HEAD, debian/master) Merge remote-tracking branch 'origin/svn'
|\
$ gbp import-orig https://files.pythonhosted.org/packages/f5/fe/efb94907d8b2b81c3beab1bd628ff67e310d82816b94aa00b52062727ea9/zc.lockfile-1.3.0.tar.gz
What is the upstream version? [1.3.0]
gbp:info: Importing '../zc.lockfile-1.3.0.tar.gz' to branch 'upstream'...
gbp:info: Source package is zc.lockfile
gbp:info: Upstream version is 1.3.0
gbp:info: Replacing upstream source on 'debian/master'
gbp:info: Successfully imported version 1.3.0 of ../zc.lockfile-1.3.0.tar.gz
$ git log -2 --oneline
b465d76 (HEAD -> patch-queue/debian/master, debian/master) Update upstream source from tag 'upstream/1.3.0'
5706e9b (tag: upstream/1.3.0, upstream) New upstream version 1.3.0
$

Commit 8e236e0 is lost and can't be rebased. I expect patch-queue/debian/master to still point to it.

#900781#20
Date:
2018-06-05 12:20:50 UTC
From:
To:
Hi,

Does this work as you'd expect it:

$ gbp clone git@salsa.debian.org:python-team/modules/zc-lockfile.git
$ gbp pq import
$ git co debian/master
$ gbp import-orig https://files.pythonhosted.org/packages/f5/fe/efb94907d8b2b81c3beab1bd628ff67e310d82816b94aa00b52062727ea9/zc.lockfile-1.3.0.tar.gz

import-orig imports onto the branch you're currently on
causing the above commit to be lost. It should import on the
debian-branch instead.

Cheers,
 -- Guido

#900781#25
Date:
2018-06-05 12:42:50 UTC
From:
To:
Le 06/05/18 à 14:20, Guido Günther a écrit :

Yes, that works.

But import-orig is supposed to import onto the branch specified by --debian-branch (already 'debian/master' according to debian/gpb.conf), isn't it ?

Or if debian/master must really be checked out, then the problem is in the docs, and in the description of --debian-branch

#900781#30
Date:
2018-06-05 12:45:22 UTC
From:
To:
Hi,

Thanks for confirming!

It's "just" not doing the right thing atm. I'll fix that.
Cheers,
 -- Guido

#900781#37
Date:
2021-08-13 10:14:49 UTC
From:
To:
Hi,

Actually no because that breaks the:

git checkout -b topic-branch
gbp pq import
<hack hack>
gbp pq export --commmit
git push salsa topic-branch

workflow.

Care enough the send a patch? That would be great.
Cheers,
 -- Guido