tags 381152 patch thanks Hi,
I also find the possibility to tell debcommit what to commit very useful.
Here's a patch that makes debcommit use any additional non-option
arguments as files to check in.
I've also changed the POD and the Usage message.
Note the special handling of 'tla', which requires '--' before the
list of files to commit (according to its manpage; I don't use tla).
Thanks for considering,
dam
--
Damyan Ivanov Modular Software Systems
[EMAIL PROTECTED]
phone +359(2)928-2611, 929-3993 fax +359(2)920-0994
mobile +359(88)856-6067 [EMAIL PROTECTED]
diff -ur devscripts-2.9.27/debcommit.pl devscripts-2.9.27+debcommit-files/debcommit.pl
--- devscripts-2.9.27/debcommit.pl 2006-03-29 18:20:37.000000000 +0300
+++ devscripts-2.9.27+debcommit-files/debcommit.pl 2007-02-02 10:02:28.000000000 +0200
@@ -6,7 +6,7 @@
=head1 SYNOPSIS
-debcommit [--release] [--message=text] [--noact]
+debcommit [--release] [--message=text] [--noact] [files to commit]
=head1 DESCRIPTION
@@ -40,6 +40,10 @@
Do not actually do anything, but do print the commands that would be run.
+=item files to commit
+
+Specify which files to commit. Commits all files if not used.
+
=over 4
=back
@@ -54,11 +58,14 @@
sub usage {
print <<"EOT";
-Usage: $progname [--release] [--message=text] [--noact] [--help ] [--version]
+Usage: $progname [options] [files to commit]
+ $progname --version
+ $progname --help
Generates a commit message based on new text in debian/changelog,
and commit the change to a package\'s repository.
+Options:
--release Commit a release of the package.
--message=text Specify a commit message
--noact Dry run, no actual commits
@@ -88,9 +95,11 @@
"help" => sub { usage(); exit 0; },
"version" => sub { version(); exit 0; },
)) {
- die "Usage: debcommit [--release] [--message=text] [--noact]\n";
+ die "Usage: debcommit [--release] [--message=text] [--noact] [files to commit]\n";
}
+my @files_to_commit = @ARGV;
+
my $prog=getprog();
if (! -e "debian/changelog") {
die "debcommit: cannot find debian/changelog\n";
@@ -162,12 +171,12 @@
my $message=shift;
if ($prog eq 'cvs' || $prog eq 'svn' || $prog eq 'svk' || $prog eq 'bzr') {
- if (! action($prog, "commit", "-m", $message)) {
+ if (! action($prog, "commit", "-m", $message, @files_to_commit)) {
die "debcommit: commit failed\n";
}
}
elsif ($prog eq 'git') {
- if (! action($prog, "commit", "-a", "-m", $message)) {
+ if (! action($prog, "commit", "-a", "-m", $message, @files_to_commit)) {
die "debcommit: commit failed\n";
}
}
@@ -182,6 +191,12 @@
$summary=~s/^\* //s;
@args=("-s", "$summary ...", "-L", $message);
}
+ push(
+ @args,
+ (($prog eq 'tla') ? '--' : ()),
+ @files_to_commit,
+ ) if @files_to_commit;
+
if (! action($prog, "commit", @args)) {
die "debcommit: commit failed\n";
}
signature.asc
Description: OpenPGP digital signature

