monotone-devel
[Top][All Lists]
Advanced

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

Re: [Monotone-devel] git fast-export


From: Derek Scherger
Subject: Re: [Monotone-devel] git fast-export
Date: Mon, 9 Feb 2009 23:15:58 -0700


On Mon, Feb 9, 2009 at 10:07 PM, Derek Scherger <address@hidden> wrote:

I know that creating an author map to handle all of the various authors is a pretty major PITA. I'm not sure what the best thing to do here is though. I didn't think the previous code that was trying to detect various types of author names and fix them was particularly robust. I'm open to suggestions but at the moment I think getting a list of authors and commiters from these queries and scripting up a proper author map is probably the best approach to the problem.

What about this:

--- cmd_othervcs.cc    894030d1e0d2749eb7dbf31f2b64761e6a85308a
+++ cmd_othervcs.cc    b14baf18550496ddb8ca705a283186f568343cce
@@ -510,9 +510,19 @@ CMD(git_export, "git_export", "", CMD_RE
 
       if (author_map.find(author_key) != author_map.end())
         author_key = author_map[author_key];
+      else if (author_key.find('<') == string::npos &&
+               author_key.find('>') == string::npos &&
+               author_key.find(' ') == string::npos &&
+               author_key.find('@') != string::npos)
+        author_key = "<" + author_key + ">";
 
       if (author_map.find(author_name) != author_map.end())
         author_name = author_map[author_name];
+      else if (author_name.find('<') == string::npos &&
+               author_name.find('>') == string::npos &&
+               author_name.find(' ') == string::npos &&
+               author_name.find('@') != string::npos)
+        author_name = "<" + author_name + ">";
 
       cert_iterator date = dates.begin();

Having to create a proper author map makes testing the darn thing hard too!

Cheers,
Derek


reply via email to

[Prev in Thread] Current Thread [Next in Thread]