The "Merge" button in TFS-2010 is missing? - visual-studio-2010

We use Vs2010 with TFS 2010
The settings for source control [merge || compare ] are:
Everything is working fine for cs + aspx + html extensions.
But there is a problem with css extension ( and we can't figure why) :
For all other files it DOES show the merge button (when there are conflicts) :
But for css extension files there is no Merge button :
Why is that ? and how can I change it ? (already looked at settings , but couldn't find any related section).
Additional unrelated info :
We use Beyond compare as our compare tool
The exact settings for the compare operation :
Command: C:\Program Files\Beyond Compare 3\BComp.exe
Arguments %1 %2 /title1=%6 /title2=%7 /solo
The exact settings for the Merge operation :
Command: C:\Program Files\Beyond Compare 3\BComp.exe
Arguments %1 %2 %3 %4 /title1=%6 /title2=%7 /title3=%8 /title4=%9

Connect to your TFS server and go to your Team Explorer panel. Select Settings->Source Control
Check if the .css file extension is registered. For me it shows up under the Common Web Files category but I am on 2012

Related

How can I exclude these folders and files when searching a very large Visual Studio project?

I am trying to search a very large application with hundreds of folders and thousands of files using the Visual Studio "Find in files" feature. I want to search all C# files (*.cs) excluding:
View*.cs
*\UnitTests\*.cs
*\Archive\*.cs
I found How do I tell Visual Studio to exclude folders from the Find in Files? and responses, but due to the size of the application, adding each folder is not workable, nor is unchecking "Search subfolders":
New folders are added frequently so I'd rather have an exclude list instead of an include list so I don't miss anything.
Is there a "Not" operator syntax for file types? I tried ^, !, and | to no avail.
Did you try Ctrl + Shift + F which will give you following option.
In the search window you can select which folders to include in the search.
Alternatively if you have Git Bash installed and if your project is a git repo then easiest way is to use following command. I tested it with my project and it works fine with sub folders as well.
git ls-files -- '*.cs' ':!:*Test*.cs'
This will include *.cs file but exclude anything like *Test*.cs. You can change the pattern as per your requirement.

Can Visual Studio read a set of include file paths from a text file for the Additional Include Directories?

I'm trying to figure out how to get Visual Studio to read a set of include files from a text file.
For example, I would like to create a text file called IncludePaths.txt that contains a list of include paths such as "/I ../../header"
I would then tell Visual Studio reference this file.
I believe you could do this by adding #IncludePaths.txt to the Additional Include Directory, but I cannot get this to work. I have seen this done in projects I have worked on in the past but I can't find any documentation or figure out the trick.
After a little more research and talking to a couple of other developers, I figured out the "trick"
1) Create a file called IncludePaths.txt next to my project file.
2) Add your include paths to this file...
/I "..\..\..\..\open\common\include"
/I "..\..\..\common\include"
/I "..\..\"
3) Go to Properties -> C++ -> Command Line
4) Under "Additional Options" add #IncludePaths.txt
Alternatively, you can use custom properties to get this to work too.

Using kdiff3 to Edit Files During Diffs/Comparisons with TFS

Often when I do a file comparison, I want to edit my local file before committing to TFS (it's efficient). I'm able to do this with kdiff3's 3-way merge. But how do I accomplish this during comparison? I know that it's possible with BeyondCompare3, as I used to do it in the past.
These are my Tools --> Options --> Visual Studio Team Foundation Server --> Configure User Tools --> Compare Operation:
%1 -fname %6 %2 -fname %7
Was looking for answer myself, found this question, so updating with my findings.
Appears to me that edit of A or B file isn't supported out of the box in kdiff3, but you can keep an eye on this feature request opened in 2004 :)
There are workarounds though (found in comments here)
Option 1 is to use these parameters for Compare: %1 --fname %6 %2 --fname %7 -o %2, it will output to B (-o %2 part).
Option 2 is to use parameters you're using but then you'll need to click "Merge current file" in Menu and after that click "Select Line(s) from B" in the output window context menu, after that you'll be able to edit.

Different behavior of cmd on Win7 and XP

I am trying to run following code through cmd.
"C:\Program Files\Beyond Compare 2\BC2.exe" #"C:\New Folder\Myscript.txt" "C:\New Folder\A.txt" "C:\New Folder\B.txt"
This will actually open Beyond Compare and compare two text files.
The problem is ,when i run this code on cmd[Version 6.1.7601] it runs correctly but when i run it on version 5.1.2600 , it shows a fatal error :- Could not find C:/New .
I understand the error is due to space in the name(New Folder) , but why is it running fine on Win 7 .Does two versions of cmd have some difference in the way they accept arguments ?
Content of Myscript.txt :-
file-report layout:side-by-side &
options:display-all &
output-to:%3 output-options:html-color,wrap-word %1 %2
I can't explain why it is not working, but I have some potential solutions
1) Run with the current directory at the location of the files
Since the space is in the folder name, and all files are in the same location, you can avoid the folder name by simply changing directory to that folder and using a relative path.
pushd "c:\new folder"
"C:\Program Files\Beyond Compare 2\BC2.exe" #Myscript.txt A.txt B.txt
Of course this will not work if your files are in different locations, or if the file names have spaces (assuming spaces are really the problem)
2) Use the short 8.3 names
I hate the short 8.3 names because of the many bugs associated with them. But sometimes they can be useful.
You can get the short name of a file or folder by using DIR /X. Or you could use the following in a batch script to programmatically get the short paths.
for %%A in ("C:\New Folder\Myscript.txt") do (
for %%B in ("C:\New Folder\A.txt") do (
for %%C in ("C:\New Folder\B.txt") do (
"C:\Program Files\Beyond Compare 2\BC2.exe" #"%%~fsA" "%%~fsB" "%%~fsC"
)
)
)
Of course the above will not do any good if short 8.3 names are disabled on your volume.
If i understood correctly Raymond's comment ,the parsing is done by Beyond Compare not cmd.
I tried to use
file-report layout:side-by-side &
options:display-all &
output-to:"%3" output-options:html-color,wrap-word "%1" "%2"
and it worked fine on XP but shows error on windows 7 .It seems the beyond compare behaves differently for different OS.

Shorten Find Results Filepath Name

Because of all the sub-directories my code typically lives in, whenever I do a Find In File for something, the code gets run off the screen because the results window has wasted so much valuable real estate by repeating the long file path for every object in my solution. More often than not, they are in the same parent directory, or I don't really care where there from.
Is there an option to shorten the path name to perhaps just the file?
Also, the Display File Names Only option in the Find in Files dialog does not do this, it only omits the code from the result.
You can change the VS search result formatting by changing the registry.
According to the article Customize how Find in Files results are displayed in the Find Results Window:
Open up RegEdit
Go to HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\Find
Add a new string called Find result format with a value of $f$e($l,$c):$t\r\n
DANGER: This involves hacking the Registry so use this tip at your own risk!
Further, here's the syntax to use if you'd like to customize the string further:
Files
$p - path
$f - filename
$v - drive/unc share
$d - dir
$n - name
$e - .ext
Location
$l - line
$c - col
$x - end col if on first line, else end of first line
$L - span end line
$C - span end col
Text
$0 - matched text
$t - text of first line
$s - summary of hit
$T - text of spanned lines
Char
\n - newline
\s - space
\t - tab
\\ - slash
\$ - $
Things are different on Visual Studio 2017. You won't find the registry keys for Visual Studio 2017 anymore as Visual Studio 2017 now stores registry keys in a private binary file under %VsAppDataFolder%\privateregistry.bin.
However, according to this link, there is still a way to find and modify registry keys for Visual Studio 2017.
Close Visual Studio 2017
Open regedit
Select HKEY_LOCAL_MACHINE from the left bar
Select File > Load Hive...
Load the privateregistry.bin file from %localappdata%\Microsoft\VisualStudio\15.0_[instanceid]{RootSuffix}\privateregistry.bin. The RootSuffix for a normal VS installation will be blank. This is mostly used for the experimental instance
Name the key whatever you want (e.g. "VS2017") when prompted
From there, you should be able to view the entries just like any normal registry.
Customise it according to accepted answer's suggestions.
Important! Once you're finished, you need to make sure that you "Unload" the private registry, by selecting the "root" key ("VS2017" in this example) and selecting File > Unload Hive . If you don't do this, VS won't be able to read the privateregistry.bin file when it runs, causing major problems.
Update:
It also works on Visual Studio 2019 (version 16.0) too.
There is an option you can select "Find results table".
Then you can do a Ctrl+ALL and copy the tab delimited results to a spreadsheet such as Excel. Then you can see only the code instead of file names.

Resources