.gitignore (was Re: Help offered with xwax package)

Jonas Smedegaard dr at jones.dk
Thu Aug 11 14:11:25 UTC 2016


Quoting IOhannes m zmölnig (Debian/GNU) (2016-08-11 10:43:55)
> On 2016-08-10 11:52, James Cowgill wrote:
> >> Actually we should repack ( to get rid of upstream .gitignore file and
> >> > use our .gitignore file ) and rename.
> > You don't actually need to do that (and arguably you should not repack
> > orig tarballs unless you need to). For source format "3.0 (quilt)",
> > dpkg-source contains a set of regexes for files which are automatically
> > ignored when generating the final source package. .gitignore (and .git/)
> > are on the list so any changes you make to upstream's .gitignore are
> > completely ignored by dpkg-source.
> 
> i was wanting to ask about best practices regarding .gitignore for some
> time.
> 
> when packaging, i have two "problems" with .gitignore
> 
> #1 upstream includes a .gitignore
> having an upstream .gitignore field usually just creates trouble as it
> (mostly) hides stray artefacts lying around until dpkg-source comes and
> complains. i really think that gitignore's main purpose is exactly this
> hiding of build artefacts, but it mainly causes trouble when it comes to
> Debian's build chain.
> with my Debian hat on, i would like to get rid of all upstream
> .gitignore files, ideally *automatically* (to catch all those gitignores
> in subdirectories...)
> with my upstream hat on, i desparately need .gitignore though...
> 
> a "solution" which i often find applied (by myself, and others like
> mira) is to just strip away the .gitignore file, when repacking the
> sources (though afaik this is only done when the sources are repackaged
> anyhow)

Here's my understanding:

.git* files are not really project data but packaging data. When 
repackaging we should always throw away old packaging (meta)data, and 
may add new packaging (meta)data.

 * If upstream includes debian/* files, throw it away.
 * If upstream includes .git* or .svn* or .cvs* files, throw it away.

 * For a git containment, add .git* files as needed.
 * For a .deb package, add debian/* files as needed.

If lazy then you can skip cleanup of old containment files when not in 
the way of your own new containment, but lintian will rightfully warn if 
you ship a package with VCS files, because ideally you should care not 
only about your own needs but also downstream needs.


> #2 ignoring Debian toolchain artefacts
> most packages use "3.0 quilt", which I (unlike many others) have no
> problems with.
> unfortunately, using quilt results in a .pc/ directory in the project
> root, something that gbp will loudly complain about.
> 
> the most common "solution" is to add .pc/ to .gitignore

That's no different from any other containment, I believe.

 - Jonas

-- 
 * Jonas Smedegaard - idealist & Internet-arkitekt
 * Tlf.: +45 40843136  Website: http://dr.jones.dk/

 [x] quote me freely  [ ] ask before reusing  [ ] keep private
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-multimedia-maintainers/attachments/20160811/429bdd32/attachment.sig>


More information about the pkg-multimedia-maintainers mailing list