views:

99

answers:

5

Is it possible to group a number of commited files together (as a single commit) after you've already committed them to the repository in Svn?

It seems I always forget a file or two after I've committed a bunch them (when not using subeclipse) and I was just wondering if anyone knew if this was possible or not.

+4  A: 

Once you make a commit, there is intentionally no way to modify it. This way r123 always refers to the same thing. If you could add files to a commit afterwards, then a person who checked-out r123 before the change would have a different view than someone who checked-out r123 after the change, breaking a key goal of any version control system.

This really is no different than the question "what should I do if I commit code that has a syntax error in it and won't build?" The answer is to commit something else that has a fix in it. The two cases create the same problems and have the same solution.

Rob Napier
+2  A: 

No, for this kind of power you would need a tool like Git.

RedFilter
Perhaps only for local commits. Once the commit has gone public is it really a good idea to be altering it?
Danny
+1  A: 

To follow up on a previous answer.

I use Git SVN almost exclusively at this point for its ability to keep local revisions and then merge them into the SVN tree when i am fully done with the feature. When working with Git SVN, I commit my changes locally and when I am completely done, then sync to SVN.

Rob Di Marco
Good point, I use this myself and forgot to mention it.
RedFilter
Yeah, that is actually a good feature of distributed version control.
Jim T
A: 

A workaround: reverse-merge all the revisions in question, commit, apply again the changes from those revisions to your WC, commit all at once.

Disclaimer: I haven't tried it.

Milen A. Radev
Whilst that fixes the problem, your log now shows 2 additional commits, and all three commits will need to be rolled forward into your release branch (and documented)
Jim T
+1  A: 

I find the best solution to use a higher level tool to group revisions together and track changes.

We use redmine to document all tasks, and our svn revisions are automatically stamped against that. Working this way, even though a fix may take 7 or 8 commits, you can quickly search your log and roll the fixes for Bug #366 into release as a single unit.

Redmine, trac, fogbugz, bugzilla, tfs, all good.

Jim T
Fogbugz...Jeff Atwood represent'n... :)
leeand00
trac...hmm I wonder how ya do that in there...I've got Trac one of my projects, I'll have to look into how you do that...with...maybe another question...
leeand00
Okay here's that another question: http://stackoverflow.com/questions/927698/group-revisions-together-with-trac
leeand00