4

According to this post from January, source indexing was "not supported in TFS Builds running against Git source control". Have any of the updates made this possible yet?

Cameron Taggart
  • 5,771
  • 4
  • 45
  • 70
  • For Git, "Symbols can be published, but they are not indexed yet." http://msdn.microsoft.com/en-us/library/vstudio/ms181368.aspx#tfvc_or_git_details – Cameron Taggart Nov 09 '14 at 20:40

2 Answers2

3

[disclosure - I work on the new build system]

git source indexing is available in the new 2015 build (note this is a completely new modern build system). It's in RC now and shipping soon.

More information available here: http://aka.ms/vsopreview

specifically: https://msdn.microsoft.com/Library/vs/alm/Build/vs/define-build

Note that if you create a VS definition from the template in the new build system, git source indexing step is there by default.

It will embed a command line for 'tf git view' in the pdb. That command line is available in VS 2015 tf command line.

The task script is open sourced here: https://github.com/Microsoft/vso-agent-tasks/blob/master/Tasks/PublishSymbols/PublishSymbols.ps1

bryanmac
  • 38,941
  • 11
  • 91
  • 99
  • Does it source index using `tf` or `https` in the `srcsrv`? – Cameron Taggart Jun 18 '15 at 01:40
  • It should index the sources and write it to the symbols share. It then embeds the cmd line to tf git view (which downloads src at the point in time) which the VS debugger uses to get source and step through using the index info. – bryanmac Jun 18 '15 at 01:48
  • I added to the answer the source to the task script in the new build system. Note that, it calls a cmdlet in the agent that's not open sourced (but I wish it was) We're making an effort to open up more and more. – bryanmac Jun 18 '15 at 01:49
  • [disclosure - I'm the author of SourceLink] :) If you source index using `https` instead, people wouldn't require `tf.exe` on their computers. http://ctaggart.github.io/SourceLink/tfs.html – Cameron Taggart Jun 18 '15 at 01:55
  • 1
    OK - note that any one debugging via VS will have tf.exe. Also note that it's not as simple as getting the content, filters need to be applied (stored on server as LF but gitattribtues and win pulls as CRLF etc..). Contact me offline and we can talk through. The task system is also extensible in the new build system so the built in task is not the *only* way – bryanmac Jun 18 '15 at 02:10
  • @bryanmac - Is VS 2015 required to view the source files when debugging with PDBs indexed with this build step? – Aaron Carlson Jul 07 '15 at 13:26
  • It's not so much that anything is special about this step - both this step and other automations embed the exe and args for VS to call. But, what is new is the new build system is capable of indexing git repos (was just tfsvc) and it does that by embedding calling tf git view CL and that is new in VS2015 client – bryanmac Jul 10 '15 at 12:59
  • @bryanmac The embedded command in PDBs generated by TFS 2015 seems to be "tf.exe git view /repoUri: ...", which doesn't work (when running it, I get a TF31002 - and tf git help view doesn't mention /repoUri). If I use /collection, /teamproject and /repository (as done in the script on GitHub at https://github.com/Microsoft/vso-agent-tasks/blob/master/Tasks/PublishSymbols/Invoke-IndexSources.ps1) works, but that doesn't help me as I don't have access to the in-built script in TFS. Is this a known issue? – Alex Hardwicke Aug 28 '15 at 08:06
0

If anyone else comes here looking for a way to index source in a VSTS backed git repo, I modified a powershell script made for github to work with VSTS. The github link to the script in the accepted answer is dead and and pipelines didn't fit my use case. If you just want a script that runs independently of ADO, this might help.

https://github.com/ruckonator/Git-Source-Indexer/blob/master/git-sourceindexer.ps1

Len
  • 1