TortoiseMerge 没有任何 CLA(命令行参数)来忽略空格并忽略大小写。经过大量搜索后,似乎仍然可以通过调整注册表值来实现。
/* DisableWhitespaceDifferences and DisableCaseDifferences.
* The settings for TortoiseMerge is stored in Registry in CurrentUser\Software\TortoiseMerge\
* DWORDS stored the property values.
*
* IgnoreWS : Set to 1 to ignore the whitespace differences.
* Set to 0 to allow the whitespace differences.
* IgnoreEOL : Set to 1 to ignore the End of Line differences.
* Set to 0 to allow the End of Line differences.
* CaseInsensitive : Set to 1 to ignore the Case differences.
* Set to 0 to allow the Case differences.
*/
// Get the key from the registry
using (RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\TortoiseMerge", true))
{
if (key != null)
{
// Set the IgnoreWS and IgnoreEOL DWORDs based on DisableWhitespaceDifferences is set or not
key.SetValue("IgnoreWS", DisableWhitespaceDifferences ? 1 : 0, RegistryValueKind.DWord);
key.SetValue("IgnoreEOL", DisableWhitespaceDifferences ? 1 : 0, RegistryValueKind.DWord);
// Set the CaseInsensitive DWORD based on DisableCaseDifferences is set or not
key.SetValue("CaseInsensitive", DisableCaseDifferences ? 1 : 0, RegistryValueKind.DWord);
// close key
key.Close();
}
}