我想在TFS中作为统一的diff文件生成两个版本之间的差异。我做
tf diff $/TFSPATH/PROJECT/FOLDER /recursive /version:C12345~C12346 /format:unified
生成的输出包含我想要的文件中的所有差异,但它还包括它比较的每个文件夹的4个额外行,即使没有差异。因此,对于在给定更改集之间实际代码更改很少的大型项目,将生成一个diff文件,其中包含90%以上的行,如:
Diff folder : $/TFSPATH/PROJECT/FOLDER/SUB/SUB1;C12345
against folder: $/TFSPATH/PROJECT/FOLDER/SUB/SUB1;C12346
===================================================================
Diff folder : $/TFSPATH/PROJECT/FOLDER/SUB/SUB1/SUB;C12345
against folder: $/TFSPATH/PROJECT/FOLDER/SUB/SUB1/SUB;C12346
===================================================================
是否有办法告诉tf
不包含这些行?
谢谢
我不认为这是可用的tf.exe。由于行因版本规范而异,我建议在Visual Studio中打开文件并进行搜索并使用正则表达式替换。我尝试了您提供的文本,并获得了4个表达式,^.*/TFSPATH/PROJECT/FOLDER/.*;Cd{5}