[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: Idea: insert diff instead of changed files

From: Michael Sims <michaels_at_crye-leike.com>
Date: 2005-02-13 01:11:40 CET

Ulrich Eckhardt wrote:
> Hi!
>
> When I commit without a message, Subversion fires up an editor to
> enter one. The preformatted message contains a section with the
> changed files, how about displaying the diff there instead? I for
> sure like having the diff present when composing a commit message...

I do too. I'm using VIM as my editor, so the first thing I do on a complicated commit is to bring up command mode (:) then read the output of "svn diff" into the buffer:

:r! svn diff

I use it while I'm typing my log message, then delete it out before I save.

I don't always need this diff, so I don't mind doing the above on an as-needed basis. But if you always want the diff there you could probably put an auto command in your vimrc to do this.

Here's a quick and dirty command that works for me. Note that I am no VIM expert and there is probably a better way to do this:

autocmd BufReadPost svn-commit*.tmp
\ set cmdheight=2 |
\ exe "normal ms" |
\ exe "normal Go" |
\ exe "r! svn diff" |
\ exe "normal `s"

At least one problem with the above is that you may only be committing one or two files and the above will diff ALL changed files in the current path. FWIW...

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sun Feb 13 01:10:41 2005

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.