Git-TF checkin --keep-author USERMAP not being parsed

Feb 18, 2014 at 11:27 PM
Edited Feb 18, 2014 at 11:28 PM
I'm trying to use git-tf to move a Team Project from one Collection to another, with full history. Of course I'm aware that I'll lose the timestamp. However, I'd like to keep the original author (not in the comments). All commands used listed at the bottom, for clarity.

For testing purposes, in my sandbox, I've imported the data twice:
  1. All history (--deep) but all checked in by me, with no additional comments
  2. All history (--deep and --metadata), which is same as above but includes original author and timestamp in the checkin comments
I'd like to use the --keep-author switch, so that the checkin is completed by the user who made the original checkin. When I do so, I get the following message:
"git-tf: Please correct the user map file USERMAP and repeat."
I edit the USERMAP file, taking the list of unknown users from the "unknown" section and moving them into the "mapping" section. However, when I execute the command again, it renames the USERMAP file as USERMAP.bak and recreates the identical USERMAP file, with the same list of unknown users.

Can anyone help?

Thanks a ton for your help! Any and all is appreciated. :-)

-- Brian

Command List:
git tf clone http://TFServer:8080/tfs/Collection $/Project/Branch --deep git init GoBetween cd GoBetween git pull ..\Branch --depth=100000000
git tf configure http://TFServer:8080/tfs/Collection_2 $/Project/Branch --deep --keep-author
git tf checkin --preview
git tf checkin
  • I executed this ^^ after editing the USERMAP file
Developer
Feb 19, 2014 at 3:31 PM
Hi Brian,

Did you modify the list of users after you'd moved it from the "unknown" to the "mapping" section? It's not enough just to move, you should provide a real user ID at the right hand of "=". E.g.
[unknown]
    John Doe <...> =
should be converted to something like
[mapping]
    John Doe <...> = DOMAIN\johnd
Where DOMAIN\johnd is an identity known for your Collection_2, i.e. first you should add all your changeset authors from Collection to Collection_2. Git-TF does not have permissions to add new user accounts to TFS.

Alex

Alex
Feb 19, 2014 at 4:45 PM
Hey Alex,

I did add the user IDs on the right-hand side of the equals sign. I should've mentioned that. :-) I tried it as both DOMAIN\johnd and also johnd@fqdn.com -- both attempts had the same result.

Is there anything I need to do to tell the checkin process to use the existing USERMAP file, or since it's there and the IDs are in the "mapping" section, it should be used?

As an aside, there are two users that show up in the "mapping" status initially, so I guess they were mapped identically to an expected ID in TFS? I'm just wondering why those are different.

Thanks again!

-- Brian
Developer
Feb 19, 2014 at 5:45 PM
Hi Brian,

You may specify the parameter:
--user-map=[<file path>]
    Specifies an absolute or relative path to a file providing mapping between Git 
    repository commit authors and TFS user identities.
    (default: ./USERMAP) To generate a template mapping file, run the checkin command 
    in preview mode with the --keep-author and --deep options specified.
But on the other hand, if as you said the existing USERMAP file renames to USERMAP.bak that means that the user map file is detected correctly. So, it looks like the TFS user names you specified in the mapping section for some reason are not recognized as valid user names by the TFS server.

Could you collect debug logs and send them to me at arukhlin@microsoft.com? You may find information on how to do that in 532279.

Alex
Feb 20, 2014 at 5:52 AM
Edited Feb 20, 2014 at 2:50 PM
Hey Alex,

After sending you the logs last night, I was able to figure it out this morning.

I'm going to leave the solution here, in case anyone else runs into it:

One of the users who was in the "unknown" section, which I moved to the "mapping" section, was not a Contributor in the team project where I was checking into. So, it seems like a requirement from TFS that, in order to check in AS a specific user, that user must have checkin permissions to that location (Team Project/Branch, depending on your model).

Thanks again Alex for your help!

-- Brian
Feb 28, 2014 at 3:31 PM
Edited Feb 28, 2014 at 3:31 PM
Hi Alex,
I hope I'm not terribly off base here and hijacking the thread but I'm have a very similar issue with my users in the USERMAP apparently not being recognized. I've created logs and see the call to TFS ReadIdentities returning a 500 Server Error response with the message
Specified argument was out of the range of valid values.&#xD;&#xA;Parameter name: factor
Interestingly, the only user I have mapped (and was prompted to map in the unknown section) is the one I'm also logged in as so I know it's a valid user. I hope you don't mind me sending you my logs which verify this. I'm not quite sure what to do further to try to resolve it.
  • James
Developer
Feb 28, 2014 at 4:01 PM
Hi James,

Which version is the TFS server you use? It looks like it does not support the request Git-TF uses. Sorry.

I'm afraid, Git-TF does not check the server version before tries to use USERMAP. That's not good. But the only we can (and should) do here, is to ignore --keep-author option in case the server is not modern enough.

Alex
Mar 3, 2014 at 2:59 PM
Thanks for the response Alex. I'm not easily able to tell what TFS version is in use (from some cursory googling, it appears I need to have some rights to the TFS server where it's installed to check this). It looks like we'll need to drop the --keep-author option as you suggested.
Jun 20, 2014 at 12:24 PM
Hello,

I have the similar problem with --keep-author option. I use TFS 2010. Does it support GIT-TF requests ?

Vladimir.
Developer
Jun 20, 2014 at 2:36 PM
Hi Vladimir,

I'm sorry to say, TFS 2010 does not support requests needed for --keep-author processing.

Alex
Jun 20, 2014 at 4:26 PM
Hello Alex,

Thank you for quick response. Do you know another way to get TFS identities for TFS 2010 ? Through web services and SOAP, for example.

Vladimir.
Developer
Jun 20, 2014 at 7:23 PM

Hi,

I believe you should ask this question on TFS MSDN forums like http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=tfsgeneral or http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=tfsintegration. I’m sorry to say, but I joined the company when TFS 2012 was about to shipped, and I don’t know much about previous versions…

Alex

Jun 24, 2014 at 1:03 PM
Hello Alex,

I've found an alternative way. It was easy to make C# web-service with using TFS API, which returns TFS identity's information: unique and display names. After that I've added class library to git-tf with JAX-WS client, which calls this service and uses both unique and display names. This solution works with TFS Server 2010.

Vladimir.