svn diff
与标志一起使用会--summarize
返回如下所示的内容。我们如何将其传递给 sed 或 grep 以执行以下操作:
- 删除所有以“D”开头的行(已删除的文件)
- 之后删除“M”、“A”或“MM”(或任何其他情况)的前缀以及选项卡。
- 删除仅保留文件名/文件夹的 URL 路径。
- 存储在文件中
例子:
D https://localhost/example/test1.php
D https://localhost/example/test2.php
M https://localhost/example/test3.php
M https://localhost/example/test4.php
A https://localhost/example/test5.php
M https://localhost/example/test6.php
A https://localhost/example/test7.php
M https://localhost/example/test8.php
M https://localhost/example/test9.php
M https://localhost/example/test10.php
A https://localhost/example/test11.php
M https://localhost/example/test12.php
M https://localhost/example/test13.php
MM https://localhost/example/test.php
M https://localhost/test0.php
然后会变成:
/example/test3.php
/example/test4.php
/example/test5.php
/example/test6.php
/example/test7.php
/example/test8.php
/example/test9.php
/example/test10.php
/example/test11.php
/example/test12.php
/example/test13.php
/example/test.php
/test0.php