Package: devscripts
Version: 2.10.61
Severity: wishlist
File: /usr/bin/debcommit

When committing files with git, it's possible to use '-e' on the commit
commandline to edit the given message. Unlike the '-e' mode of debcommit,
the git message-editing option provides the 'git status' output in the
editor, which is more useful to the user.

The attached patch will add the '-e' to the 'git commit' commandline instead
of spawning the editor itself, when '-e' is provided on the debcommit
commandline.

-- Package-specific info:

--- /etc/devscripts.conf ---

--- ~/.devscripts ---
DEBSIGN_KEYID="49E3ACD3"
DEBCHANGE_RELEASE_HEURISTIC=changelog

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_GB.UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages devscripts depends on:
ii  dpkg-dev                      1.15.5.6   Debian package development tools
ii  libc6                         2.10.2-6   Embedded GNU C Library: Shared lib
ii  perl                          5.10.1-12  Larry Wall's Practical Extraction 

Versions of packages devscripts recommends:
ii  at                 3.1.12-1              Delayed job execution and batch pr
ii  bsd-mailx [mailx]  8.1.2-0.20100314cvs-1 simple mail user agent
ii  curl               7.20.0-2              Get a file from an HTTP, HTTPS or 
ii  cvs                1:1.12.13-12          Concurrent Versions System
ii  dctrl-tools        2.14                  Command-line tools to process Debi
ii  debian-keyring [de 2009.11.04            GnuPG (and obsolete PGP) keys of D
ii  dput               0.9.5.1               Debian package upload tool
ii  epiphany-browser [ 2.29.3-1              Intuitive GNOME web browser
ii  equivs             2.0.8                 Circumvent Debian package dependen
ii  fakeroot           1.14.4-1              Gives a fake root environment
ii  git-core           1:1.7.0-1             fast, scalable, distributed revisi
ii  gnupg              1.4.10-2              GNU privacy guard - a free PGP rep
ii  iceweasel [www-bro 3.5.8-1               Web browser based on Firefox
ii  libauthen-sasl-per 2.14-1                Authen::SASL - SASL Authentication
ii  libcrypt-ssleay-pe 0.57-2                Support for https protocol in LWP
ii  libparse-debcontro 2.005-2               Easy OO parsing of Debian control-
ii  libsoap-lite-perl  0.710.10-1            Perl implementation of a SOAP clie
ii  libterm-size-perl  0.2-4+b1              Perl extension for retrieving term
ii  libtimedate-perl   1.2000-1              collection of modules to manipulat
ii  liburi-perl        1.53-1                module to manipulate and access UR
ii  libwww-perl        5.834-1               Perl HTTP/WWW client/server librar
ii  libyaml-syck-perl  1.07-1                fast, lightweight YAML loader and 
ii  links [www-browser 2.2-1+b1              Web browser running in text mode
ii  lintian            2.3.4                 Debian package checker
ii  lsb-release        3.2-23                Linux Standard Base version report
ii  lzma               4.43-14               Compression method of 7z format in
ii  man-db             2.5.7-2               on-line manual pager
ii  openssh-client [ss 1:5.3p1-3             secure shell (SSH) client, for sec
ii  patch              2.6-2                 Apply a diff file to an original
ii  patchutils         0.3.1-2               Utilities to work with patches
ii  sensible-utils     0.0.2                 Utilities for sensible alternative
ii  strace             4.5.19-2              A system call tracer
ii  subversion         1.6.9dfsg-1           Advanced version control system
ii  unzip              6.0-4                 De-archiver for .zip files
ii  wdiff              0.5-21                Compares two files word by word
ii  wget               1.12-1.1              retrieves files from the web

Versions of packages devscripts suggests:
ii  build-essential               11.4       Informational list of build-essent
pn  cvs-buildpackage              <none>     (no description available)
pn  devscripts-el                 <none>     (no description available)
pn  gnuplot                       <none>     (no description available)
pn  libfile-desktopentry-perl     <none>     (no description available)
pn  libnet-smtp-ssl-perl          <none>     (no description available)
ii  mutt                          1.5.20-7   text-based mailreader supporting M
ii  svn-buildpackage              0.7.1      helper programs to maintain Debian
pn  w3m                           <none>     (no description available)

-- no debconf information

-- 
Chris Butler <chr...@debian.org>
  GnuPG Key ID: 4096R/49E3ACD3
--- debcommit	2010-04-20 21:45:18.000000000 +0100
+++ /usr/bin/debcommit	2010-04-20 21:49:34.000000000 +0100
@@ -334,6 +334,7 @@
 }
 
 my $prog=getprog();
+my $extraparams = '';
 if (! defined $changelog) {
     die "debcommit: Could not find a Debian changelog\n";
 }
@@ -370,13 +371,20 @@
     $message="releasing version $version" if ! defined $message;
 }
 if ($edit) {
-    my $modified = 0;
-    ($message, $modified) = edit($message);
-    die "$progname: Commit message not modified / saved; aborting\n" unless $modified;
+    if ($prog eq 'git')
+    {
+	$extraparams = '-e'
+    }
+    else
+    {    
+	my $modified = 0;
+        ($message, $modified) = edit($message);
+	die "$progname: Commit message not modified / saved; aborting\n" unless $modified;
+    }
 }
 
 if (not $confirm or confirm($message)) {
-    commit($message);
+    commit($message, $extraparams);
     tag($version) if $release;
 }
 
@@ -504,6 +512,7 @@
 
 sub commit {
     my $message=shift;
+    my $extraparams=shift;
 
     die "debcommit: can't specify a list of files to commit when using --all\n"
 	if (@files_to_commit and $all);
@@ -514,8 +523,8 @@
 	    @files_to_commit = ("debian");
 	}
 	$action_rc = $diffmode
-	    ? action($prog, "diff", @files_to_commit)
-	    : action($prog, "commit", "-m", $message, @files_to_commit);
+	    ? action($prog, "diff", $extraparams, @files_to_commit)
+	    : action($prog, "commit", "-m", $message, $extraparams, @files_to_commit);
     }
     elsif ($prog eq 'git') {
 	if (! @files_to_commit && $all) {
@@ -528,12 +537,12 @@
 	    }
 	}
 	if ($diffmode) {
-	    $action_rc = action($prog, "diff", @files_to_commit);
+	    $action_rc = action($prog, "diff", $extraparams, @files_to_commit);
 	} else {
 	    if ($all) {
 		@files_to_commit=("-a")
 	    }
-	    $action_rc = action($prog, "commit", "-m", $message, @files_to_commit);
+	    $action_rc = action($prog, "commit", "-m", $message, $extraparams, @files_to_commit);
 	}
     }
     elsif ($prog eq 'tla' || $prog eq 'baz') {
@@ -554,22 +563,22 @@
 	    (($prog eq 'tla') ? '--' : ()),
 	    @files_to_commit,
 	) if @files_to_commit;
-	$action_rc = action($prog, $diffmode ? "diff" : "commit", @args);
+	$action_rc = action($prog, $diffmode ? "diff" : "commit", $extraparams, @args);
     }
     elsif ($prog eq 'bzr') {
 	if ($diffmode) {
-	    $action_rc = action($prog, "diff", @files_to_commit);
+	    $action_rc = action($prog, "diff", $extraparams, @files_to_commit);
 	} else {
 	    my @fixes_arg = bzr_find_fixes($message);
 	    $action_rc = action($prog, "commit", "-m", $message,
-		@fixes_arg, @files_to_commit);
+		@fixes_arg, $extraparams, @files_to_commit);
 	}
     }
     elsif ($prog eq 'darcs') {
 	if ($diffmode) {
-	    $action_rc = action($prog, "diff", @files_to_commit);
+	    $action_rc = action($prog, "diff", $extraparams, @files_to_commit);
 	} else {
-	    $action_rc = action($prog, "record", "-m", $message, "-a", @files_to_commit);
+	    $action_rc = action($prog, "record", "-m", $message, $extraparams, "-a", @files_to_commit);
 	}
     }
     else {

Reply via email to