summaryrefslogtreecommitdiff
path: root/git-p4.py
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-04-06 11:39:05 -0700
committerJunio C Hamano <gitster@pobox.com>2016-04-06 11:39:05 -0700
commit1d851b9d30f5a7d2efdda71623839dcabd27577e (patch)
tree5ca1df24ff4f7978cf920a273af8b9313133c290 /git-p4.py
parent5e533f8ffd12cdc2d20283c3900fc3561d449b82 (diff)
parent10d08a149d2295a239ac7710d32c0b77492f61c3 (diff)
downloadgit-1d851b9d30f5a7d2efdda71623839dcabd27577e.tar.gz
Merge branch 'ls/p4-map-user'
"git p4" now allows P4 author names to be mapped to Git author names. * ls/p4-map-user: git-p4: map a P4 user to Git author name and email address
Diffstat (limited to 'git-p4.py')
-rwxr-xr-xgit-p4.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/git-p4.py b/git-p4.py
index 825b9f32d5..527d44bd20 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -1160,6 +1160,15 @@ class P4UserMap:
self.users[output["User"]] = output["FullName"] + " <" + output["Email"] + ">"
self.emails[output["Email"]] = output["User"]
+ mapUserConfigRegex = re.compile(r"^\s*(\S+)\s*=\s*(.+)\s*<(\S+)>\s*$", re.VERBOSE)
+ for mapUserConfig in gitConfigList("git-p4.mapUser"):
+ mapUser = mapUserConfigRegex.findall(mapUserConfig)
+ if mapUser and len(mapUser[0]) == 3:
+ user = mapUser[0][0]
+ fullname = mapUser[0][1]
+ email = mapUser[0][2]
+ self.users[user] = fullname + " <" + email + ">"
+ self.emails[email] = user
s = ''
for (key, val) in self.users.items():