News for hackers. Stuff that matters.
Re:Git add -p by terhechte on Monday January 20, 2014 @09:14AM (#7089560)
I'm using SourceTree [1] as my main Git UI when I'm not in the terminal, and it makes it very easy to stage only parts of a changed file. Just as the author describes, this feature really improves the quality of the commits. It also makes it easy to remove parts of the changes in a file that were only there for debugging purposes - prior to the commit without having to go back to the editor.

It is a wonderful feature, and the fantastic thing about the SourceTree UI is that it shows it by default making it really easy for everybody who uses the app to only commit the actual, relevant changes.

[1] http://www.sourcetreeapp.com/

Re:Git add -p by Nilzor on Monday January 20, 2014 @10:01AM (#7089800)
I love how the author in a comment never advocates GUI tools because they "often abstracts away much of the underlying complexity".

WRONG. The expose the underlying complexity in a visual way much easier to interpret for the brain.

The argument of interoperability is valid, but please stop bashing UI tools just becuase "If you write code day in day out you SHOULD be comfortable on the command-line". UI tools exist for a reason.

Re:Git add -p by burntsushi on Monday January 20, 2014 @11:38AM (#7090338)
Honestly, I hate most GUI tools myself. They're often clunky and poorly designed for my tastes. (Even if there does exist a good visualization, that doesn't mean it has been discovered.)

But in this case, I agree with you. The `git gui` command is great for committing changes in patch mode visually. I use it exclusively over `git add -p`. (And it comes bundled with `git`!)

Re:Git add -p by contingencies on Monday January 20, 2014 @10:22AM (#7089898)
Though I've since stopped using it as I've permanently left OSX for the hallowed and greener fields of desktop Linux (2010 17" Macbook Pro + dual SSDs w/ZFS + Gentoo), initially I found SourceTree indispensable.

Not only was the software well considered and stable, presenting the complexities of multiple RCS/VCS in an improved yet concise visual format, but the author was very responsive to feature requests.

I asked for the custom external functions (hooks) to be definable so that I could use it as a sort of IDE for launching VM-based tests of multiplatform codebases, or more generally so that anyone could launch anything against any revision of any branch. The feature was completed impressively quickly.

The ease of cherry-picking is brilliant, as mentioned by others.

SourceTree is truly powerful software that I would still be using now if there was a Linux port. God only knows the number of redundant git pulls I have typed! The biggest current limitations of SourceTree IMHO are platform specificity and overall gooey-centrism... some features like the aforementioned hooks could probably be usefully accessed from the terminal, and I was unaware at last use of a simple methodology for achieving this.

Re:Git add -p by FrozenCow on Monday January 20, 2014 @10:12AM (#7089853)
Same for git-cola [1]. It's a simple GUI just for staging/committing changes, nothing else, so it's useful in combination with the cli.

[1] http://git-cola.github.io/

Re:Git add -p by __david__ on Monday January 20, 2014 @03:10PM (#7091502)
If you use emacs, magit apparently also has this functionality (I haven't gotten magit to work yet). I personally use http://porkrind.org/commit-patch/ via its Emacs integration, which has the benefit of working for VCSes other than git (though I personally find that becoming more and more rare as time goes by). Commit patch also has the command line tool "commit-partial" in case you don't use Emacs.

Disclaimer: A friend and I wrote commit-patch.

Re:Git add -p by mahmoudhossam on Monday January 20, 2014 @09:19AM (#7089591)
Windows or Mac only, pass.
Re:Git add -p by tootie on Monday January 20, 2014 @12:16PM (#7090556)
Git command line and Linux. The dream setup for masochists.
Re:Git add -p by pyre on Monday January 20, 2014 @06:34PM (#7092396)
This is not needlessly inflammatory how? What does this add to the discussion?
Re:Git add -p by tootie on Tuesday January 21, 2014 @05:37PM (#7099104)
You're probably right, but git just drives me insane. And so does the "no true Scotsman" approach to development.
Re:Git add -p by balac on Monday January 20, 2014 @10:48AM (#7090042)
Gitg for Linux also exposes this functionality in an easy to use way.
Re:Git add -p by santialbo on Monday January 20, 2014 @09:30AM (#7089655)
I use mostly the terminal, but when doing more advanced stuff like interactive adding, rebasings or cherry picking, SourceTree is my main tool.
Re:Git add -p by Blahah on Monday January 20, 2014 @09:51AM (#7089750)
I learned most of my git-fu from Sourcetree. It exposes a lot of the little-used git functionality.
Re:Git add -p by orkoden on Monday January 20, 2014 @09:18AM (#7089586)
Using source tree is a lot easier than git -p . I really like it.