[git-buildpackage] RFC: new option --git-preexport

Guido Günther agx at sigxcpu.org
Thu Feb 2 15:57:00 CET 2017


On Sun, Jan 29, 2017 at 12:58:28PM +0000, Andrea Zagli wrote:
> Il giorno dom 29 gen 2017 13:13:26 CET, Guido Günther ha scritto:
> 
> > On Sat, Jan 28, 2017 at 04:24:34PM +0000, Andrea Zagli wrote:
> > > Il giorno sab 28 gen 2017 17:14:41 CET, Guido Günther ha scritto:
> > > 
> > > > Hi Andrea,
> > > > On Sat, Jan 28, 2017 at 10:56:10AM +0000, Andrea Zagli wrote:
> > > > > Il giorno dom 22 gen 2017 22:45:11 CET, Guido Günther ha scritto:
> > > > > > On Sun, Jan 22, 2017 at 07:46:17PM +0000, Andrea Zagli wrote:
> > > > > > > the issue is present only if i create export dir inside the git
> > > > > repository
> > > > > > >
> > > > > > > and (i think) the "problem" is that gbp executes this command
> > > > > > >
> > > > > > > gbp:debug: ['git', 'add', '-f',
> > > > > > > '/home/andreaz/Documenti/sviluppo/debian_packages/libreptool']
> > > > > > >
> > > > > > > so the command adds also export dir that i excluded from git
> > > > > repository in
> > > > > > > .gitignore
> > > > > > >
> > > > > > >
> > > > > > > why does gbp use -f?
> > > > > >
> > > > > > You did not send the requested output so I can only guess that you're
> > > > > > using export dir and with --git-export=WC.
> > > > > >
> > > > >
> > > > >
> > > > > i'm sorry but i didn't unsterstand that you want to see the
> > > output, and i
> > > > > thought it was enough just what i had found
> > > >
> > > > Thanks for providingt the logs and the config!
> > > >
> > > > >
> > > > >
> > > > > $ gbp buildpackage --git-verbose -us -uc
> > > > > gbp:debug: ['git', 'rev-parse', '--show-cdup']
> > > > > gbp:debug: ['git', 'rev-parse', '--is-bare-repository']
> > > > > gbp:debug: ['git', 'rev-parse', '--git-dir']
> > > > > gbp:debug: /bin/true [] []
> > > > > gbp:debug: ['git', 'symbolic-ref', 'HEAD']
> > > > > gbp:debug: ['git', 'show-ref', 'refs/heads/debian/sid']
> > > > > gbp:debug: ['git', 'rev-parse', '--quiet', '--verify', 'HEAD']
> > > > > gbp:debug: ['git', 'add', '-f',
> > > > > '/home/andreaz/Documenti/sviluppo/debian_packages/libreptool']
> > > > > gbp:debug: ['git', 'write-tree']
> > > > > gbp:debug: ['git', 'ls-tree',
> > > 'b4e9b44369d2263eb9cf5c7d4b1487a700c84f39']
> > > > > gbp:debug: ['git', 'show', '--pretty=medium',
> > > > > 'b4e9b44369d2263eb9cf5c7d4b1487a700c84f39:debian/changelog']
> > > > > gbp:debug: rm -rf $GBP_EXPORT_DIR/* [] []
> > > > > gbp:debug: ['git', 'show', '--pretty=medium',
> > > > > 'b4e9b44369d2263eb9cf5c7d4b1487a700c84f39:debian/source/format']
> > > > > gbp:debug: ['git', 'show-ref', 'refs/heads/pristine-tar']
> > > > > gbp:debug: ['git', 'show-ref', 'refs/heads/develop']
> > > > > gbp:debug: ['git', 'ls-tree', 'develop']
> > > > > gbp:info: Creating libreptool_0.5.0.orig.tar.gz from 'develop'
> > > > > gbp:debug: Building upstream tarball with compression 'gzip'
> > > > > gbp:debug: ['git', 'show', '--pretty=medium',
> > > > > 'b4e9b44369d2263eb9cf5c7d4b1487a700c84f39:debian/source/format']
> > > > > gbp:info: Building with (cowbuilder) for sid
> > > > > gbp:info: Exporting 'WC' to '/home/andreaz/Documenti/sviluppo/debian_packages/libreptool/build/sid/libreptool-tmp'
> > > > > gbp:debug: ['git', 'show', '--pretty=medium',
> > > > > 'b4e9b44369d2263eb9cf5c7d4b1487a700c84f39:debian/source/format']
> > > > > gbp:info: Moving '/home/andreaz/Documenti/sviluppo/debian_packages/libreptool/build/sid/libreptool-tmp'
> > > > > to '/home/andreaz/Documenti/sviluppo/debian_packages/libreptool/build/sid/libreptool-0.5.0'
> > > > > gbp:debug: ['git', 'show', '--pretty=medium',
> > > > > 'b4e9b44369d2263eb9cf5c7d4b1487a700c84f39:debian/source/format']
> > > > > gbp:debug: git-pbuilder ['-us', '-uc'] []
> > > > > Building with cowbuilder for distribution sid
> > > > > W: /home/andreaz/.pbuilderrc does not exist
> > > > > I: using cowbuilder as pbuilder
> > > > > dh clean
> > > > >    dh_testdir
> > > > >    dh_auto_clean
> > > > >    dh_clean
> > > > > dpkg-source: info: using source format '3.0 (quilt)'
> > > > > dpkg-source: info: building libreptool using existing
> > > > > ./libreptool_0.5.0.orig.tar.gz
> > > > > dpkg-source: warning: newly created empty file
> > > > > 'build/sid/libreptool-0.5.0/NEWS' will not be represented in diff
> > > > > dpkg-source: warning: newly created empty file
> > > > > 'build/sid/libreptool-0.5.0/README' will not be represented in diff
> > > > > dpkg-source: warning: executable mode 0755 of
> > > > > 'build/sid/libreptool-0.5.0/autogen.sh' will not be represented in diff
> > > > > dpkg-source: warning: executable mode 0755 of
> > > > > 'build/sid/libreptool-0.5.0/debian/rules' will not be
> > > represented in diff
> > > > > dpkg-source: warning: newly created empty file
> > > > >
> > > 'build/sid/libreptool-0.5.0/docs/reference/libreptool-overrides.txt'
> > > will
> > > > > not be represented in diff
> > > > > dpkg-source: error: cannot represent change to
> > > > > build/sid/libreptool-0.5.0/tests/db_test.db: binary file
> > > contents changed
> > > > > dpkg-source: error: add build/sid/libreptool-0.5.0/tests/db_test.db in
> > > > > debian/source/include-binaries if you want to store the modified
> > > binary in
> > > > > the debian tarball
> > > > > dpkg-source: error: cannot represent change to
> > > > > build/sid/libreptool-0.5.0/tests/gnome-globe.png: binary file contents
> > > > > changed
> > > > > dpkg-source: error: add
> > > build/sid/libreptool-0.5.0/tests/gnome-globe.png in
> > > > > debian/source/include-binaries if you want to store the modified
> > > binary in
> > > > > the debian tarball
> > > > > dpkg-source: error: cannot represent change to
> > > > > build/sid/libreptool-0.5.0/tests/rodents.png: binary file
> > > contents changed
> > > > > dpkg-source: error: add build/sid/libreptool-0.5.0/tests/rodents.png in
> > > > > debian/source/include-binaries if you want to store the modified
> > > binary in
> > > > > the debian tarball
> > > > > dpkg-source: error: cannot represent change to
> > > > > build/sid/libreptool_0.5.0-1~1.gbp8b8371.debian.tar.xz: binary
> > > file contents
> > > > > changed
> > > > > dpkg-source: error: add
> > > > > build/sid/libreptool_0.5.0-1~1.gbp8b8371.debian.tar.xz in
> > > > > debian/source/include-binaries if you want to store the modified
> > > binary in
> > > > > the debian tarball
> > > > > dpkg-source: error: cannot represent change to
> > > > > build/sid/libreptool_0.5.0.orig.tar.gz: binary file contents changed
> > > > > dpkg-source: error: add build/sid/libreptool_0.5.0.orig.tar.gz in
> > > > > debian/source/include-binaries if you want to store the modified
> > > binary in
> > > > > the debian tarball
> > > > > dpkg-source: error: unrepresentable changes to source
> > > > > gbp:error: 'git-pbuilder -us -uc' failed: it exited with 2
> > > > >
> > > > >
> > > > > my gbp.conf
> > > > >
> > > > > [buildpackage]
> > > > > export-dir=./build/sid
> > > > > preexport=rm -rf $GBP_EXPORT_DIR/*
> > > > > #preexport=rm -rf $GBP_EXPORT_DIR/* && ls -l $GBP_EXPORT_DIR >
> > > > > $GBP_EXPORT_DIR/pippo
> > > > > debian-branch=debian/sid
> > > > > ignore-new=True
> > > > > upstream-tree=BRANCH
> > > > > upstream-branch=develop
> > > > > force-create=True
> > > > > export=WC
> > > > ^^^^^^^^^^^
> > > >
> > > > Here you go: if you want the working copy exported we use git add -f
> > > > otherwise what you'd get wouldn't be your full working copy.
> > > 
> > > 
> > > but -f add also files that aren't part of my working copy, files ignored via
> > > .gitignore
> > 
> > They are. WC means: take the directory 'as is' and skip only .git. It
> > would be simple to add another mode that doesn't use '-f' (maybe called
> > "GC" (gits view of the working copy).
> > 
> 
> 
> ok, so WC isn't what we know as working copy in git
> 
> can i|we add this new "GC" mode?

Sure. It's the code itself is totally trivial, check
gbp/scripts/buildpackage.py:write_tree

     elif options.export == wc_name:
            tree = write_wc(repo)

All that's needed is to add anothe if clause that passed force=False to
write_wc. It then needs a manpage update and a testcase that veries the
behaviour. You can add a unit test that checks write_tree itself. No
need to add a component test.

Cheers,
 -- Guido


More information about the git-buildpackage mailing list