svn diff non-temporary files option
Hi, I'm using vimdiff as my diff tool for svn diff. The wrapper is simple one line command "vimdiff -R $6 $7". Having open vimdiff, it happens often that I would like to fix my local changes, mostly typos, small stuff, etc. It would be thus handy if I can do it in vimdiff, rather than open the file separately. I thought that there should be some svn diff option to do so, but I did not find that. After searching internet, I found few similar questions with no answers. I briefly went through red-bean SVN book, chapter 7., that has some details on external diff tool setup, etc. but I haven't found solution there also. I search your bugs also with no result. Likely I can resolve this with some small Bash scripting, like getting my base file revision via "svn info", then export that file revision from the repository, save it to some temp_base_file and call vimdiff directly without "svn diff" like "vimdiff -R temp_base_file file", but this seems to me odd. At least just because I will not see potential changes in the file attributes. So, is there a way how to provide the real local file for the external diff tool "right side"? Thank you,Juraj
Re: svn diff non-temporary files option
On 07.02.2018 13:07, Juraj Priskin wrote: > Hi, > > I'm using vimdiff as my diff tool for svn diff. The wrapper is simple > one line command "vimdiff -R $6 $7". Having open vimdiff, it happens > often that I would like to fix my local changes, mostly typos, small > stuff, etc. It would be thus handy if I can do it in vimdiff, rather > than open the file separately. > > I thought that there should be some svn diff option to do so, but I > did not find that. After searching internet, I found few similar > questions with no answers. I briefly went through red-bean SVN book, > chapter 7., that has some details on external diff tool setup, etc. > but I haven't found solution there also. I search your bugs also with > no result. > > Likely I can resolve this with some small Bash scripting, like getting > my base file revision via "svn info", then export that file revision > from the repository, save it to some temp_base_file and call vimdiff > directly without "svn diff" like "vimdiff -R temp_base_file file", but > this seems to me odd. At least just because I will not see potential > changes in the file attributes. > > So, is there a way how to provide the real local file for the external > diff tool "right side"? No; because 'svn diff' hides differences in end-of-line style and keyword expansions, it has to preprocess the files in the working copy, and it sends those preprocessed files to the external diff wrapper. We could theoretically skip that part for files that don't have svn:eol-style or svn:keywords properties, but then the tool invocation would be inconsistent. Your best bet is to use an editor that has Subversion support built in. -- Brane
Re: svn diff non-temporary files option
On Wed, Feb 7, 2018 at 8:21 AM, Branko Čibej wrote: > No; because 'svn diff' hides differences in end-of-line style and > keyword expansions, it has to preprocess the files in the working copy, > and it sends those preprocessed files to the external diff wrapper. > > We could theoretically skip that part for files that don't have > svn:eol-style or svn:keywords properties, but then the tool invocation > would be inconsistent. > > Your best bet is to use an editor that has Subversion support built in. :(Looking innocent over here.) Emacs? https://xkcd.com/378/
Re: svn diff non-temporary files option
On 07.02.2018 15:06, Nico Kadel-Garcia wrote: > On Wed, Feb 7, 2018 at 8:21 AM, Branko Čibej wrote: > >> No; because 'svn diff' hides differences in end-of-line style and >> keyword expansions, it has to preprocess the files in the working copy, >> and it sends those preprocessed files to the external diff wrapper. >> >> We could theoretically skip that part for files that don't have >> svn:eol-style or svn:keywords properties, but then the tool invocation >> would be inconsistent. >> >> Your best bet is to use an editor that has Subversion support built in. > :(Looking innocent over here.) Emacs? What else do you suppose I'm using? :) -- Brane
Re: svn diff non-temporary files option
Branko Čibej wrote on Wed, 07 Feb 2018 14:21 +0100: > No; because 'svn diff' hides differences in end-of-line style and > keyword expansions, it has to preprocess the files in the working copy, > and it sends those preprocessed files to the external diff wrapper. > > We could theoretically skip that part for files that don't have > svn:eol-style or svn:keywords properties, but then the tool invocation > would be inconsistent. > > Your best bet is to use an editor that has Subversion support built in. Or we could add some context information in argv[8] of the diff-cmd to make it easier for them to be intelligent. (Right now only 1..7 are used, IIRC)