Re: Migration from CVS to Git looses merges

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andreas Schwab <schwab@xxxxxxxxxxxxxx> 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



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux