* Re: [PATCH] git-svnimport: Improved detection of merges.
[not found] <11490715283626-git-send-email-octo@verplant.org>
@ 2006-06-01 7:12 ` Junio C Hamano
2006-06-01 9:22 ` Eric Wong
0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2006-06-01 7:12 UTC (permalink / raw)
To: git; +Cc: Florian Forster
Florian Forster <octo@verplant.org> writes:
> The regexes detecting merges (while still relying on the commit messages,
> though) have been improved to catch saner (and hopefully more) messages. The
> old regex was so generic that it often matched something else and missed the
> actual merge-message.
> Also, the regex given with the `-M' commandline-option is checked first:
> Explicitely given regexes should be considered better than the builtin ones,
> and should therefore be given a chance to match a message first.
The latter part sounds immensely sane. The former I am not a
good judge, since I do not interact with subversion repositories
myself. Opinions from real svn users?
BTW, did anybody received the latest "What's in git.git" I sent
out about 20 minutes ago?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] git-svnimport: Improved detection of merges.
2006-06-01 7:12 ` [PATCH] git-svnimport: Improved detection of merges Junio C Hamano
@ 2006-06-01 9:22 ` Eric Wong
2006-06-01 9:36 ` Florian Forster
0 siblings, 1 reply; 4+ messages in thread
From: Eric Wong @ 2006-06-01 9:22 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Florian Forster
Junio C Hamano <junkio@cox.net> wrote:
> Florian Forster <octo@verplant.org> writes:
>
> > The regexes detecting merges (while still relying on the commit messages,
> > though) have been improved to catch saner (and hopefully more) messages. The
> > old regex was so generic that it often matched something else and missed the
> > actual merge-message.
>
> > Also, the regex given with the `-M' commandline-option is checked first:
> > Explicitely given regexes should be considered better than the builtin ones,
> > and should therefore be given a chance to match a message first.
>
> The latter part sounds immensely sane. The former I am not a
> good judge, since I do not interact with subversion repositories
> myself. Opinions from real svn users?
Sounds sane to me, but I've not seen the patch from Florian.
I've been toying around a bit with enhanced branch/merge-tracking
support in git-svn, too.
>
> BTW, did anybody received the latest "What's in git.git" I sent
> out about 20 minutes ago?
Nope, I haven't seen that nor Florian's patch (assuming it was sent to
the ml). Ah, I just saw (part #2) pop up.
--
Eric Wong
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] git-svnimport: Improved detection of merges.
2006-06-01 9:22 ` Eric Wong
@ 2006-06-01 9:36 ` Florian Forster
2006-06-01 9:58 ` Junio C Hamano
0 siblings, 1 reply; 4+ messages in thread
From: Florian Forster @ 2006-06-01 9:36 UTC (permalink / raw)
To: Eric Wong; +Cc: Junio C Hamano, git
[-- Attachment #1.1: Type: text/plain, Size: 1178 bytes --]
Hi,
On Thu, Jun 01, 2006 at 02:22:39AM -0700, Eric Wong wrote:
> Nope, I haven't seen that nor Florian's patch (assuming it was sent to
> the ml). Ah, I just saw (part #2) pop up.
sorry, I'm new to the git development and didn't know that patches
should be sent to the ML. I've attached that patch I sent to Junio to
this mail.
Florian Forster <octo@verplant.org> writes:
> The regexes detecting merges (while still relying on the commit
> messages, though) have been improved to catch saner (and hopefully
> more) messages. The old regex was so generic that it often matched
> something else and missed the actual merge-message.
The assumption here is that merges are between branches or between a
branch and the trunk. The regexes therefore match things like
(parenthesis showing what is being used as the branch name if it
matches).
- `branch/(name)'
- `(trunk)'
- `(name) branch'
Prior to the patch `git-svnimport' would match the message
``Merging from branch/foo to branch/bar''
and return `from' as the branch name.
Regards,
Florian Forster
--
Florian octo Forster
Hacker in training
GnuPG: 0x91523C3D
http://verplant.org/
[-- Attachment #1.2: 0001-git-svnimport-Improved-detection-of-merges.txt --]
[-- Type: text/plain, Size: 1607 bytes --]
From nobody Mon Sep 17 00:00:00 2001
From: Florian Forster <octo@verplant.org>
Date: Wed, 31 May 2006 12:28:41 +0200
Subject: [PATCH] git-svnimport: Improved detection of merges.
The regexes detecting merges (while still relying on the commit messages,
though) have been improved to catch saner (and hopefully more) messages. The
old regex was so generic that it often matched something else and missed the
actual merge-message.
Also, the regex given with the `-M' commandline-option is checked first:
Explicitely given regexes should be considered better than the builtin ones,
and should therefore be given a chance to match a message first.
---
git-svnimport.perl | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
1075d5b0cd92dbb8dc77838b2da2d8190904b351
diff --git a/git-svnimport.perl b/git-svnimport.perl
index 61f559f..38ac732 100755
--- a/git-svnimport.perl
+++ b/git-svnimport.perl
@@ -63,10 +63,17 @@ my $svn_dir = $ARGV[1];
our @mergerx = ();
if ($opt_m) {
- @mergerx = ( qr/\W(?:from|of|merge|merging|merged) (\w+)/i );
+ my $branch_esc = quotemeta ($branch_name);
+ my $trunk_esc = quotemeta ($trunk_name);
+ @mergerx =
+ (
+ qr!\b(?:merg(?:ed?|ing))\b.*?\b((?:(?<=$branch_esc/)[\w\.\-]+)|(?:$trunk_esc))\b!i,
+ qr!\b(?:from|of)\W+((?:(?<=$branch_esc/)[\w\.\-]+)|(?:$trunk_esc))\b!i,
+ qr!\b(?:from|of)\W+(?:the )?([\w\.\-]+)[-\s]branch\b!i
+ );
}
if ($opt_M) {
- push (@mergerx, qr/$opt_M/);
+ unshift (@mergerx, qr/$opt_M/);
}
# Absolutize filename now, since we will have chdir'ed by the time we
--
1.3.3
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] git-svnimport: Improved detection of merges.
2006-06-01 9:36 ` Florian Forster
@ 2006-06-01 9:58 ` Junio C Hamano
0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2006-06-01 9:58 UTC (permalink / raw)
To: Florian Forster; +Cc: git
Florian Forster <octo@verplant.org> writes:
> On Thu, Jun 01, 2006 at 02:22:39AM -0700, Eric Wong wrote:
>> Nope, I haven't seen that nor Florian's patch (assuming it was sent to
>> the ml). Ah, I just saw (part #2) pop up.
>
> sorry, I'm new to the git development and didn't know that patches
> should be sent to the ML. I've attached that patch I sent to Junio to
> this mail.
Thanks for a resend.
The patch is already queued in "next", so svn people might want
to take a peek there.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-06-01 9:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <11490715283626-git-send-email-octo@verplant.org>
2006-06-01 7:12 ` [PATCH] git-svnimport: Improved detection of merges Junio C Hamano
2006-06-01 9:22 ` Eric Wong
2006-06-01 9:36 ` Florian Forster
2006-06-01 9:58 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).