Reputation: 20378
One of the things I like about GIT is that you can commit only some changes in a file. For example if you were doing two different changes which involved the same file, you can commit the file as two separate commits with different comments.
Like:
I spent all day working on a file before realizing that the previous days changes had not been commits, I can do the following by selecting which lines I would like to include in the commit:
Login.php [246]: previous changes
Login.php [247]: new changes
I realise that this ability is because the changeset in GIT is a DIFF, while SVN simply commits an entire file. Is it possible to have the same behavior with SVN?
If there is a SmartSVN specific hack then that would be alright since that is what we use.
Upvotes: 18
Views: 8148
Reputation: 30662
VisualSVN 6.1 introduces the new Quick Commit feature. This feature allows you to perform partial commits for changes such as typo-fixes or code comments without losing focus on the main task.
You can partially commit selected changes in a file using the new Commit this Block and Commit Selection context menu commands in the Visual Studio editor.
Get VisualSVN at https://www.visualsvn.com/visualsvn/download/.
Upvotes: 4
Reputation: 478
I haven't tried this myself, but it looks as if you can now do this using Tortoise SVN: http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-commit.html#tsvn-dug-commit-restore
Upvotes: 4
Reputation: 301037
Use git-svn, I don't think SVN has this support, or rather any of the SVN clients do apart from git-svn or even hgsubversion
Some rant:
I don't think the reason you ask for this is a proper one. It means you have to change the way you create changesets and commit. The reason I would want such a feature is for the following reason:
Say there is a build file. It has a certain set of tasks to be done in the build server. For my local box, I comment out the part where it generates installers because I don't need to do that on dev box. Now if at sometime I want to make a change in this build file, I have to undo the part where I removed the installer generation and commit my other change. In this case, I would have liked to have the ability to choose the other change and commit that alone.
Upvotes: 6