Control: tag -1 + patch

On Sat, 30 Mar 2013 18:09:44 -0400, James McCoy wrote:

> > > Please consider adding the package name to the tags created with -r
> > > (at least for git).
> > 
> > debchange does not create (git) tags.
> 
> Ideally, I think debcommit should allow format specifiers for
> constructing the tag, similar to what we do with the hooks in debuild.
> That would have been useful to keep consistent on the style of tagging
> devscripts' releases, by using something like 'v${version}'.

I looked into what git-bp does now: It doesn't add the packagename to
the tag but to the commit message.

I've now put together a quick patch that does the same for debcommit:
add the source package name to commit messages and output messages
for release/tag.

Allowing to specify a format for the tags themselves might also be
nice; maybe we should clone this bug report to have the two issues
separate?

Cheers,
gregor

-- 
 .''`.  Homepage: http://info.comodo.priv.at/ - OpenPGP key 0xBB3A68018649AA06
 : :' : Debian GNU/Linux user, admin, and developer  -  http://www.debian.org/
 `. `'  Member of VIBE!AT & SPI, fellow of the Free Software Foundation Europe
   `-   NP: Paul McCartney: She Said Yeah
--- unpacked/usr/bin/debcommit	2012-11-25 00:51:46.000000000 +0100
+++ /usr/bin/debcommit	2013-03-31 17:10:42.577764263 +0200
@@ -240,6 +240,7 @@
 my $signtags=0;
 my $changelog;
 my $keyid;
+my $package;
 my $version;
 my $onlydebian=0;
 
@@ -358,6 +359,7 @@
 	    die "debcommit: $changelog says it's UNRELEASED\nTry running dch --release first\n";
 	}
 	$version = $log->{Version};
+	$package = $log->{Source};
     }
     else {
 	open (C, "<$changelog" ) || die "debcommit: cannot read $changelog: $!";
@@ -368,10 +370,11 @@
 	close C;
 
 	$version=`dpkg-parsechangelog -l\Q$changelog\E | grep '^Version:' | cut -f 2 -d ' '`;
+	$package=`dpkg-parsechangelog -l\Q$changelog\E | grep '^Source:'  | cut -f 2 -d ' '`;
 	chomp $version;
     }
 
-    $message="releasing version $version" if ! defined $message;
+    $message="releasing package $package version $version" if ! defined $message;
 }
 if ($edit) {
     my $modified = 0;
@@ -381,7 +384,7 @@
 
 if (not $confirm or confirm($message)) {
     commit($message);
-    tag($version) if $release;
+    tag($package, $version) if $release;
 }
 
 # End of code, only subs below
@@ -596,7 +599,7 @@
 }
 
 sub tag {
-    my $tag=shift;
+    my ($package, $tag) = @_;
 
     if ($prog eq 'svn' || $prog eq 'svk') {
 	my $svnpath=`svnpath`;
@@ -605,11 +608,11 @@
 	chomp $tagpath;
 
 	if (! action($prog, "copy", $svnpath, "$tagpath/$tag",
-		     "-m", "tagging version $tag")) {
+		     "-m", "tagging package $package version $tag")) {
 	    if (! action($prog, "mkdir", $tagpath,
 			 "-m", "create tag directory") ||
 		! action($prog, "copy", $svnpath, "$tagpath/$tag",
-			 "-m", "tagging version $tag")) {
+			 "-m", "tagging package $package version $tag")) {
 		die "debcommit: failed tagging with $tag\n";
 	    }
 	}
@@ -658,13 +661,13 @@
 	if ($signtags) {
 		if (defined $keyid) {
 			if (! action($prog, "tag", "-u", $keyid, "-m",
-			             "tagging version $tag", $tag)) {
+			             "tagging package $package version $tag", $tag)) {
 	        		die "debcommit: failed tagging with $tag\n";
 			}
 		}
 		else {
 			if (! action($prog, "tag", "-s", "-m",
-			             "tagging version $tag", $tag)) {
+			             "tagging package $package version $tag", $tag)) {
 	        		die "debcommit: failed tagging with $tag\n";
 			}
 		}
@@ -676,7 +679,7 @@
     elsif ($prog eq 'hg') {
 	$tag=~s/^[0-9]+://; # strip epoch
 	$tag="debian-$tag";
-    	if (! action($prog, "tag", "-m", "tagging version $tag", $tag)) {
+    	if (! action($prog, "tag", "-m", "tagging package $package version $tag", $tag)) {
 	        die "debcommit: failed tagging with $tag\n";
     	}
     }

Attachment: signature.asc
Description: Digital signature

_______________________________________________
devscripts-devel mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/devscripts-devel

Reply via email to