tf diff / recursive / format:unified - 如何在输出中不包含文件夹名称

时间:2013-06-04 10:08:48

标签: command-line tfs diff tf-cli unified-diff

我想在TFS中将两个版本之间的差异生成为统一的差异文件。我做了

tf diff $/TFSPATH/PROJECT/FOLDER /recursive /version:C12345~C12346 /format:unified

生成的输出包含我想要的文件中的所有差异,但它还包括它比较的每个文件夹的4个额外行,即使没有差异。因此,对于在给定变更集之间几乎没有实际代码更改的大型项目,将生成包含90%以上行的diff文件,如:

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不包括这些行?

由于

1 个答案:

答案 0 :(得分:0)

我不认为tf.exe可以使用它。由于版本规范的行不同,我建议在Visual Studio中打开文件并进行搜索并替换为正则表达式。我尝试了你提供的文本,并使用表达式^.*/TFSPATH/PROJECT/FOLDER/.*;C\d{5}

获得了4次点击