Make a patch of the complete files modified by commits

I don’t know how to call this post. I have a problem with patch (I’m too bad to get it t work properly) so I want to export a list of the files I have modified between two subversion commits. This is how I do it for now (I’m sure it’s extremely perfectible).

svn co http://mysvnproject/trunk/project@1

This gets me the first version

svn update > diff-files.txt

This updates my copy to the latest version, but most importantly, it generates a list of files that have been updated or added. Something like this:

U    whoisonline.php
U    main/blog/blog.php
U    main/auth/my_progress.php
A    main/auth/user_list.php
U    main/auth/profile.php
A    main/auth/profile2.php

Now I want to edit the resulting file and remove the first characters of each line. Can do that with VIM’s command:

:% s/^[AU]   //

Now I have a file that is a list of only the files I want. Let’s put them into a TAR archive:

tar zcvf diff-files.tgz `cat diff-files.txt` –exclude-vcs

The exclude-vcs option is a genius option that allows me to ignore all the .svn, .CVS or whatever versioning system files there are.

You now have a diff-files.tgz file containing all the files you need to get your “pseudo-patch” working.

It's only fair to share...Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInShare on TumblrEmail this to someone

Leave a Reply

Your email address will not be published. Required fields are marked *