{"thread":{"id":"14809","subject":"[PATCH] git-svn.perl: Strip ChangeLog bits.","startedAt":"2008-08-02T13:42:29Z","lastAt":"2008-08-04T11:30:05Z","messageCount":14,"participants":["Jan Nieuwenhuizen","Petr Baudis","Junio C Hamano","Eric Wong"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"85979","messageId":"1217684549.8296.10.camel@heerbeest","threadId":"14809","inReplyTo":null,"subject":"[PATCH] git-svn.perl: Strip ChangeLog bits.","fromName":"Jan Nieuwenhuizen","fromEmail":"janneke-list@xs4all.nl","sentAt":"2008-08-02T13:42:29Z","receivedAt":"2008-08-02T13:42:29Z","isPatch":true,"sender":{"key":"janneke-list@xs4all.nl","avatar":null},"body":"Some projects write ChangeLog entries and use those for svn\ncommit messages.  Converting such a repository makes for\na most uninteresting git log --pretty=oneline output.\n\n    482cfc6... 2008-08-01  Kohei Yoshida  <kyoshida@novell.com>\n    90c16d7... 2008-08-01  Fong Lin  <pflin@novell.com> \t* patches/dev300/cws-npow\n    505fc23... 2008-08-01  Kohei Yoshida  <kyoshida@novell.com>\n    4729379... 2008-08-01  Kohei Yoshida  <kyoshida@novell.com>\n    9e34b85... 2008-07-31  Kohei Yoshida  <kyoshida@novell.com>\n    ee1855a... 2008-07-31  Jan Nieuwenhuizen  <janneke@gnu.org>\n    518b921... 2008-07-31  Miklos Vajna  <vmiklos@frugalware.org>\n\nThe --cut-changelog-bits fixes this\n\n    44e7784... patches/dev300/apply: added upstream issue numbers to some of my  p\n    1a19026... patches/dev300/cws-npower11.diff: Add vba events stuff.\n    7422531... patches/test/calc-external-defined-names.diff: more progress; make \n    66c5975... scratch/sc-xlsutil/src/formula.py:\n    307fa53... patches/dev300/chart-subtitle-xls-export.diff: preserve the subtitl\n    0d127af... patches/dev300/layout-simple-dialogs-toolkit.diff: Remove duplicate\n    843d41e... patches/dev300/apply: Remove gcc401-stlport45-include.diff from Fru\n\npartly.  I tried removing the file name bits too, but that makeslog\nentries that touch multiple files almost useless.\n\n\nSigned-off-by: Jan Nieuwenhuizen <Jan Nieuwenhuizen janneke@gnu.org>\n---\n git-svn.perl |   11 ++++++++++-\n 1 files changed, 10 insertions(+), 1 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex cf6dbbc..651739a 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -66,7 +66,7 @@ my ($_stdin, $_help, $_edit,\n \t$_version, $_fetch_all, $_no_rebase,\n \t$_merge, $_strategy, $_dry_run, $_local,\n \t$_prefix, $_no_checkout, $_url, $_verbose,\n-\t$_git_format);\n+\t$_git_format, $_cut_changelog_bits);\n $Git::SVN::_follow_parent = 1;\n my %remote_opts = ( 'username=s' => \\$Git::SVN::Prompt::_username,\n                     'config-dir=s' => \\$Git::SVN::Ra::config_dir,\n@@ -109,9 +109,11 @@ my %cmd = (\n \tfetch => [ \\&cmd_fetch, \"Download new revisions from SVN\",\n \t\t\t{ 'revision|r=s' => \\$_revision,\n \t\t\t  'fetch-all|all' => \\$_fetch_all,\n+\t\t\t  'cut-changelog-bits' => \\$_cut_changelog_bits,\n \t\t\t   %fc_opts } ],\n \tclone => [ \\&cmd_clone, \"Initialize and fetch revisions\",\n \t\t\t{ 'revision|r=s' => \\$_revision,\n+\t\t\t  'cut-changelog-bits' => \\$_cut_changelog_bits,\n \t\t\t   %fc_opts, %init_opts } ],\n \tinit => [ \\&cmd_init, \"Initialize a repo for tracking\" .\n \t\t\t  \" (requires URL argument)\",\n@@ -2463,6 +2465,13 @@ sub make_log_entry {\n \tclose $un or croak $!;\n \n \t$log_entry{date} = parse_svn_date($log_entry{date});\n+\tif (defined $_cut_changelog_bits) {\n+\t    $log_entry{log} =~ s/(^|\\n)\\s*((\\n|\\s)*(199[0-9]|\n20[0-1][0-9])(-[0-9]{2}){2}\\s+.*<.*>\\s*\\n\\s+)?/$1/g;\n+\t    $log_entry{log} =~ s/(^|\\n)\\* /\\n$1/g;\n+\t    $log_entry{log} =~ s/^[\\n\\s]*//;\n+\t    $log_entry{log} =~ s/\\n\\s*/ /g if length ($log_entry{log}) < 81;\n+\t    $log_entry{log} .= \"\\n\";\n+\t}\n \t$log_entry{log} .= \"\\n\";\n \tmy $author = $log_entry{author} = check_author($log_entry{author});\n \tmy ($name, $email) = defined $::users{$author} ? @{$::users{$author}}\n-- \n1.6.0.rc0.44.g67270\n\n\n-- \nJan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond - The music typesetter\nhttp://www.xs4all.nl/~jantien       | http://www.lilypond.org\n"},{"id":"85990","messageId":"20080802172742.GT32184@machine.or.cz","threadId":"14809","inReplyTo":"1217684549.8296.10.camel@heerbeest","subject":"Re: [PATCH] git-svn.perl: Strip ChangeLog bits.","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2008-08-02T17:27:42Z","receivedAt":"2008-08-02T17:27:42Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"  Hi!\n\nOn Sat, Aug 02, 2008 at 03:42:29PM +0200, Jan Nieuwenhuizen wrote:\n> Signed-off-by: Jan Nieuwenhuizen <Jan Nieuwenhuizen janneke@gnu.org>\n\n  Just your email should be within the <> brackets.\n\n> ---\n>  git-svn.perl |   11 ++++++++++-\n>  1 files changed, 10 insertions(+), 1 deletions(-)\n\n  You forgot to document your option. (And possibly write a testcase.)\n\n\t\t\t\tPetr \"Pasky\" Baudis\n"},{"id":"85992","messageId":"7vfxpnnwt5.fsf@gitster.siamese.dyndns.org","threadId":"14809","inReplyTo":"20080802172742.GT32184@machine.or.cz","subject":"Re: [PATCH] git-svn.perl: Strip ChangeLog bits.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-02T17:36:38Z","receivedAt":"2008-08-02T17:36:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Petr Baudis <pasky@suse.cz> writes:\n\n>   Hi!\n>\n> On Sat, Aug 02, 2008 at 03:42:29PM +0200, Jan Nieuwenhuizen wrote:\n>> Signed-off-by: Jan Nieuwenhuizen <Jan Nieuwenhuizen janneke@gnu.org>\n>\n>   Just your email should be within the <> brackets.\n>\n>> ---\n>>  git-svn.perl |   11 ++++++++++-\n>>  1 files changed, 10 insertions(+), 1 deletions(-)\n>\n>   You forgot to document your option. (And possibly write a testcase.)\n\nI am not sure if this is generic enough to be in git-svn.perl itself, or\nperhaps there should be a hook make_log_entry() would call in the form of\nsome Perl scriptlet given by the user to munge $log_entry{log}, which\nwould be very specific to each project.\n"},{"id":"85997","messageId":"1217701021.8296.35.camel@heerbeest","threadId":"14809","inReplyTo":"7vfxpnnwt5.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] git-svn.perl: Strip ChangeLog bits.","fromName":"Jan Nieuwenhuizen","fromEmail":"janneke-list@xs4all.nl","sentAt":"2008-08-02T18:17:01Z","receivedAt":"2008-08-02T18:17:01Z","isPatch":true,"sender":{"key":"janneke-list@xs4all.nl","avatar":null},"body":"On za, 2008-08-02 at 10:36 -0700, Junio C Hamano wrote:\n\n> >   You forgot to document your option. (And possibly write a testcase.)\n> \n> I am not sure if this is generic enough to be in git-svn.perl itself, or\n> perhaps there should be a hook make_log_entry() would call in the form of\n> some Perl scriptlet given by the user to munge $log_entry{log}, which\n> would be very specific to each project.\n\nIf you're not sure, please make up your mind.  I agree it's quite a hack\nbut now it's in the archives for others to find.  Doing this in a single\nregexp is a bit tricky and asking a user to write a perl snippet is even\nworse, imho.  Especially if would turn out that stripping changelog bits\nis the only thing that the hook is getting used for, in the end.  I have\ngotten more careful to provide generic solutions to specific problems in\nanticipation of possible future desires.\n\nI could imagine that leaving git-svn alone and adding a hook to git-log\nwould be more useful, though.\n\nJan.\n\n-- \nJan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond - The music typesetter\nhttp://www.xs4all.nl/~jantien       | http://www.lilypond.org\n"},{"id":"85998","messageId":"1217701308.8296.39.camel@heerbeest","threadId":"14809","inReplyTo":"20080802172742.GT32184@machine.or.cz","subject":"Re: [PATCH] git-svn.perl: Strip ChangeLog bits.","fromName":"Jan Nieuwenhuizen","fromEmail":"janneke-list@xs4all.nl","sentAt":"2008-08-02T18:21:48Z","receivedAt":"2008-08-02T18:21:48Z","isPatch":true,"sender":{"key":"janneke-list@xs4all.nl","avatar":null},"body":"On za, 2008-08-02 at 19:27 +0200, Petr Baudis wrote:\n\n> On Sat, Aug 02, 2008 at 03:42:29PM +0200, Jan Nieuwenhuizen wrote:\n> > Signed-off-by: Jan Nieuwenhuizen <Jan Nieuwenhuizen janneke@gnu.org>\n> \n>   Just your email should be within the <> brackets.\n\nOops :-)  I have\n\n    EMAIL='Jan Nieuwenhuizen <janneke@gnu.org>'\n\nso I should probably use GIT_EMAIL='janneke@gnu.org' or something.  I'll\nhave a look.\n\nJan.\n\n-- \nJan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond - The music typesetter\nhttp://www.xs4all.nl/~jantien       | http://www.lilypond.org\n"},{"id":"86016","messageId":"7v4p63dstc.fsf@gitster.siamese.dyndns.org","threadId":"14809","inReplyTo":"1217701021.8296.35.camel@heerbeest","subject":"Re: [PATCH] git-svn.perl: Strip ChangeLog bits.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-02T21:13:03Z","receivedAt":"2008-08-02T21:13:03Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jan Nieuwenhuizen <janneke-list@xs4all.nl> writes:\n\n> On za, 2008-08-02 at 10:36 -0700, Junio C Hamano wrote:\n>\n>> >   You forgot to document your option. (And possibly write a testcase.)\n>> \n>> I am not sure if this is generic enough to be in git-svn.perl itself, or\n>> perhaps there should be a hook make_log_entry() would call in the form of\n>> some Perl scriptlet given by the user to munge $log_entry{log}, which\n>> would be very specific to each project.\n>\n> If you're not sure, please make up your mind.\n\nThat's something you would say when I cannot decide the color of\nbikeshed.  I do not think your change falls into that category.\n\nWe could add an ad-hoc preprocessing option like this, and keep adding\nmore for different patterns, and at certain point we may be fed up with\nmillions of such options and try to introduce a more generic mechanism.\nWhile doing so, the resulting code needs to support the ad-hoc ones that\nare added earlier, forever.\n\nWe've done that in the past with other commands (cc-suppression scheme in\nsend-email comes to mind).  It was very unpleasant.\n\n> ...  Doing this in a single\n> regexp is a bit tricky and asking a user to write a perl snippet is even\n> worse, imho.\n\nWhat you are saying is that a built-in one, no matter what, won't be\nsufficient for many projects.  Unless a user writes Perl snippet to match\nhis project's needs, the noise at the beginning of the log won't be\nstripped for him.\n\nThat's fine.  I do not expect a single built-in transformation would fit\neverybody's needs.  I am not asking for miracles.\n\nBut you could at least keep the door open for people who are _willing_ to\nwrite such transformation for their projects, right?\n\nFor one thing, your --cut-changelog-bits has one fixed pattern.  Later\npeople either have to come up with different option, or modify your\npattern (potentially breaking your project).  Neither is good.\n\nPerhaps doing something like this a (admittedly slightly) better option?\nIt allows you to choose from a canned set, or give a series of s///\nrewriting rules (or whatever you would want to have in the custom function)..\n\n---\n\n git-svn.perl |   34 +++++++++++++++++++++++++++++++++-\n 1 files changed, 33 insertions(+), 1 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex cf6dbbc..eaf6a56 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -66,7 +66,7 @@ my ($_stdin, $_help, $_edit,\n \t$_version, $_fetch_all, $_no_rebase,\n \t$_merge, $_strategy, $_dry_run, $_local,\n \t$_prefix, $_no_checkout, $_url, $_verbose,\n-\t$_git_format);\n+\t$_git_format, $_clean_changelog, $_clean_log_message);\n $Git::SVN::_follow_parent = 1;\n my %remote_opts = ( 'username=s' => \\$Git::SVN::Prompt::_username,\n                     'config-dir=s' => \\$Git::SVN::Ra::config_dir,\n@@ -109,9 +109,11 @@ my %cmd = (\n \tfetch => [ \\&cmd_fetch, \"Download new revisions from SVN\",\n \t\t\t{ 'revision|r=s' => \\$_revision,\n \t\t\t  'fetch-all|all' => \\$_fetch_all,\n+\t\t\t  'clean-changelog=s' => \\$_clean_changelog,\n \t\t\t   %fc_opts } ],\n \tclone => [ \\&cmd_clone, \"Initialize and fetch revisions\",\n \t\t\t{ 'revision|r=s' => \\$_revision,\n+\t\t\t  'clean-changelog=s' => \\$_clean_changelog,\n \t\t\t   %fc_opts, %init_opts } ],\n \tinit => [ \\&cmd_init, \"Initialize a repo for tracking\" .\n \t\t\t  \" (requires URL argument)\",\n@@ -238,6 +240,33 @@ my $rv = GetOptions(%opts, 'help|H|h' => \\$_help, 'version|V' => \\$_version,\n                        $Git::SVN::default_repo_id = $_[1] });\n exit 1 if (!$rv && $cmd && $cmd ne 'log');\n \n+my %canned_changelog_cleaner =\n+(\n+ 'ooo' => sub {\n+\t local ($_) = @_;\n+\t s/(^|\\n)\\s*((\\n|\\s)*(199[0-9]|20[0-1][0-9])(-[0-9]{2}){2}\\s+.*<.*>\\s*\\n\\s+)?/$1/g;\n+\t s/(^|\\n)\\* /\\n$1/g;\n+\t s/^[\\n\\s]*//;\n+\t s/\\n\\s*/ /g if length ($_) < 81;\n+\t \"\\n\";\n+ }\n+);\n+\n+if (defined $_clean_changelog) {\n+\tif (exists $canned_changelog_cleaner{$_clean_changelog}) {\n+\t\t$_clean_log_message = $canned_changelog_cleaner{$_clean_changelog};\n+\t} elsif ($_clean_changelog ne '') {\n+\t\t$_clean_log_message = eval \"\n+\t\t\tsub { local(\\$_) = \\@_; $_clean_changelog; return \\$_; }\n+\t\t\";\n+\t\tif ($@) {\n+\t\t\tdie \"$!: $_clean_changelog\";\n+\t\t}\n+\t} else {\n+\t\tdie \"$_clean_changelog: unknown way to clean log message\";\n+\t}\n+}\n+\n usage(0) if $_help;\n version() if $_version;\n usage(1) unless defined $cmd;\n@@ -2463,6 +2492,9 @@ sub make_log_entry {\n \tclose $un or croak $!;\n \n \t$log_entry{date} = parse_svn_date($log_entry{date});\n+\tif ($_clean_log_message) {\n+\t\t$log_entry{log} = $_clean_log_message->($log_entry{log});\n+\t}\n \t$log_entry{log} .= \"\\n\";\n \tmy $author = $log_entry{author} = check_author($log_entry{author});\n \tmy ($name, $email) = defined $::users{$author} ? @{$::users{$author}}\n"},{"id":"86068","messageId":"1217765241.6178.11.camel@heerbeest","threadId":"14809","inReplyTo":"7v4p63dstc.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] git-svn.perl: Strip ChangeLog bits.","fromName":"Jan Nieuwenhuizen","fromEmail":"janneke-list@xs4all.nl","sentAt":"2008-08-03T12:07:21Z","receivedAt":"2008-08-03T12:07:21Z","isPatch":true,"sender":{"key":"janneke-list@xs4all.nl","avatar":null},"body":"On za, 2008-08-02 at 14:13 -0700, Junio C Hamano wrote:\n\n> Perhaps doing something like this a (admittedly slightly) better option?\n> It allows you to choose from a canned set, or give a series of s///\n> rewriting rules (or whatever you would want to have in the custom function)..\n\nYes, this is (a bit) much nicer, thanks.\n\nI fixed the function to actually return the log entry, renamed it to\n'gnu', as it--although this is ooo's silly convention--is a GNU style\nChangeLog that is being stripped, added it to the 'rebase' command,\nadded some doco and a test.\n\nJan.\n\n\nSigned-off-by: Jan Nieuwenhuizen <janneke@gnu.org>\n---\n Documentation/RelNotes-1.6.0.txt   |    3 +\n Documentation/git-svn.txt          |    4 +\n git-svn.perl                       |   36 ++++++++-\n t/t9125-git-svn-clean-changelog.sh |  171 ++++++++++++++++++++++++++++++++++++\n 4 files changed, 213 insertions(+), 1 deletions(-)\n create mode 100644 t/t9125-git-svn-clean-changelog.sh\n\ndiff --git a/Documentation/RelNotes-1.6.0.txt b/Documentation/RelNotes-1.6.0.txt\nindex 2542cf5..917b05a 100644\n--- a/Documentation/RelNotes-1.6.0.txt\n+++ b/Documentation/RelNotes-1.6.0.txt\n@@ -206,6 +206,9 @@ Updates since v1.5.6\n * \"git-svn dcommit\" is now aware of auto-props setting the subversion user\n   has.\n \n+* git-svn can process changelog entries in order to produce nicer\n+  commit messages with the new option --clean-changelog=gnu.\n+\n * You can tell \"git status -u\" to even more aggressively omit checking\n   untracked files with --untracked-files=no.\n \ndiff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt\nindex f230125..653d1fc 100644\n--- a/Documentation/git-svn.txt\n+++ b/Documentation/git-svn.txt\n@@ -118,6 +118,10 @@ accept.  However, '--fetch-all' only fetches from the current\n Like 'git-rebase'; this requires that the working tree be clean\n and have no uncommitted changes.\n \n+--clean-changelog=gnu;;\n+\tManipulate SVN commit log messages to produce clean commit\n+\tmessages.  Supported formats are: 'gnu', which strips\n+\tGNU ChangeLog bits.\n -l;;\n --local;;\n \tDo not fetch remotely; only run 'git-rebase' against the\ndiff --git a/git-svn.perl b/git-svn.perl\nindex cf6dbbc..fe4d147 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -66,7 +66,7 @@ my ($_stdin, $_help, $_edit,\n \t$_version, $_fetch_all, $_no_rebase,\n \t$_merge, $_strategy, $_dry_run, $_local,\n \t$_prefix, $_no_checkout, $_url, $_verbose,\n-\t$_git_format);\n+\t$_git_format, $_clean_changelog, $_clean_log_message);\n $Git::SVN::_follow_parent = 1;\n my %remote_opts = ( 'username=s' => \\$Git::SVN::Prompt::_username,\n                     'config-dir=s' => \\$Git::SVN::Ra::config_dir,\n@@ -109,9 +109,11 @@ my %cmd = (\n \tfetch => [ \\&cmd_fetch, \"Download new revisions from SVN\",\n \t\t\t{ 'revision|r=s' => \\$_revision,\n \t\t\t  'fetch-all|all' => \\$_fetch_all,\n+\t\t\t  'clean-changelog=s' => \\$_clean_changelog,\n \t\t\t   %fc_opts } ],\n \tclone => [ \\&cmd_clone, \"Initialize and fetch revisions\",\n \t\t\t{ 'revision|r=s' => \\$_revision,\n+\t\t\t  'clean-changelog=s' => \\$_clean_changelog,\n \t\t\t   %fc_opts, %init_opts } ],\n \tinit => [ \\&cmd_init, \"Initialize a repo for tracking\" .\n \t\t\t  \" (requires URL argument)\",\n@@ -178,6 +180,7 @@ my %cmd = (\n \t\t\t  'local|l' => \\$_local,\n \t\t\t  'fetch-all|all' => \\$_fetch_all,\n \t\t\t  'dry-run|n' => \\$_dry_run,\n+\t\t\t  'clean-changelog=s' => \\$_clean_changelog,\n \t\t\t  %fc_opts } ],\n \t'commit-diff' => [ \\&cmd_commit_diff,\n \t                   'Commit a diff between two trees',\n@@ -238,6 +241,34 @@ my $rv = GetOptions(%opts, 'help|H|h' => \\$_help, 'version|V' => \\$_version,\n                        $Git::SVN::default_repo_id = $_[1] });\n exit 1 if (!$rv && $cmd && $cmd ne 'log');\n \n+my %canned_changelog_cleaner =\n+(\n+ 'gnu' => sub {\n+\t local ($_) = @_;\n+\t s/(^|\\n)\\s*((\\n|\\s)*(199[0-9]|20[0-1][0-9])(-[0-9]{2}){2}\\s+.*<.*>\\s*\\n\\s+)?/$1/g;\n+\t s/(^|\\n)\\* /\\n$1/g;\n+\t s/^[\\n\\s]*//;\n+\t s/[\\n\\s]*$//;\n+\t s/\\n\\s*/ /g if length ($_) < 81;\n+\t $_ . \"\\n\";\n+ }\n+);\n+\n+if (defined $_clean_changelog) {\n+\tif (exists $canned_changelog_cleaner{$_clean_changelog}) {\n+\t\t$_clean_log_message = $canned_changelog_cleaner{$_clean_changelog};\n+\t} elsif ($_clean_changelog ne '') {\n+\t\t$_clean_log_message = eval \"\n+\t\t\tsub { local(\\$_) = \\@_; $_clean_changelog; return \\$_; }\n+\t\t\";\n+\t\tif ($@) {\n+\t\t\tdie \"$!: $_clean_changelog\";\n+\t\t}\n+\t} else {\n+\t\tdie \"$_clean_changelog: unknown way to clean log message\";\n+\t}\n+}\n+\n usage(0) if $_help;\n version() if $_version;\n usage(1) unless defined $cmd;\n@@ -2463,6 +2494,9 @@ sub make_log_entry {\n \tclose $un or croak $!;\n \n \t$log_entry{date} = parse_svn_date($log_entry{date});\n+\tif ($_clean_log_message) {\n+\t\t$log_entry{log} = $_clean_log_message->($log_entry{log});\n+\t}\n \t$log_entry{log} .= \"\\n\";\n \tmy $author = $log_entry{author} = check_author($log_entry{author});\n \tmy ($name, $email) = defined $::users{$author} ? @{$::users{$author}}\ndiff --git a/t/t9125-git-svn-clean-changelog.sh b/t/t9125-git-svn-clean-changelog.sh\nnew file mode 100644\nindex 0000000..1a7c5e1\n--- /dev/null\n+++ b/t/t9125-git-svn-clean-changelog.sh\n@@ -0,0 +1,171 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2008 Jan Nieuwenhuizen <janneke@gnu.org>\n+\n+test_description='git-svn fetch --clean-changelog'\n+\n+. ./lib-git-svn.sh\n+\n+cat > dumpfile.svn <<EOF\n+SVN-fs-dump-format-version: 2\n+\n+UUID: 3e54420c-6148-11dd-bf80-b901c556354a\n+\n+Revision-number: 0\n+Prop-content-length: 56\n+Content-length: 56\n+\n+K 8\n+svn:date\n+V 27\n+2008-08-03T10:38:00.279529Z\n+PROPS-END\n+\n+Revision-number: 1\n+Prop-content-length: 231\n+Content-length: 231\n+\n+K 7\n+svn:log\n+V 128\n+2008-08-03  Jan Nieuwenhuizen  <janneke@gnu.org>\n+\n+\t* one: New file.  This adds the \\`one' file to the svn\n+          repository.\n+\n+\n+K 10\n+svn:author\n+V 7\n+janneke\n+K 8\n+svn:date\n+V 27\n+2008-08-03T10:42:21.211246Z\n+PROPS-END\n+\n+Node-path: one\n+Node-kind: file\n+Node-action: add\n+Prop-content-length: 10\n+Text-content-length: 4\n+Text-content-md5: 5bbf5a52328e7439ae6e719dfe712200\n+Content-length: 14\n+\n+PROPS-END\n+one\n+\n+\n+Revision-number: 2\n+Prop-content-length: 217\n+Content-length: 217\n+\n+K 7\n+svn:log\n+V 114\n+2008-08-03  Jan Nieuwenhuizen  <janneke@gnu.org>\n+\n+\t* one: Change to numeral.\n+\t* /path/to/two (foo, bar): Update.\n+\n+\n+K 10\n+svn:author\n+V 7\n+janneke\n+K 8\n+svn:date\n+V 27\n+2008-08-03T10:47:11.023749Z\n+PROPS-END\n+\n+Node-path: one\n+Node-kind: file\n+Node-action: change\n+Text-content-length: 2\n+Text-content-md5: b026324c6904b2a9cb4b88d6d61c81d1\n+Content-length: 2\n+\n+1\n+\n+\n+Node-path: two\n+Node-kind: file\n+Node-action: add\n+Prop-content-length: 10\n+Text-content-length: 4\n+Text-content-md5: c193497a1a06b2c72230e6146ff47080\n+Content-length: 14\n+\n+PROPS-END\n+two\n+\n+\n+Revision-number: 3\n+Prop-content-length: 192\n+Content-length: 192\n+\n+K 7\n+svn:log\n+V 90\n+    * three: Add yet another commit that is too long to fit on one\n+line, i.e., 81 chars.\n+\n+\n+K 10\n+svn:author\n+V 7\n+janneke\n+K 8\n+svn:date\n+V 27\n+2008-08-03T10:51:21.214317Z\n+PROPS-END\n+\n+Node-path: three\n+Node-kind: file\n+Node-action: add\n+Prop-content-length: 10\n+Text-content-length: 6\n+Text-content-md5: febe6995bad457991331348f7b9c85fa\n+Content-length: 16\n+\n+PROPS-END\n+three\n+\n+\n+EOF\n+\n+test_expect_success 'load svn dumpfile' 'svnadmin load \"$PWD/svnrepo\" < dumpfile.svn'\n+test_expect_success 'clone revision from svn' 'git-svn clone --clean-changelog=gnu -r0 \"file://$PWD/svnrepo\" test-git'\n+test_expect_success 'fetch revision from svn' '(cd test-git && git-svn fetch --clean-changelog=gnu)'\n+test_expect_success 'rebase revision from svn' '(cd test-git && git-svn rebase --clean-changelog=gnu)'\n+test_expect_success 'get log' '(cd test-git && git log | grep -Ev \"^(commit|Author)\" > git-log.output)'\n+\n+cat > git-log.expect << EOF\n+Date:   Sun Aug 3 10:51:21 2008 +0000\n+\n+    three: Add yet another commit that is too long to fit on one\n+    line, i.e., 81 chars.\n+    \n+    \n+    git-svn-id: file://$PWD/svnrepo@3 3e54420c-6148-11dd-bf80-b901c556354a\n+\n+Date:   Sun Aug 3 10:47:11 2008 +0000\n+\n+    one: Change to numeral. /path/to/two (foo, bar): Update.\n+    \n+    \n+    git-svn-id: file://$PWD/svnrepo@2 3e54420c-6148-11dd-bf80-b901c556354a\n+\n+Date:   Sun Aug 3 10:42:21 2008 +0000\n+\n+    one: New file.  This adds the \\`one' file to the svn repository.\n+    \n+    \n+    git-svn-id: file://$PWD/svnrepo@1 3e54420c-6148-11dd-bf80-b901c556354a\n+EOF\n+\n+test_expect_success 'git svn clone/fetch --changelog=gnu' 'cmp git-log.expect test-git/git-log.output'\n+\n+test_done\n-- \n1.6.0.rc0.44.g67270\n\n\n\n\n-- \nJan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond - The music typesetter\nhttp://www.xs4all.nl/~jantien       | http://www.lilypond.org\n"},{"id":"86102","messageId":"7vhca1u8to.fsf@gitster.siamese.dyndns.org","threadId":"14809","inReplyTo":"1217765241.6178.11.camel@heerbeest","subject":"Re: [PATCH] git-svn.perl: Strip ChangeLog bits.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-03T20:45:07Z","receivedAt":"2008-08-03T20:45:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jan Nieuwenhuizen <janneke-list@xs4all.nl> writes:\n\n>  Documentation/RelNotes-1.6.0.txt   |    3 +\n\nNice try, but after -rc1 we won't take feature enhancements on the\n'master' branch.  The earliest this will appear is in 1.6.1.\n\nThanks for clean-up, and starting tests, but I have a few more comments:\n\n * Documentation; introduce this with heading --clean-changelog=<style>; I\n   kept the list of supported styles in-line, but we may later want to\n   have other supported styles at which time it might become easier to\n   read if it were a separate itemized list.\n\n   You seem to have taken the \"arbitrary Perl snippet\" part of my patch as\n   well, but it is not described here...\n\n * Script; two separate _clean_changelog and _clean_log_message variables\n   are not necessary (I removed the extra variable in the patch below).\n\n * Tests.\n\n   Your new tests do not seem to check these, but I think you should:\n\n   - what should happen without --clean-changelog=gnu?  (iow, additional\n     code does not regress the behaviour when this shiny new toy is not\n     used).\n\n   - what should happen when an unknown style is given e.g. --clean-changelog=yak?\n\n   We prefer to use \"test_cmp\" for comparing expected and actual result,\n   not bare \"cmp\".\n\nHere is what I tested and based the above comments on after minor fixes to\nask comments from Eric.\n\n-- >8 --\nFrom: Jan Nieuwenhuizen <janneke@gnu.org>\nSubject: git-svn: --clean-changelog=<style> to sanitize messages\n\nSome projects write ChangeLog entries and use those for Subverison commit\nmessages.  Converting such a repository makes for a most uninteresting git\nlog --pretty=oneline output:\n\n    482cfc6... 2008-08-01  Kohei Yoshida  <kyoshida@novell.com>\n    90c16d7... 2008-08-01  Fong Lin  <pflin@novell.com> \t* patches/dev300/cws-npow\n    ...\n\nThe --clean-changelog=<style> option can be used to remove useless bits\nwhen reading log messages from Subversion side, to produce more readable\nresult:\n\n    44e7784... patches/dev300/apply: added upstream issue numbers to some of my  p\n    1a19026... patches/dev300/cws-npower11.diff: Add vba events stuff.\n    ...\n\nSigned-off-by: Jan Nieuwenhuizen <janneke@gnu.org>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n Documentation/git-svn.txt          |    4 +\n git-svn.perl                       |   37 +++++++-\n t/t9125-git-svn-clean-changelog.sh |  187 ++++++++++++++++++++++++++++++++++++\n 3 files changed, 227 insertions(+), 1 deletions(-)\n create mode 100755 t/t9125-git-svn-clean-changelog.sh\n\ndiff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt\nindex f230125..04b44c6 100644\n--- a/Documentation/git-svn.txt\n+++ b/Documentation/git-svn.txt\n@@ -118,6 +118,10 @@ accept.  However, '--fetch-all' only fetches from the current\n Like 'git-rebase'; this requires that the working tree be clean\n and have no uncommitted changes.\n \n+--clean-changelog=<style>;;\n+\tManipulate SVN commit log messages to produce clean commit\n+\tmessages.  Supported styles are: 'gnu', which strips\n+\tGNU ChangeLog bits.\n -l;;\n --local;;\n \tDo not fetch remotely; only run 'git-rebase' against the\ndiff --git a/git-svn.perl b/git-svn.perl\nindex cf6dbbc..ff17457 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -66,7 +66,7 @@ my ($_stdin, $_help, $_edit,\n \t$_version, $_fetch_all, $_no_rebase,\n \t$_merge, $_strategy, $_dry_run, $_local,\n \t$_prefix, $_no_checkout, $_url, $_verbose,\n-\t$_git_format);\n+\t$_git_format, $_clean_changelog);\n $Git::SVN::_follow_parent = 1;\n my %remote_opts = ( 'username=s' => \\$Git::SVN::Prompt::_username,\n                     'config-dir=s' => \\$Git::SVN::Ra::config_dir,\n@@ -109,9 +109,11 @@ my %cmd = (\n \tfetch => [ \\&cmd_fetch, \"Download new revisions from SVN\",\n \t\t\t{ 'revision|r=s' => \\$_revision,\n \t\t\t  'fetch-all|all' => \\$_fetch_all,\n+\t\t\t  'clean-changelog=s' => \\$_clean_changelog,\n \t\t\t   %fc_opts } ],\n \tclone => [ \\&cmd_clone, \"Initialize and fetch revisions\",\n \t\t\t{ 'revision|r=s' => \\$_revision,\n+\t\t\t  'clean-changelog=s' => \\$_clean_changelog,\n \t\t\t   %fc_opts, %init_opts } ],\n \tinit => [ \\&cmd_init, \"Initialize a repo for tracking\" .\n \t\t\t  \" (requires URL argument)\",\n@@ -178,6 +180,7 @@ my %cmd = (\n \t\t\t  'local|l' => \\$_local,\n \t\t\t  'fetch-all|all' => \\$_fetch_all,\n \t\t\t  'dry-run|n' => \\$_dry_run,\n+\t\t\t  'clean-changelog=s' => \\$_clean_changelog,\n \t\t\t  %fc_opts } ],\n \t'commit-diff' => [ \\&cmd_commit_diff,\n \t                   'Commit a diff between two trees',\n@@ -238,6 +241,35 @@ my $rv = GetOptions(%opts, 'help|H|h' => \\$_help, 'version|V' => \\$_version,\n                        $Git::SVN::default_repo_id = $_[1] });\n exit 1 if (!$rv && $cmd && $cmd ne 'log');\n \n+my %canned_changelog_cleaner =\n+(\n+ 'gnu' => sub {\n+\t local ($_) = @_;\n+\t s/(^|\\n)\\s*((\\n|\\s)*(199[0-9]|20[0-1][0-9])(-[0-9]{2}){2}\\s+.*<.*>\\s*\\n\\s+)?/$1/g;\n+\t s/(^|\\n)\\* /\\n$1/g;\n+\t s/^[\\n\\s]*//;\n+\t s/[\\n\\s]*$//;\n+\t s/\\n\\s*/ /g if length ($_) < 81;\n+\t $_ . \"\\n\";\n+ }\n+);\n+\n+if (defined $_clean_changelog) {\n+\tmy $ccl = $_clean_changelog;\n+\tif (exists $canned_changelog_cleaner{$_clean_changelog}) {\n+\t\t$_clean_changelog = $canned_changelog_cleaner{$_clean_changelog};\n+\t} elsif ($_clean_changelog ne '') {\n+\t\t$_clean_changelog = eval \"\n+\t\t\tsub { local(\\$_) = \\@_; $_clean_changelog; return \\$_; }\n+\t\t\";\n+\t\tif ($@) {\n+\t\t\tdie \"$!: $ccl\";\n+\t\t}\n+\t} else {\n+\t\tdie \"$ccl: unknown way to clean log message\";\n+\t}\n+}\n+\n usage(0) if $_help;\n version() if $_version;\n usage(1) unless defined $cmd;\n@@ -2463,6 +2495,9 @@ sub make_log_entry {\n \tclose $un or croak $!;\n \n \t$log_entry{date} = parse_svn_date($log_entry{date});\n+\tif ($_clean_changelog) {\n+\t\t$log_entry{log} = $_clean_changelog->($log_entry{log});\n+\t}\n \t$log_entry{log} .= \"\\n\";\n \tmy $author = $log_entry{author} = check_author($log_entry{author});\n \tmy ($name, $email) = defined $::users{$author} ? @{$::users{$author}}\ndiff --git a/t/t9125-git-svn-clean-changelog.sh b/t/t9125-git-svn-clean-changelog.sh\nnew file mode 100755\nindex 0000000..f6a02b8\n--- /dev/null\n+++ b/t/t9125-git-svn-clean-changelog.sh\n@@ -0,0 +1,187 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2008 Jan Nieuwenhuizen <janneke@gnu.org>\n+\n+test_description='git-svn fetch --clean-changelog'\n+\n+. ./lib-git-svn.sh\n+\n+cat >dumpfile.svn <<\\EOF\n+SVN-fs-dump-format-version: 2\n+\n+UUID: 3e54420c-6148-11dd-bf80-b901c556354a\n+\n+Revision-number: 0\n+Prop-content-length: 56\n+Content-length: 56\n+\n+K 8\n+svn:date\n+V 27\n+2008-08-03T10:38:00.279529Z\n+PROPS-END\n+\n+Revision-number: 1\n+Prop-content-length: 231\n+Content-length: 231\n+\n+K 7\n+svn:log\n+V 128\n+2008-08-03  Jan Nieuwenhuizen  <janneke@gnu.org>\n+\n+\t* one: New file.  This adds the `one' file to the svn\n+          repository.\n+\n+\n+K 10\n+svn:author\n+V 7\n+janneke\n+K 8\n+svn:date\n+V 27\n+2008-08-03T10:42:21.211246Z\n+PROPS-END\n+\n+Node-path: one\n+Node-kind: file\n+Node-action: add\n+Prop-content-length: 10\n+Text-content-length: 4\n+Text-content-md5: 5bbf5a52328e7439ae6e719dfe712200\n+Content-length: 14\n+\n+PROPS-END\n+one\n+\n+\n+Revision-number: 2\n+Prop-content-length: 217\n+Content-length: 217\n+\n+K 7\n+svn:log\n+V 114\n+2008-08-03  Jan Nieuwenhuizen  <janneke@gnu.org>\n+\n+\t* one: Change to numeral.\n+\t* /path/to/two (foo, bar): Update.\n+\n+\n+K 10\n+svn:author\n+V 7\n+janneke\n+K 8\n+svn:date\n+V 27\n+2008-08-03T10:47:11.023749Z\n+PROPS-END\n+\n+Node-path: one\n+Node-kind: file\n+Node-action: change\n+Text-content-length: 2\n+Text-content-md5: b026324c6904b2a9cb4b88d6d61c81d1\n+Content-length: 2\n+\n+1\n+\n+\n+Node-path: two\n+Node-kind: file\n+Node-action: add\n+Prop-content-length: 10\n+Text-content-length: 4\n+Text-content-md5: c193497a1a06b2c72230e6146ff47080\n+Content-length: 14\n+\n+PROPS-END\n+two\n+\n+\n+Revision-number: 3\n+Prop-content-length: 192\n+Content-length: 192\n+\n+K 7\n+svn:log\n+V 90\n+    * three: Add yet another commit that is too long to fit on one\n+line, i.e., 81 chars.\n+\n+\n+K 10\n+svn:author\n+V 7\n+janneke\n+K 8\n+svn:date\n+V 27\n+2008-08-03T10:51:21.214317Z\n+PROPS-END\n+\n+Node-path: three\n+Node-kind: file\n+Node-action: add\n+Prop-content-length: 10\n+Text-content-length: 6\n+Text-content-md5: febe6995bad457991331348f7b9c85fa\n+Content-length: 16\n+\n+PROPS-END\n+three\n+\n+\n+EOF\n+\n+test_expect_success 'load svn dumpfile' '\n+\tsvnadmin load \"$PWD/svnrepo\" <dumpfile.svn\n+'\n+\n+test_expect_success 'clone revision from svn' '\n+\tgit-svn clone --clean-changelog=gnu -r0 \"file://$PWD/svnrepo\" test-git\n+'\n+\n+test_expect_success 'fetch revision from svn' '\n+\t(cd test-git && git-svn fetch --clean-changelog=gnu)\n+'\n+\n+test_expect_success 'rebase revision from svn' '\n+\t(cd test-git && git-svn rebase --clean-changelog=gnu)\n+'\n+\n+test_expect_success 'get log' '\n+\t(cd test-git && git log | grep -Ev \"^(commit|Author)\" >git-log.output)\n+'\n+\n+sed -e 's/|$//' >git-log.expect <<EOF\n+Date:   Sun Aug 3 10:51:21 2008 +0000\n+\n+    three: Add yet another commit that is too long to fit on one\n+    line, i.e., 81 chars.\n+    |\n+    |\n+    git-svn-id: file://$PWD/svnrepo@3 3e54420c-6148-11dd-bf80-b901c556354a\n+\n+Date:   Sun Aug 3 10:47:11 2008 +0000\n+\n+    one: Change to numeral. /path/to/two (foo, bar): Update.\n+    |\n+    |\n+    git-svn-id: file://$PWD/svnrepo@2 3e54420c-6148-11dd-bf80-b901c556354a\n+\n+Date:   Sun Aug 3 10:42:21 2008 +0000\n+\n+    one: New file.  This adds the \\`one' file to the svn repository.\n+    |\n+    |\n+    git-svn-id: file://$PWD/svnrepo@1 3e54420c-6148-11dd-bf80-b901c556354a\n+EOF\n+\n+test_expect_success 'git svn clone/fetch --changelog=gnu' '\n+\ttest_cmp git-log.expect test-git/git-log.output\n+'\n+\n+test_done\n-- \n1.6.0.rc1.58.g807d8\n"},{"id":"86136","messageId":"20080804020931.GA4109@untitled","threadId":"14809","inReplyTo":"1217701021.8296.35.camel@heerbeest","subject":"Re: [PATCH] git-svn.perl: Strip ChangeLog bits.","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2008-08-04T02:09:31Z","receivedAt":"2008-08-04T02:09:31Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Jan Nieuwenhuizen <janneke-list@xs4all.nl> wrote:\n> On za, 2008-08-02 at 10:36 -0700, Junio C Hamano wrote:\n> \n> > >   You forgot to document your option. (And possibly write a testcase.)\n> > \n> > I am not sure if this is generic enough to be in git-svn.perl itself, or\n> > perhaps there should be a hook make_log_entry() would call in the form of\n> > some Perl scriptlet given by the user to munge $log_entry{log}, which\n> > would be very specific to each project.\n> \n> If you're not sure, please make up your mind.  I agree it's quite a hack\n> but now it's in the archives for others to find.  Doing this in a single\n> regexp is a bit tricky and asking a user to write a perl snippet is even\n> worse, imho.  Especially if would turn out that stripping changelog bits\n> is the only thing that the hook is getting used for, in the end.  I have\n> gotten more careful to provide generic solutions to specific problems in\n> anticipation of possible future desires.\n> \n> I could imagine that leaving git-svn alone and adding a hook to git-log\n> would be more useful, though.\n\nNACK on modifying git-svn to support more changelog formats.\n\nA better idea would be to write a generic script that takes \"git log\",\n\"git svn log\" or even plain \"svn log\" output and filters it\nindependently.\n\nThis way existing projects don't have to be re-imported (a bad idea to\nmodify things SVN feeds us anyways), and plain svn users can benefit,\ntoo.\n\nThis filter should be reusable for both plain svn and git-svn:\n\n    svn log | changelog-filter --input=svn --style=gnu\n    git svn log | changelog-filter --input=svn --style=gnu\n    git log --pretty=raw | changelog-filter --input=git-raw --style=gnu\n\n\nHowever, I would support a generic --log-filter parameter in git-svn\nthat would have git-svn filter its output through any given command\nbefore piping it to less.\n\n    git config svn.logFilter \"changelog-filter --input=svn --style=gnu\"\n    git svn log\n      or...\n    git svn log --log-filter=\"changelog-filter --input=svn --style=yak\"\n    git svn log --log-filter=\"svn-log-to-LaTeX\"\n    git svn log --log-filter=\"svn-log-to-HTML\"\n    git svn log --log-filter=\"svn-log-to-XML\"\n    git svn log --log-filter=\"svn-log-to-JSON\"\n    git svn log --log-filter=\"svn-log-to-PNG\" > log.png\n    git svn log --log-filter=\"svn-log-to-theora\" > log.ogg\n\n    The possibilities are endless :)\n\n-- \nEric Wong\n"},{"id":"86141","messageId":"7vabft5wh9.fsf@gitster.siamese.dyndns.org","threadId":"14809","inReplyTo":"20080804020931.GA4109@untitled","subject":"Re: [PATCH] git-svn.perl: Strip ChangeLog bits.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-04T02:45:38Z","receivedAt":"2008-08-04T02:45:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Wong <normalperson@yhbt.net> writes:\n\n>> I could imagine that leaving git-svn alone and adding a hook to git-log\n>> would be more useful, though.\n>\n> NACK on modifying git-svn to support more changelog formats.\n\nHonestly, I am neutral about this one.  I think it all depends on the\nmotivation behind the desire to rewrite the log.\n\nIf the project that was hosted in Subversion wants to switch (perhaps\ngradually) to git, _and_ if the project also wants to adopt a workflow\nthat does not do the GNU style changelog in the commit log but use a\none-line summary friendly format, then sanitizing the commit log while\nimporting via git-svn would make sense.  Even though filter-branch after\nconversion would be another possibility, that option is only available if\nyou are converting away from Subversion, never to return.\n\nOn the other extreme, if the Subversion side will always be the canonical\none, _or_ if the project does not want to change its commit log format,\nthen I think it makes perfect sense to limit the commit log munging to the\nabsolute minimum (but even in such a case, the user can just run git-svn\nwithout activating the log munging option --- so I do not think it is such\na big deal to add or reject an option like this).\n\n> A better idea would be to write a generic script that takes \"git log\",\n> \"git svn log\" or even plain \"svn log\" output and filters it\n> independently.\n\nThat's an independent topic.  If such a filter supports a feature like our\nshortlog command has, people whose history is still trapped in Subversion\nwould benefit from it.\n"},{"id":"86153","messageId":"1217836189.7649.7.camel@heerbeest","threadId":"14809","inReplyTo":"20080804020931.GA4109@untitled","subject":"Re: [PATCH] git-svn.perl: Strip ChangeLog bits.","fromName":"Jan Nieuwenhuizen","fromEmail":"janneke-list@xs4all.nl","sentAt":"2008-08-04T07:49:49Z","receivedAt":"2008-08-04T07:49:49Z","isPatch":true,"sender":{"key":"janneke-list@xs4all.nl","avatar":null},"body":"On zo, 2008-08-03 at 19:09 -0700, Eric Wong wrote:\n\n> Jan Nieuwenhuizen <janneke-list@xs4all.nl> wrote:\n> > I could imagine that leaving git-svn alone and adding a hook to git-log\n> > would be more useful, though.\n> \n> NACK on modifying git-svn to support more changelog formats.\n> \n> A better idea would be to write a generic script that takes \"git log\",\n> \"git svn log\" or even plain \"svn log\" output and filters it\n> independently.\n\n> This filter should be reusable for both plain svn and git-svn:\n\n>     The possibilities are endless :)\n\nYes, but we'll most probably drop SVN rsn, possibly after a short period\nof supporting both; and not stripping the cruft in the conversion means\nwe carry this with us until eternity.  Besides, who is going to\ndistribute the script, inform users about its availability?\n\nWhat we have now suffices for our ooo-build conversion.  If you do not\nfind it useful, more power/less code to you.  Let others search the\narchives and/or patch git-svn themselves, if indeed there are any.\n\nJan.\n\n-- \nJan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond - The music typesetter\nhttp://www.xs4all.nl/~jantien       | http://www.lilypond.org\n"},{"id":"86159","messageId":"1217837277.7649.24.camel@heerbeest","threadId":"14809","inReplyTo":"7vhca1u8to.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] git-svn.perl: Strip ChangeLog bits.","fromName":"Jan Nieuwenhuizen","fromEmail":"janneke-list@xs4all.nl","sentAt":"2008-08-04T08:07:57Z","receivedAt":"2008-08-04T08:07:57Z","isPatch":true,"sender":{"key":"janneke-list@xs4all.nl","avatar":null},"body":"On zo, 2008-08-03 at 13:45 -0700, Junio C Hamano wrote:\n\n> Nice try, but after -rc1 we won't take feature enhancements on the\n> 'master' branch.  The earliest this will appear is in 1.6.1.\n\nOk, I'm not that familiar with git development and I did not find any\nnewer/UNRELEASED list of features?\n\n>  * Documentation; introduce this with heading --clean-changelog=<style>; I\n\nOk.  I tried ={gnu} first, which seems to be the style for multiple\nchoice arguments, but the document parser does not grok that.  {gnu|foo}\nor {gnu|no-other-yet} did not really please me.\n\n>    You seem to have taken the \"arbitrary Perl snippet\" part of my patch as\n>    well, but it is not described here...\n\nIt all depends upon how you read the future.  I would most have chosen\nto postpone that work until the second (or third) request for different\nmunging came in, but now that the code is already written...\n\n>  * Script; two separate _clean_changelog and _clean_log_message variables\n>    are not necessary (I removed the extra variable in the patch below).\n\nGood, I didn't really look at that.\n\n>    Your new tests do not seem to check these, but I think you should:\n\n>    - what should happen without --clean-changelog=gnu?  (iow, additional\n>      code does not regress the behaviour when this shiny new toy is not\n>      used).\n\nWe could add a test to make sure that git-svn does not alter commit\nmessages, but it has little to do with this patch.\n\nIf this is not being tested atm, it is probably not deemed important\nenough to test.  This could have regressed at any time.  \n\nI would add a test for existing working code only if experience tells\nyou it is fragile and it (often) regresses, ie, when you fix a bug:\nnew/revised code.\n\n>    - what should happen when an unknown style is given e.g. --clean-changelog=yak?\n\nIt would be nice if the script failed with an error message, telling\nwhat the options are, but I do not really care that much about wrong\nuse.  You have that automatically if you use a sensible option parser,\nthis is where such a feature should be implemented, imho.\n\n>    We prefer to use \"test_cmp\" for comparing expected and actual result,\n>    not bare \"cmp\".\n\nOk.\n\n> Here is what I tested and based the above comments on after minor fixes to\n> ask comments from Eric.\n\nGreat, thanks.  We'll see what happens then.\n\nJan.\n\n-- \nJan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond - The music typesetter\nhttp://www.xs4all.nl/~jantien       | http://www.lilypond.org\n"},{"id":"86165","messageId":"20080804090309.GD5435@hand.yhbt.net","threadId":"14809","inReplyTo":"1217836189.7649.7.camel@heerbeest","subject":"Re: [PATCH] git-svn.perl: Strip ChangeLog bits.","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2008-08-04T09:03:09Z","receivedAt":"2008-08-04T09:03:09Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Jan Nieuwenhuizen <janneke-list@xs4all.nl> wrote:\n> On zo, 2008-08-03 at 19:09 -0700, Eric Wong wrote:\n> \n> > Jan Nieuwenhuizen <janneke-list@xs4all.nl> wrote:\n> > > I could imagine that leaving git-svn alone and adding a hook to git-log\n> > > would be more useful, though.\n> > \n> > NACK on modifying git-svn to support more changelog formats.\n> > \n> > A better idea would be to write a generic script that takes \"git log\",\n> > \"git svn log\" or even plain \"svn log\" output and filters it\n> > independently.\n> \n> > This filter should be reusable for both plain svn and git-svn:\n> \n> >     The possibilities are endless :)\n> \n> Yes, but we'll most probably drop SVN rsn, possibly after a short period\n> of supporting both; and not stripping the cruft in the conversion means\n> we carry this with us until eternity.  Besides, who is going to\n> distribute the script, inform users about its availability?\n> \n> What we have now suffices for our ooo-build conversion.  If you do not\n> find it useful, more power/less code to you.  Let others search the\n> archives and/or patch git-svn themselves, if indeed there are any.\n\nIn the one-shot case, a git filter-branch script would probably be ideal\nand reusable for other projects.\n\nAnyways, I strongly believe changelog modification/reformatting should\nbe done in a more generic way that can benefit users of other tools\n(archimport/cvsimport etc...), too.\n\n-- \nEric Wong\n"},{"id":"86175","messageId":"1217849405.7649.27.camel@heerbeest","threadId":"14809","inReplyTo":"20080804090309.GD5435@hand.yhbt.net","subject":"Re: [PATCH] git-svn.perl: Strip ChangeLog bits.","fromName":"Jan Nieuwenhuizen","fromEmail":"janneke-list@xs4all.nl","sentAt":"2008-08-04T11:30:05Z","receivedAt":"2008-08-04T11:30:05Z","isPatch":true,"sender":{"key":"janneke-list@xs4all.nl","avatar":null},"body":"On ma, 2008-08-04 at 02:03 -0700, Eric Wong wrote:\n\n> In the one-shot case, a git filter-branch script would probably be ideal\n> and reusable for other projects.\n\nThat's a nice idea!\n\nJan.\n\n-- \nJan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond - The music typesetter\nhttp://www.xs4all.nl/~jantien       | http://www.lilypond.org\n"}]}