简体   繁体   English

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

[英]tf diff /recursive /format:unified - how to not include folder names in output

I want to generate the diff between two versions in TFS as a unified diff file. 我想在TFS中将两个版本之间的差异生成为统一的差异文件。 I do 我做

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

The generated output contains all the differences in files as I want to, but it also includes 4 additional lines for each folder it compares, even if there are no differences. 生成的输出包含我想要的文件中的所有差异,但即使没有差异,它也为比较的每个文件夹包含4条额外的行。 So for a large project with few actual code changes between the given changesets, a diff file is generated consisting to 90+% of lines like: 因此,对于一个大型项目,在给定的变更集之间几乎没有实际的代码变更,将生成一个包含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 
===================================================================

Is there any way to tell tf to not include those lines? 有什么办法告诉tf不要包含这些行?

Thanks 谢谢

I dont' think this is available with tf.exe. 我不认为tf.exe可用。 Since the lines differ by the versionspec, I would recommend opening the file in Visual Studio and doing a search and replace with regular expressions. 由于各行的版本规格不同,因此我建议在Visual Studio中打开文件,然后进行搜索并用正则表达式替换。 I tried the text you supplied and got 4 hits with the expression, ^.*/TFSPATH/PROJECT/FOLDER/.*;C\\d{5} 我尝试了您提供的文本,并用表达式^.*/TFSPATH/PROJECT/FOLDER/.*;C\\d{5}获得了4次匹配

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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