You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Geoffrey <li...@serioustechnology.com> on 2007/02/26 15:16:34 UTC

terminating a commit..

We are relatively new to subversion and we find that often times we are 
attempting to commit a piece of code, only to find out that when we are 
thrown into our editor (vi) there are files listed that were modified 
that we did not want to have committed.

I know how to uncommit code if necessary, but want I was wondering is, 
is there a way to terminate the commit once you are in the editor?

Or, is the commit going to be successful, even if you terminate the 
editor and/or quit the editor without modifying the input.

-- 
Until later, Geoffrey

Those who would give up essential Liberty, to purchase a little
temporary Safety, deserve neither Liberty nor Safety.
  - Benjamin Franklin

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: terminating a commit..

Posted by Geoffrey <li...@serioustechnology.com>.
Troy Curtis Jr wrote:

> This is tooting my own horn a little here, but this situation annoyed
> me enough that I wrote a small 'svn ci' wrapper script.  Bascially, I
> designed it to behave exactly like 'svn ci' (all the same options,
> etc), only it allows you to delete out files from inside your editor
> that you do not want to commit.
> 
> I am using it at work along with about a dozen other developers and it
> seems to work well.  I do think there are a few tweaks that I haven't
> put into the public version yet, but it should be pretty easy to do if
> there is interest.  You can check it out at:
> 
> http://troyjr.hopto.org/projects/svn/svnci/trunk/svnci.pl
> 
> Troy

Thanks for the pointer Troy.


-- 
Until later, Geoffrey

Those who would give up essential Liberty, to purchase a little
temporary Safety, deserve neither Liberty nor Safety.
  - Benjamin Franklin

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: terminating a commit..

Posted by Troy Curtis Jr <tr...@gmail.com>.
On 2/26/07, Geoffrey <li...@serioustechnology.com> wrote:
> We are relatively new to subversion and we find that often times we are
> attempting to commit a piece of code, only to find out that when we are
> thrown into our editor (vi) there are files listed that were modified
> that we did not want to have committed.
>
> I know how to uncommit code if necessary, but want I was wondering is,
> is there a way to terminate the commit once you are in the editor?
>
> Or, is the commit going to be successful, even if you terminate the
> editor and/or quit the editor without modifying the input.
>
> --
> Until later, Geoffrey
>
> Those who would give up essential Liberty, to purchase a little
> temporary Safety, deserve neither Liberty nor Safety.
>   - Benjamin Franklin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
>

This is tooting my own horn a little here, but this situation annoyed
me enough that I wrote a small 'svn ci' wrapper script.  Bascially, I
designed it to behave exactly like 'svn ci' (all the same options,
etc), only it allows you to delete out files from inside your editor
that you do not want to commit.

I am using it at work along with about a dozen other developers and it
seems to work well.  I do think there are a few tweaks that I haven't
put into the public version yet, but it should be pretty easy to do if
there is interest.  You can check it out at:

http://troyjr.hopto.org/projects/svn/svnci/trunk/svnci.pl

Troy
-- 
"Beware of spyware. If you can, use the Firefox browser." - USA Today
Download now at http://getfirefox.com
Registered Linux User #354814 ( http://counter.li.org/)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: terminating a commit..

Posted by Marshall White <ma...@pobox.com>.
----- Original Message ----- 
From: "Vincent Lefevre"
Sent: Tuesday, February 27, 2007 12:10 PM
Subject: Re: terminating a commit..


> On 2007-02-26 17:11:38 +0100, Méresse Christophe wrote:
>> > I know how to uncommit code if necessary, but want I was
>> > wondering is, is there a way to terminate the commit once you
>> > are in the editor?
>>
>> Simply quit vi without saving, subversion will ask you if you want
>> to continue the commit or abort it.
>
> But this is a problem if the saved, and then decide not to commit.
> I can see two simple solutions:
>
> 1. If empty log messages are forbidden, save an empty file before
> quitting the editor.
>
> 2. Have an editor macro that kills the parent (not sure what signal
> is best) and quit the editor.
>
> -- 

If you are using "vim" and you have already saved your commit message, you 
can exit vim with ":cq".
Vim will exit with an error code, and svn will not perform the commit.

$ svn commit
svn: Commit failed (details follow):
svn: system('vim svn-commit.tmp') returned 256

This ":cq" command is also very useful for getting out of the "svn diff" 
cycle if you have vim set up to handle displaying diffs.
For instance, I have this script as my "diff-cmd":

$ cat ~/bin/vim_wrapper
#! /bin/bash

vim -R -d "$6" "$7"

if [ $? -ne 0 ] ; then
        exit 2
fi

If I am right in the middle of looking through several diffs, and need to 
stop, I can just type ":cq" and svn will not show me the rest.

$ svn diff
Index: noise2.c
===================================================================
2 files to edit
Index: file name.c
===================================================================
2 files to edit
Index: shrink_wav.c
===================================================================
2 files to edit
svn: '/home/marshall/bin/vim_wrapper' returned 2


Other editors may have similar command to exit with error codes.


Marshall

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: terminating a commit..

Posted by Vincent Lefevre <vi...@vinc17.org>.
On 2007-02-26 17:11:38 +0100, Méresse Christophe wrote:
> > I know how to uncommit code if necessary, but want I was 
> > wondering is, is there a way to terminate the commit once you 
> > are in the editor?
> 
> Simply quit vi without saving, subversion will ask you if you want
> to continue the commit or abort it.

But this is a problem if the saved, and then decide not to commit.
I can see two simple solutions:

1. If empty log messages are forbidden, save an empty file before
quitting the editor.

2. Have an editor macro that kills the parent (not sure what signal
is best) and quit the editor.

-- 
Vincent Lefèvre <vi...@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: terminating a commit..

Posted by Vincent Lefevre <vi...@vinc17.org>.
On 2007-02-28 16:57:43 -0700, Jeff Smith wrote:
> On Tuesday 27 February 2007 10:16, Vincent Lefevre wrote:
> > But this is a problem if the saved, and then decide not to commit.
> > I can see two simple solutions:
> >
> > 1. If empty log messages are forbidden, save an empty file before
> > quitting the editor.
> >
> > 2. Have an editor macro that kills the parent (not sure what signal
> > is best) and quit the editor.
> 
> Instead of the trouble of killing processes, wouldn't it just be 
> easier to just delete the file you had unintentionally saved?

Yes, this works. And renaming it allows to keep the log.

-- 
Vincent Lefèvre <vi...@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: terminating a commit..

Posted by Jeff Smith <js...@robotronics.com>.
On Tuesday 27 February 2007 10:16, Vincent Lefevre wrote:
> But this is a problem if the saved, and then decide not to commit.
> I can see two simple solutions:
>
> 1. If empty log messages are forbidden, save an empty file before
> quitting the editor.
>
> 2. Have an editor macro that kills the parent (not sure what signal
> is best) and quit the editor.

Instead of the trouble of killing processes, wouldn't it just be 
easier to just delete the file you had unintentionally saved?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: terminating a commit..

Posted by Geoffrey <li...@serioustechnology.com>.
Méresse Christophe wrote:

>> We are relatively new to subversion and we find that often times we
>> are attempting to commit a piece of code, only to find out that
>> when we are thrown into our editor (vi) there are files listed that
>> were modified that we did not want to have committed.
>> 
>> I know how to uncommit code if necessary, but want I was wondering
>> is, is there a way to terminate the commit once you are in the
>> editor?
> 
> Simply quit vi without saving, subversion will ask you if you want to
> continue the commit or abort it.

Got the same pointer from others in private email.  Thanks, that's 
exactly what I was looking for.

-- 
Until later, Geoffrey

Those who would give up essential Liberty, to purchase a little
temporary Safety, deserve neither Liberty nor Safety.
  - Benjamin Franklin

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

RE: terminating a commit..

Posted by Méresse Christophe <ch...@nagra.com>.
 

> -----Original Message-----
> From: Geoffrey [mailto:lists@serioustechnology.com] 
> Sent: lundi, 26. février 2007 16:17
> To: users@subversion.tigris.org
> Subject: terminating a commit..
> 
> We are relatively new to subversion and we find that often 
> times we are attempting to commit a piece of code, only to 
> find out that when we are thrown into our editor (vi) there 
> are files listed that were modified that we did not want to 
> have committed.
> 
> I know how to uncommit code if necessary, but want I was 
> wondering is, is there a way to terminate the commit once you 
> are in the editor?

Simply quit vi without saving, subversion will ask you if you want to continue the commit or abort it.

Regards,
Christophe

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org