This is an automated email from the git hooks/post-receive script.

myon pushed a commit to branch master
in repository devscripts.

commit bc5787a5ef266d5c38f73bdaed9c5013bb88cf25
Author: Christoph Berg <>
Date:   Thu Feb 8 11:36:28 2018 +0100

    origtargz: Make --clean remove .gitignore if it's not in git.
 debian/changelog     |  3 +++
 scripts/ | 16 ++++++++++------
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 4f54c0c..159c61b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -37,6 +37,9 @@ devscripts (2.18.1) UNRELEASED; urgency=medium
     + Add option "-m" to only look in the Maintainer field and not also in
       the Uploaders field.  Closes: #887380
+  [ Christoph Berg ]
+  * origtargz: Make --clean remove .gitignore if it's not in git.
  -- Mattia Rizzolo <>  Wed, 03 Jan 2018 14:31:54 +0100
 devscripts (2.17.12) unstable; urgency=medium
diff --git a/scripts/ b/scripts/
index 54d788a..94bd2ce 100755
--- a/scripts/
+++ b/scripts/
@@ -2,7 +2,7 @@
 # origtargz: fetch the orig tarball of a Debian package from various sources,
 # and unpack it
-# Copyright (C) 2012-2016  Christoph Berg <>
+# Copyright (C) 2012-2018  Christoph Berg <>
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -68,12 +68,12 @@ Finally, B<uscan --download --download-current-version> is 
 When asked to unpack the orig tarball, B<origtargz> will remove all files and
 directories from the current directory, except the debian directory, and the
-VCS repository directories. Some files outside F<debian/> which are often 
-in VCS even for debian-dir-only repositories are also preserved 
-F<.gitignore>, F<.hgignore>). I<Note that this will drop all non-committed 
+VCS repository directories. I<Note that this will drop all non-committed 
 for the patch system in use (e.g. source format "3.0 (quilt)"), and will even
 remove all patches from the package when no patch system is in use (the
-original "1.0" source format).
+original "1.0" source format). Some VCS control files outside F<debian/>
+preserved (F<.bzr-builddeb>, F<.bzr-ignore>, F<.gitignore>, F<.hgignore>), if
+stored in VCS.
 The default behavior is to unpack the orig tarball if the current directory
 is empty except for a F<debian> directory and the VCS files mentioned above.
@@ -312,7 +312,11 @@ sub clean_checkout ()
                next if ($file eq '.' or $file eq '..');
                next if ($file eq 'debian');
                next if ($file =~ /^(\.bzr|\.git|\.hg|\.svn|CVS|_darcs)$/);
-               if ($file =~ 
/^(\.bzr(ignore|-builddeb)|\.gitignore|\.hgignore)$/) {
+               if ($file eq '.gitignore' and -d '.git') { # preserve 
.gitignore if it's from git
+                       next if `git ls-files .gitignore` eq ".gitignore\n";
+               }
+               if (($file =~ /^\.bzr(ignore|-builddeb)$/ and -d '.bzr') or
+                   ($file eq '.hgignore' and -d '.hg')) {
                        print "Notice: not deleting $file (likely to come from 
VCS checkout)\n";

Alioth's /usr/local/bin/git-commit-notice on 

devscripts-devel mailing list

Reply via email to