git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Andreas Schwab
Message 3 of 3 in “Migration from CVS to Git looses merges”
  1. Urs ThuermannJun 25, 2017
  2. Andreas SchwabJun 25, 2017
  3. Urs ThuermannJun 25, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.