summaryrefslogtreecommitdiff
path: root/v4l/scripts
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
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')
-rwxr-xr-xv4l/scripts/prep_commit_msg.pl55
-rwxr-xr-xv4l/scripts/prepare-ChangeLog.pl31
2 files changed, 36 insertions, 50 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;
diff --git a/v4l/scripts/prepare-ChangeLog.pl b/v4l/scripts/prepare-ChangeLog.pl
index c3b253246..370405dd9 100755
--- a/v4l/scripts/prepare-ChangeLog.pl
+++ b/v4l/scripts/prepare-ChangeLog.pl
@@ -17,6 +17,10 @@
# work with Mercurial
# Updated at 29 August 2005
#
+# Mauro Carvalho Chehab <mchehab@brturbo.com.br>: modified to
+# just generate a changelog entry
+# Updated at 01 January 2006
+##
# (Someone put a license in here, like maybe GPL.)
#
# TODO:
@@ -60,6 +64,8 @@ my $name = $ENV{CHANGE_LOG_NAME};
my $email_address = $ENV{CHANGE_LOG_EMAIL_ADDRESS};
my $login = $ENV{CHANGE_LOG_LOGIN};
+my $outfile = shift || "";
+
if (!defined $name)
{
print STDERR "Please, define env var CHANGE_LOG_NAME.\n";
@@ -76,19 +82,6 @@ if (!defined $login)
exit;
}
-
-
-# Read the old change log file.
-# It's less efficient to read the whole thing into memory than it would be
-# to read it while we prepend to it later, but I like doing this part first.
-#print STDERR " Updating ChangeLog from hg repository.\n";
-#open ERRORS, "hg update ChangeLog |" or die "The hg update of ChangeLog failed: $OS_ERROR.\n";
-#print STDERR " $ARG" while <ERRORS>;
-#close ERRORS;
-open OLD_CHANGE_LOG, "v4l/ChangeLog" or die "Could not open ChangeLog file: $OS_ERROR.\n";
-my @old_change_log = <OLD_CHANGE_LOG>;
-close OLD_CHANGE_LOG;
-
# For each file, build a list of modified lines.
# Use line numbers from the "after" side of each diff.
print STDERR " Running hg diff to find changes.\n";
@@ -97,11 +90,8 @@ my $file;
open DIFF, "hg diff |" or die "The hg diff failed: $OS_ERROR.\n";
while (<DIFF>)
{
-#diff -r faaf1cf8404a video4linux/scripts/prepare-ChangeLog.pl
-# and (/^\d+(,\d+)?[acd](\d+)(,(\d+))?/ or /^Binary files/) )
$file = $1 if /^diff -r .* (\S+)$/;
- if (defined $file
- and $file ne "v4l/ChangeLog" )
+ if (defined $file)
{
push @{$changed_line_ranges{$file}}, [ $2, $4 || $2 ];
}
@@ -173,7 +163,11 @@ my $date = sprintf "%d-%02d-%02d %02d:%02d",
(gmtime $BASETIME)[2], # hour
(gmtime $BASETIME)[1]; # min
-open CHANGE_LOG, "> v4l/ChangeLog" or die "Could not write ChangeLog\n.";
+if ($outfile eq "") {
+ open CHANGE_LOG, ">&STDOUT";
+} else {
+ open CHANGE_LOG, "> $outfile" or die "Could not write to $outfile\n.";
+}
print CHANGE_LOG "$date $login\n\n";
foreach my $file (sort keys %function_lists)
{
@@ -182,7 +176,6 @@ foreach my $file (sort keys %function_lists)
print CHANGE_LOG "$lines\n";
}
print CHANGE_LOG "\n\tSigned-off-by: $name <$email_address>\n";
-print CHANGE_LOG "\n", @old_change_log;
close CHANGE_LOG;
# Done.