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

Re: Prevent accidental commits

From: Hari Kodungallur <hkodungallur_at_gmail.com>
Date: Wed, 11 Jun 2008 15:20:50 -0700

On Wed, Jun 11, 2008 at 3:00 PM, Ryan Schmidt <
subversion-2008b_at_ryandesign.com> wrote:

> On Jun 11, 2008, at 01:36, Jeenu V wrote:
> I'm wondering whether there's a means by which I can prevent myself from
>> an accidental commit, from a particular directory in my working copy. Most
>> of the times, I do an "svn ci" from a top-level directory, oblivious about a
>> not-ready-to-commit change in some of the sub-directories. I realize the
>> mistake mostly when I see the "sending ..." messages from the commit
>> command.
>> I thought I could use the "svn lock" but, IIUC, that only prevents others
>> from making commits. I was thinking of some client-side hooks to assist me,
>> and AFAIK, that's not supported by SVN.
> Right, "svn lock" is not applicable, and there are no client-side hooks.
> The correct solution is probably to look at the output of "svn status" and
> "svn diff" and make sure that you really want to commit all shown
> differences. Only then should you run "svn commit".

In addition to "svn st" and "svn diff", I also suggest that you don't do the
commit with the commit message already in the command line. Force it to open
the editor. In the editor you can see the files that it will commit. You can
not modify the file list in the editor, but if you see anything in there
that you don't want to commit, you have the option of quitting the editor
without making any changes. Which in turn gives you an option of aborting
the commit.

Received on 2008-06-12 00:21:17 CEST

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.