I'm no git user and therefore haven't used git-buildpackage so far, so please
don't worry if the following might be a stupid question, ...
Francois Marrie wrote:
> I set my color.diff to always in ~/.gitconfig and then built a package with
> "git-buildpackage" without any problems.
... but I don't see how this relates to this bugreport. I did some testing with
a .gitconfig
like this
[diff]
color = always
and debcommit without patches fails with this setting. With addition of
--no-color
to the cmdline that is used to produce the diff debcommit works fine.
Patrick Schoenfeld wrote:
> resulting in a message like this:
> (...)
> The current patch is attached, but its not working this way, so it needs
> further investigation.
Okay, after sleeping a night about the problems, I came to the conclusion
that because git supports colorizing output itself there is no reason to
rely on colordiff and therefore I don't see a reason to fix this misuse
of git. So IMHO the real solution for git-diff is to include the
--no-color parameter instead.
I have updated the patch. I would feel lucky if one of the devscripts
maintainers could include it.
Thanks and best Regards,
Patrick
Index: debian/changelog
===================================================================
--- debian/changelog (Revision 922)
+++ debian/changelog (Arbeitskopie)
@@ -26,7 +26,14 @@
[ Christoph Berg ]
* debcommit: also look for \t in the diff for GNU-style changelogs.
- -- Adam D. Barratt <[EMAIL PROTECTED]> Mon, 28 Jan 2008 22:58:38 +0000
+ [ Patrick Schoenfeld ]
+ * debcommit: Work around problems when colordiff is used as diff-cmd with
+ subversion and svk or the color = always option with git.
+ (Closes: #462686)
+ * debcommit: Added a note to the manpage about potential problems with
+ colordiff.
+
+ -- Patrick Schoenfeld <[EMAIL PROTECTED]> Tue, 29 Jan 2008 21:17:27 +0100
devscripts (2.10.13) unstable; urgency=low
Index: scripts/debcommit.pl
===================================================================
--- scripts/debcommit.pl (Revision 922)
+++ scripts/debcommit.pl (Arbeitskopie)
@@ -107,6 +107,15 @@
This is the key id used for signing tags. If not set, a default will be
chosen by the revision control system.
+=head1 DEBCOMMIT AND COLORDIFF
+
+If you use colordiff to colorize your output, this might cause problems.
+debcommit tries to work around such problems, but under some circumstances
+this could fail. So if debcommit complains that it is unable to find a commit
+message it might be worth a try to disable colorized output of your vcs.
+However: In order to have future versions of debcommit include fixes for such
+problems it would be good to file a bug report if this happens.
+
=cut
use warnings;
@@ -485,10 +494,12 @@
@diffcmd = ($prog, 'file-diff');
} elsif ($prog eq 'git') {
if ($all) {
- @diffcmd = ('git-diff');
+ @diffcmd = ('git-diff', '--no-color');
} else {
- @diffcmd = ('git-diff', '--cached');
+ @diffcmd = ('git-diff', '--cached', '--no-color');
}
+ } elsif ($prog eq 'svn' || $prog eq 'svk') {
+ @diffcmd = ($prog, 'diff', '--diff-cmd', '/usr/bin/diff');
} else {
@diffcmd = ($prog, 'diff');
}
@@ -501,7 +512,7 @@
next if /^\s*\[.*\]\s*$/; # maintainer name
$ret .= $_;
}
-
+
if (! length $ret) {
my $info='';
if ($prog eq 'git') {