#739104 debcheckout: should create a local tracking branch for pristine-tar

Package:
devscripts
Source:
devscripts
Description:
scripts to make the life of a Debian Package maintainer easier
Submitter:
Andreas Beckmann
Date:
2015-05-19 21:54:04 UTC
Severity:
normal
#739104#5
Date:
2014-02-15 20:55:42 UTC
From:
To:
Hi,

if debcheckout clones a git repository, if should create a local
tracking branch for pristine-tar (if that exists in the remote
repository). Otherwise git-buildpackage --git-pristine-tar fails because
it cannot find the pristine-tar branch. It tries to access the remote,
but somehow this fails. Also a local pristine-tar branch is needed to
import a new upstream release.

$ debcheckout qgis
[...]
$ cd qgis
$ git-buildpackage --git-export-dir=../build-area --git-pristine-tar [...]
[...]
gbp:warning: Pristine-tar branch "pristine-tar" not found
fatal: Path 'qgis_2.0.1.orig.tar.gz.delta' does not exist in 'refs/remotes/origin/pristine-tar'
pristine-tar: git show refs/remotes/origin/pristine-tar:qgis_2.0.1.orig.tar.gz.delta failed
gbp:error: Couldn't checkout "qgis_2.0.1.orig.tar.gz": /usr/bin/pristine-tar returned 128

There may be an additional bug in pristine-tar that makes it only look
for .tar.gz in refs/remotes/origin/pristine-tar while we have an
..tar.bz2 in this case.
After checking out pristine-tar locally once, gbp succeeds:

[...]
pristine-tar: successfully generated /tmp/rebuild/build-ares/qgis_2.0.1.orig.tar.bz2
[...]


Andreas

#739104#10
Date:
2014-02-15 21:07:27 UTC
From:
To:
Hi,

Le 15/02/2014 16:55, Andreas Beckmann a écrit :

So maybe it should (recommend git-buildpackage and) use “gbp pull”
instead of “git pull” if available.

Regards

David

#739104#15
Date:
2015-05-17 15:42:57 UTC
From:
To:
Hi,

 I've made tiny workaround patch for this issue (and more for with
 "upstream" branch). Could you check it, please?

#739104#22
Date:
2015-05-18 11:59:10 UTC
From:
To:
Hello

Instead of using 'git checkout', I think you can setup the branches with
'git branch --track'. E.g. 'git branch --track pristine-tar
remotes/origin/pristine-tar'

An alternative to run 'cd $wcdir' in the forked shell script is to run cd
within the Perl script:

use Cwd;
my $dir = cwd();
chdir($wcdir) || die;
system(qw/git whatever/) or die "system git whatever failed: $?";
chdir($dir); # go back

This way, you have a better control of the forked command: one command in one
system call enables you to check for error as shown above.

One last trick: calling system with an array avoid forking a shell: the
command is run directly, thus you avoid subtitutions problems with bash.

Feel free to get back to me if I was not clear enough.

Hope this helps

#739104#27
Date:
2015-05-19 21:50:26 UTC
From:
To:
This makes a lot of assumptions about the layout of the repository
(presence and/or naming of branches) and the workflows being used (use
of gbp).

I think this may be better off reassigned/cloned to git-buildpackage to
have gbp-clone(1) gain a “--debcheckout” which uses gbp's knowledge to
do post-clone configuration.

I'd be willing to add handling for the pristine-tar branch, since that's
standard, but the rest seems too specific to other tools.

Cheers,