All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Nieuwenhuizen <janneke-list@xs4all.nl>
To: git@vger.kernel.org
Subject: [PATCH] git-svn.perl: Strip ChangeLog bits.
Date: Sat, 02 Aug 2008 15:42:29 +0200	[thread overview]
Message-ID: <1217684549.8296.10.camel@heerbeest> (raw)

Some projects write ChangeLog entries and use those for svn
commit messages.  Converting such a repository makes for
a most uninteresting git log --pretty=oneline output.

    482cfc6... 2008-08-01  Kohei Yoshida  <kyoshida@novell.com>
    90c16d7... 2008-08-01  Fong Lin  <pflin@novell.com> 	* patches/dev300/cws-npow
    505fc23... 2008-08-01  Kohei Yoshida  <kyoshida@novell.com>
    4729379... 2008-08-01  Kohei Yoshida  <kyoshida@novell.com>
    9e34b85... 2008-07-31  Kohei Yoshida  <kyoshida@novell.com>
    ee1855a... 2008-07-31  Jan Nieuwenhuizen  <janneke@gnu.org>
    518b921... 2008-07-31  Miklos Vajna  <vmiklos@frugalware.org>

The --cut-changelog-bits fixes this

    44e7784... patches/dev300/apply: added upstream issue numbers to some of my  p
    1a19026... patches/dev300/cws-npower11.diff: Add vba events stuff.
    7422531... patches/test/calc-external-defined-names.diff: more progress; make 
    66c5975... scratch/sc-xlsutil/src/formula.py:
    307fa53... patches/dev300/chart-subtitle-xls-export.diff: preserve the subtitl
    0d127af... patches/dev300/layout-simple-dialogs-toolkit.diff: Remove duplicate
    843d41e... patches/dev300/apply: Remove gcc401-stlport45-include.diff from Fru

partly.  I tried removing the file name bits too, but that makeslog
entries that touch multiple files almost useless.


Signed-off-by: Jan Nieuwenhuizen <Jan Nieuwenhuizen janneke@gnu.org>
---
 git-svn.perl |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/git-svn.perl b/git-svn.perl
index cf6dbbc..651739a 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -66,7 +66,7 @@ my ($_stdin, $_help, $_edit,
 	$_version, $_fetch_all, $_no_rebase,
 	$_merge, $_strategy, $_dry_run, $_local,
 	$_prefix, $_no_checkout, $_url, $_verbose,
-	$_git_format);
+	$_git_format, $_cut_changelog_bits);
 $Git::SVN::_follow_parent = 1;
 my %remote_opts = ( 'username=s' => \$Git::SVN::Prompt::_username,
                     'config-dir=s' => \$Git::SVN::Ra::config_dir,
@@ -109,9 +109,11 @@ my %cmd = (
 	fetch => [ \&cmd_fetch, "Download new revisions from SVN",
 			{ 'revision|r=s' => \$_revision,
 			  'fetch-all|all' => \$_fetch_all,
+			  'cut-changelog-bits' => \$_cut_changelog_bits,
 			   %fc_opts } ],
 	clone => [ \&cmd_clone, "Initialize and fetch revisions",
 			{ 'revision|r=s' => \$_revision,
+			  'cut-changelog-bits' => \$_cut_changelog_bits,
 			   %fc_opts, %init_opts } ],
 	init => [ \&cmd_init, "Initialize a repo for tracking" .
 			  " (requires URL argument)",
@@ -2463,6 +2465,13 @@ sub make_log_entry {
 	close $un or croak $!;
 
 	$log_entry{date} = parse_svn_date($log_entry{date});
+	if (defined $_cut_changelog_bits) {
+	    $log_entry{log} =~ s/(^|\n)\s*((\n|\s)*(199[0-9]|
20[0-1][0-9])(-[0-9]{2}){2}\s+.*<.*>\s*\n\s+)?/$1/g;
+	    $log_entry{log} =~ s/(^|\n)\* /\n$1/g;
+	    $log_entry{log} =~ s/^[\n\s]*//;
+	    $log_entry{log} =~ s/\n\s*/ /g if length ($log_entry{log}) < 81;
+	    $log_entry{log} .= "\n";
+	}
 	$log_entry{log} .= "\n";
 	my $author = $log_entry{author} = check_author($log_entry{author});
 	my ($name, $email) = defined $::users{$author} ? @{$::users{$author}}
-- 
1.6.0.rc0.44.g67270


-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond - The music typesetter
http://www.xs4all.nl/~jantien       | http://www.lilypond.org

             reply	other threads:[~2008-08-02 14:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-02 13:42 Jan Nieuwenhuizen [this message]
2008-08-02 17:27 ` [PATCH] git-svn.perl: Strip ChangeLog bits Petr Baudis
2008-08-02 17:36   ` Junio C Hamano
2008-08-02 18:17     ` Jan Nieuwenhuizen
2008-08-02 21:13       ` Junio C Hamano
2008-08-03 12:07         ` Jan Nieuwenhuizen
2008-08-03 20:45           ` Junio C Hamano
2008-08-04  8:07             ` Jan Nieuwenhuizen
2008-08-04  2:09       ` Eric Wong
2008-08-04  2:45         ` Junio C Hamano
2008-08-04  7:49         ` Jan Nieuwenhuizen
2008-08-04  9:03           ` Eric Wong
2008-08-04 11:30             ` Jan Nieuwenhuizen
2008-08-02 18:21   ` Jan Nieuwenhuizen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1217684549.8296.10.camel@heerbeest \
    --to=janneke-list@xs4all.nl \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.