Re: Migration from CVS to Git looses merges
- From
Urs Thuermann <urs@isnogud.escape.de>
- Date
- Jun 25, 2017, 09:30 UTC
- Message-ID
- <ygf7f00tnwh.fsf@tehran.isnogud.escape.de>
- In-Reply-To
- <87a84web83.fsf@linux-m68k.org>
Andreas Schwab <schwab@linux-m68k.org> writes:
> Merges are recognized purely by matching the commit message, and the > regexp must capture the branch name in the first subexpr. The -m option > enables some default regexps but won't match your example. You can use > -M 'Merge branch ([-\w]+)' to match it.
Thanks, I tried again and now it works. I misread the man page and also tried enclosing the regexp in //, also tried to escape the parentheses (as in BRE), and I thought I also tried 'Merge branch (.*)'. Obviously, I missed that one since it now works.
BTW, I now looked up the regexes for -m in git-cvsimport.perl. Should probably in the man page.
I also suggest the following patch, so that -m would work with my not so uncommon merge commit message:
diff --git a/git-cvsimport.perl b/git-cvsimport.perl index 1e4e65a..1f8044b 100755 --- a/git-cvsimport.perl +++ b/git-cvsimport.perl @@ -207,7 +207,7 @@ if ($#ARGV == 0) { our @mergerx = (); if ($opt_m) { - @mergerx = ( qr/\b(?:from|of|merge|merging|merged) ([-\w]+)/i ); + @mergerx = ( qr/\b(?:from|of|merge|merging|merged) (?:branch )?([-\w]+)/i ); } if (@opt_M) { push (@mergerx, map { qr/$_/ } @opt_M); urs