Justin Wong
Justin Wong

Reputation: 1497

Tortoise SVN logging without committing

I normally make multiple small edits to my source code, but I don't want to commit just yet, since the changes are rather trivial. The current method I'm using right now is to log the changes in a text file, then copying the contents into the log when committing.

Is it possible when using Tortoise SVN (or any other SVN tool) to attach log messages to the copy I'm currently working on as I'm editing, then when committing, the log messages are automatically attached to the commit, so I don't have to remember all the changes I've made so far?

Upvotes: 3

Views: 427

Answers (3)

si618
si618

Reputation: 16848

What's wrong with using a diff tool and reviewing your changes before commit?

If you can't remember the reason for changes, or work them out from the code, then isn't that a clue that you need to commit more often? Commits are cheap and quick, and if the changes are logically related in a revision, it makes reverting and merging (in the future) much easier.

Upvotes: 1

richo
richo

Reputation: 8989

When you do a commit and it fails, tortoiseSVN stores the commit message for you to bring it up when you retry. Find that file and append to it would be my suggestion.

vanilla svn is commit.tmp, that's probably a good starting place to look.

EDIT:

EDIT EDIT: You're using tortoise which implies windows. So, you'll probably need something that works on windows. I've quickly rewritten it in python since I suck at cmd scripting

Alternatively, create a directory called logs, store all your notes in there and then do something like this for a commit script

for i in `ls logs`; do
    echo -n "$i: "
    cat logs/$i >> commitFile
done
svn commit -F commitFile

Or in python

#!/usr/bin/python
import os
dirlisting = os.listdir('logs')
commitFile = open("commitfile.tmp", "w")
for i in dirlisting:
    log = open(i, 'r')
    commitFile.write(log.read())
    log.close()
os.execlp("svn", "svn", "commit", "-F", "commitfile.tmp")

You'll need to fix the last line to do something that calls tortoise instead though. I have not tested either of these scripts.

Obviously you'd want to clean this up a little bit and make it a bit smarter, but you can see what I'm driving at.

Upvotes: 1

Mahesh Velaga
Mahesh Velaga

Reputation: 21991

Interesting Question.

This answer is probably out of context, but if you are flexible to move towards another version control system, I would suggest moving to Git (allows you to have local commits). I am not saying anything aganist SVN, its great, just that Git might suite you better as per the use case.

Upvotes: 0

Related Questions