Can RubyMine stage partial file changes to git?

Some tools (such as GitX) let you select specific lines to the set of things to be committed. It can also be done from the command line, (via "git add -p path/to/file")

Is this possible in RubyMine? The RubyMine change viewer is far-superior to GitX, because you can edit the file and you can see the changes in full context...

so it would be really great to be able to stage individual lines.

4 comments
Comment actions Permalink

This is not currently supported. We don't really think that staging partiial changes is a good idea, because the specific version of the file that you create during the commit process (by selecting individual chunks of your working copy) goes into the repository without any validation - it's not tested and not even checked for syntax errors.

0
Comment actions Permalink

Okay... but ultimately, I'm the one responsible for the code. And usually the way this is used is to segregate a bunch of changes into individual commits, so that the commits can be labeled with finer detail about what the commit represents. Once all of the chunks are committed, the the file is as valid as is I had committed it in its entirety.

If you wanted to enable this feature, an alternate would be to unshelve individual pieces, let RubyMine do its validations, and then let me commit the file.

0
Comment actions Permalink

This is already supported. If you invoke diff from the shelf view, the arrow icons allow you to restore individual chunks of a shelved version.

0
Comment actions Permalink

Awesome! Glad I asked.

0

Please sign in to leave a comment.