This project is read-only.

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

Jan 2, 2014 at 8:27 AM
Hello,

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
Hi,

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?

Alex
Jan 2, 2014 at 7:27 PM
Hi,

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

<LoginName@GUID>

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.

[mapping]
 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 arukhlin@microsoft.com ?

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\log4j-git-tf.properties 
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
log4j.logger.com.microsoft.tfs.core.ws.runtime.client.SOAPService=INFO, SOAP-LOGFILE
log4j.additivity.com.microsoft.tfs.core.ws.runtime.client.SOAPService=false

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

# LOGFILE log
log4j.appender.LOGFILE=com.microsoft.gittf.client.clc.util.logging.LogAppender
log4j.appender.LOGFILE.File=git-tf
log4j.appender.LOGFILE.Append=false
log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
log4j.appender.LOGFILE.layout.ConversionPattern=%d %-5p [%t] (%c) %m%n

# SOAP-LOGFILE log
log4j.appender.SOAP-LOGFILE=com.microsoft.gittf.client.clc.util.logging.LogAppender
log4j.appender.SOAP-LOGFILE.File=git-tf-soap
log4j.appender.SOAP-LOGFILE.Append=false
log4j.appender.SOAP-LOGFILE.layout=org.apache.log4j.PatternLayout
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 git-tf-YYYY.MM.DD-hh.mm.ss.log

Thanks,
Alex
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 :-))

Alex

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
Hi,

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