{"thread":{"id":"3325","subject":"[PATCH] git-svnimport: -r adds svn revision number to commit messages","startedAt":"2006-02-14T02:43:34Z","lastAt":"2006-02-14T02:43:34Z","messageCount":1,"participants":["Karl Hasselström"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"16082","messageId":"24695.4271490269$1139885038@news.gmane.org","threadId":"3325","inReplyTo":null,"subject":"[PATCH] git-svnimport: -r adds svn revision number to commit messages","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2006-02-14T02:43:34Z","receivedAt":"2006-02-14T02:43:34Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"New -r flag for prepending the corresponding Subversion revision\nnumber to each commit message.\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\n\n\n---\n\n Documentation/git-svnimport.txt |    4 ++++\n git-svnimport.perl              |    7 ++++---\n 2 files changed, 8 insertions(+), 3 deletions(-)\n\n2aad1f8f976b8bb2cd6fd3b225199373008e14b4\ndiff --git a/Documentation/git-svnimport.txt b/Documentation/git-svnimport.txt\nindex 63e28b8..5c543d5 100644\n--- a/Documentation/git-svnimport.txt\n+++ b/Documentation/git-svnimport.txt\n@@ -61,6 +61,10 @@ When importing incrementally, you might \n \tthe git repository. Use this option if you want to import into a\n \tdifferent branch.\n \n+-r::\n+\tPrepend 'rX: ' to commit messages, where X is the imported\n+\tsubversion revision.\n+\n -m::\n \tAttempt to detect merges based on the commit message. This option\n \twill enable default regexes that try to capture the name source\ndiff --git a/git-svnimport.perl b/git-svnimport.perl\nindex f17d5a2..c536d70 100755\n--- a/git-svnimport.perl\n+++ b/git-svnimport.perl\n@@ -30,19 +30,19 @@ die \"Need SVN:Core 1.2.1 or better\" if $\n $SIG{'PIPE'}=\"IGNORE\";\n $ENV{'TZ'}=\"UTC\";\n \n-our($opt_h,$opt_o,$opt_v,$opt_u,$opt_C,$opt_i,$opt_m,$opt_M,$opt_t,$opt_T,$opt_b,$opt_s,$opt_l,$opt_d,$opt_D);\n+our($opt_h,$opt_o,$opt_v,$opt_u,$opt_C,$opt_i,$opt_m,$opt_M,$opt_t,$opt_T,$opt_b,$opt_r,$opt_s,$opt_l,$opt_d,$opt_D);\n \n sub usage() {\n \tprint STDERR <<END;\n Usage: ${\\basename $0}     # fetch/update GIT from SVN\n        [-o branch-for-HEAD] [-h] [-v] [-l max_rev]\n        [-C GIT_repository] [-t tagname] [-T trunkname] [-b branchname]\n-       [-d|-D] [-i] [-u] [-s start_chg] [-m] [-M regex] [SVN_URL]\n+       [-d|-D] [-i] [-u] [-r] [-s start_chg] [-m] [-M regex] [SVN_URL]\n END\n \texit(1);\n }\n \n-getopts(\"b:C:dDhil:mM:o:s:t:T:uv\") or usage();\n+getopts(\"b:C:dDhil:mM:o:rs:t:T:uv\") or usage();\n usage if $opt_h;\n \n my $tag_name = $opt_t || \"tags\";\n@@ -650,6 +650,7 @@ sub commit {\n \t\t$pr->reader();\n \n \t\t$message =~ s/[\\s\\n]+\\z//;\n+\t\t$message = \"r$revision: $message\" if $opt_r;\n \n \t\tprint $pw \"$message\\n\"\n \t\t\tor die \"Error writing to git-commit-tree: $!\\n\";\n-- \n1.2.0.g812d\n"}]}