[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Showing diff in commit message editor

From: Thomas S. Urban
Subject: Re: Showing diff in commit message editor
Date: Fri, 9 Jan 2004 09:08:33 -0800
User-agent: Mutt/1.4.1i

On Fri, Jan 09, 2004 at 16:34:36, Cameron McCormack spake thusly:
> When I "cvs commit" I often forget exactly what I've changed in my
> files.  Is there a way to get cvs to display in the commit message file,
> underneath the "modified files/added files/deleted files" comment, the
> diffs I am about to commit?

I use a cvscommit alias/function for csh/zsh, then set the CVSEDITOR
environment variable to open the cvstemp.diff file in addition to the
log message (setting for vim shown):

  alias cvscommit 'cvs diff \!* > cvstemp.diff || cvs commit \!*; rm 
  setenv CVSEDITOR 'vim -X -o cvstemp.diff'

zsh (sh too?):
  cvscommit () {
        cvs diff $* > cvstemp.diff || cvs commit $*
        rm -f cvstemp.diff
  CVSEDITOR='vim -X -o cvstemp.diff'
  export CVSEDITOR

When I do cvscommit [optional options/files/dirs], this gives me a vim
editor with two vim windows - one with the diffs, one with the log
message to edit.  The -X for vim tells it not connect to the X server -
a speedup for working remotely.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]