2

I want to combine multiple 'diff' svn files, into one big one, all of which are non-sequential.

I believe i need to convert the svn diff files to a new format where some other tool can combine them. I do not want to use merge i just want a unified diff of multiple non-sequential commits.

svn diff -c 1002 > diff2.txt
svn diff -c 1001 > diff1.txt

The above code produces 2 good 'svn diff files'. How would I combine them? I see that svn diff has a '--git' optinon so i am generating a diff file that is compatible with git. How would i take multiple .gittdiff files and combine them to get a unified git file.

http://svnbook.red-bean.com/en/1.8/svn.ref.svn.html#svn.ref.svn.sw.git

Note: I am on windows, so i need a windows solution.

1 Answers1

2

You could try combinediff that comes with patchutils. You can easily run it in Bash via Windows Subsystem for Linux. See Windows Subsystem for Linux Installation Guide for Windows 10.

enter image description here

Here is an example:

sudo apt-get install patchutils
svn diff -c100001 https://svn.example.com/MyRepo/ > 1.diff
svn diff -c100002 https://svn.example.com/MyRepo/ > 2.diff
combinediff 1.diff 2.diff > out.diff

Note that I think that you will need to adjust the command line to meet your requirements.

bahrep
  • 29,961
  • 12
  • 103
  • 150
  • I am not on linux, how would I do that on windows, install patchutils on windows? – ionescu victor Sep 04 '19 at 14:10
  • @ionescu, for native Windows tools install MSYS2 - same package names: "pacman -S diffutils patch patchutils". – kxr Jun 20 '20 at 13:44
  • @kxr the answer already shows how to install Linux tools on Windows without having to deal with msys2. – bahrep Jun 20 '20 at 13:48
  • @bahrep yes it does. But in the given answer you need to deal with wsl2 (that could mean changing bios options, i.e. Virtual Machine Platform a subset of hyper-v). So an alternative given by kxr is always good to know – Martin Horatschek Aug 16 '21 at 07:47