This project is read-only.

--keep-author not working [git-tf-]

Jan 2, 2014 at 8:27 AM

I'm migrating a SVN repository and and ready to checkin everything to TFS.

I'm running "git-tf checkin --deep --no-lock --preview --keep-author"
When inspecting the USERMAP file I only see one mapping (which is myself)
I'd expect many more mappings.

-- john
Jan 2, 2014 at 5:00 PM

Does your target TFS server have all the people you expect to see registered?

The default USERMAP file generated is just a template created by Git-TF based on the information found in your Git repository. I guess that the latter does not keep track of all the users made changes, but only you as the person who downloaded the files from SVN.

It might be a Git-TF fault (sorry, and thanks notifying us) that it looks to a wrong place for that info, but could you please double check (gitk ?) that your repository commits contain all the user names you expect to see?

Jan 2, 2014 at 7:27 PM

Doing this on my Windows machine: git log | grep "Author:" | sort -u | wc -l
I can see there are close to 30 distinct Authors. Then I also noticed that I had three distinct entries myself:

Author: MyName <DOMAIN\LoginName>
Author: LoginName LoginName@MyPCName.FQDN...
Author: LoginName <LoginName@GUID>

But most of the entries are in the following form


The GUID's are the same for all distinct authors.

The target TFS server will have most of the LoginNames.
I would expect the USERMAP file to end up with an entry for each distinct author. Then I can fixup all the invalid entries.

 MyName <DOMAIN\LoginName> = Unknown
 LoginName <LoginName@MyPCName.FQDN...>  = DOMAIN\LoginName
 LoginName <LoginName@GUID>  = Unknown

What happens if I add these entries myself. Is this something that git-tf would use then?

-- john
Jan 6, 2014 at 3:52 PM
Hi John,

I'm sorry to say, but I was not able to reproduce the issue locally. Are you sure you use the latest version of the Git-TF tool?

Also, could you please run the git-tf command again collecting a log with some extended debug information and send it to my personal e-mail ?

To collect the log you should add to your profile a log configuration file
C:\Users\<your-login-name>\AppData\Local\Microsoft\Team Foundation\4.0\Configuration\ 
with the following content
# Set root category priority to DEBUG and its only appender to LOGFILE.
log4j.rootCategory=DEBUG, LOGFILE

# Set SOAP logging to INFO, SOAP-LOGFILE

# CONSOLE log (default)
#log4j.appender.CONSOLE.layout.ConversionPattern=%-5p %m%n

log4j.appender.LOGFILE.layout.ConversionPattern=%d %-5p [%t] (%c) %m%n

log4j.appender.SOAP-LOGFILE.layout.ConversionPattern=%d %m%n
Generated log files could be found in
C:\Users\<your-login-name>\AppData\Local\Microsoft\Team Foundation\4.0\Logs 
their names look like

Jan 6, 2014 at 7:22 PM
Bahh... I see what is wrong now.

After the git-tf configure I just ran: git-tf checkin --deep
Then I got an error after a few revisions about locked file. So I had to try again with --no-lock, so I deleted the files from TFS and checked it in. Of course this results in the TFS repository is newer so I had to pull and merge to git.
When I try to check after this with:

git-tf checkin --deep --no-lock --preview --keep-author

it seems it just checkins the latest revision from git.
Now I just have to figure out how I reset the whole thing both from git and from TFS. Any suggestions?

-- john
Jan 6, 2014 at 7:46 PM
Hi John,

Git-TF uses the file .git\git-tf to map commits in the Git repository and changesets in TFS. Try to remove this file and repeat your checkin command again. (Definitely, it would be a good idea to keep the file's copy somewhere for any case :-))


P.S. I'm not sure right now, but you also might need to remove the reference .git\refs\remotes\origin_tfs\tfs. But I would try without that first.
Jan 7, 2014 at 11:17 AM

Thanks, now I managed to run to about 20% before problem with case sensitivity (I'll create a new thread about this).
But the USERMAP contains [mapping] and [unknown] entries and this looks great!

-- john