简体   繁体   中英

Visual Studio (with TFS) history other than solution explorer?

Has anyone ever found other ways to get a file's commit history outside of solution explorer? It's really annoying that history is so stagnant because it is a really helpful view. I just wish it would show the current file. Here is the use case.

I build my gigantic solution, find random errors in files I have never heard of and want to know who's at fault. I can get to the file by double clicking from the Error List view, but right clicking doesn't work, nor does navigating View->Other Windows->History. If I can even get the history view, I just get the last history that I right-clicked from the Solution Explorer. +1 Also for anyone that has a way to find a file in the solution.

Double-click the error message to open the file. Then File > Source Control > Annotate to put a list of revisions down the left hand side. You can then click a revision number to get the details.

I would grep the build log and pipe the output to the TFS powershell tools, but I'm a command line kind of guy. If you want to work inside VS, I don't think you can do any better than doubleclicking the row in the Errors toolwindow. In addition to opening the file, this should automatically expand whatever projects & subfolders are needed so that the file is clickable in Solution Explorer (including rightclick -> History).

Quite aside from source control integration, here's the quickest way to open a file anywhere in the active solution: http://blogs.msdn.com/andrewarnottms/archive/2008/08/02/visual-studio-trick-to-quickly-find-any-file-in-solution.aspx

EDIT: here's a quick-n-dirty command line to look up the last 2 changes to every file with build errors.

$regex = [regex] "(?<filename>\S+\.cs).*error"
msbuild | %{ $regex.Matches($_) } | %{ $_.groups["filename"].value } | select -unique | %{ tfhist $_ -stop 2 }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM