summaryrefslogtreecommitdiff
path: root/v4l/scripts/prep_commit_msg.pl
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2006-01-29 14:56:06 -0200
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-01-29 14:56:06 -0200
commit5ca53de82657edb7d0212c7b235f0360e382df00 (patch)
tree924703749e1a65c73b28ff67724a55080df93c9a /v4l/scripts/prep_commit_msg.pl
parentc7c364220f2c55cb827142e67388a07eb6012e74 (diff)
downloadmediapointer-dvb-s2-5ca53de82657edb7d0212c7b235f0360e382df00.tar.gz
mediapointer-dvb-s2-5ca53de82657edb7d0212c7b235f0360e382df00.tar.bz2
ChangeLog file removed from v4l-dvb Mercurial tree
From: Mauro Carvalho Chehab <mchehab@infradead.org> - This patch removes ChangeLog file. with Mercurial, it can be generated any time by running hg logs -v. - Makefile and prep_commit_msg.pl updated to work without ChangeLog. - Removed/Adapted instructions on README.HG about ChangeLog. - prepare-Changelog.pl changed to just report one line. This might help people to identify functions that were changed by a patchset. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'v4l/scripts/prep_commit_msg.pl')
-rwxr-xr-xv4l/scripts/prep_commit_msg.pl55
1 files changed, 24 insertions, 31 deletions
diff --git a/v4l/scripts/prep_commit_msg.pl b/v4l/scripts/prep_commit_msg.pl
index 239fb6092..9c4447313 100755
--- a/v4l/scripts/prep_commit_msg.pl
+++ b/v4l/scripts/prep_commit_msg.pl
@@ -1,41 +1,34 @@
#!/usr/bin/perl
$f=shift;
-open IN,"<$f";
+open IN,"hg diff|diffstat -p1 |";
my $n=2;
my $from="";
my $first="";
my $changed="";
$out="";
while (<IN>) {
- if (m/^[0-9]/) {
- $n--;
- next;
- }
- if ($n>0) {
- s/[\t -]*//;
- if (m/^\* (.*):/) {
- $changed="#\t$1\n$changed";
- } else {
- if ($first eq "") {
- if ($_ eq "\n") {
- next;
- }
- $first="$_";
- next;
- }
- if ($from eq "") {
- if (m/Signed-off-by:/) {
- $from = $_;
- $from =~ s/Signed-off-by/From/;
- $first="$first\n#\n# Then From line\n$from\n";
- }
- }
- $out="$out$_";
- }
- }
+ $changed="$changed#$_";
}
-printf "#Added/removed/changed files:\n%s" .
- "# First line should be the subject, without Subject:\n%s" .
- "# Then a detailed description followed by Signed-off-by: fields:\n%s",
- $changed,$first,$out;
+
+my $user = $ENV{HGUSER};
+
+if ( $user eq "" ) {
+ my $name = $ENV{CHANGE_LOG_NAME};
+ my $email = $ENV{CHANGE_LOG_EMAIL_ADDRESS};
+
+ $user="$name <$email>";
+}
+
+$first= "# Please change bellow if you are not patch author\n#\nFrom: $user";
+$out= "# At the end Signed-off-by: fields by patch author and commiter, at least\n#\nSigned-off-by: $user";
+$from= "From: $user";
+
+printf "#Added/removed/changed files:\n%s#\n" .
+ "# For better log display, please keep a blank line after subject, after from\n" .
+ "# and before signed-off-by\n" .
+ "# First line should be the subject, without Subject:\n#\n\n\n" .
+ "# Now, patch author (just the main one), on a From: field\n" .
+ "# Please change bellow if the commiter is not the patch author\n#\n%s\n\n" .
+ "# Then a detailed description:\n\n\n%s",
+ $changed,$from,$out;