Live data from Hacker News

Git pretty

justinhileman.info

21–30 of 65 posts

Re: Git pretty

#21
post #4

This is excellent: opinionated and correct. Guess what happens if you try to git revert a merge? Yeah. Don’t do that. You can, but you really need to understand what happens when you do so, so that you're not confused by future merges from the same branch. Straight from the horse's mouth: https://www.kernel.org/pub/software/scm/git/docs/howto/rever...

Reverting a merge is totally OK if you kept your history clean and rebased the branch you're merging into to get updates instead of merging it into your branch.

Like if you created a new branch from master and you have been merging master into your branch to get updates in master, once you merge your branch into master you cannot revert this merge because the act of merging master into your branch changed which branch owned commits.

If you rebased master into your branch instead everything will be fine. If you merge your branch into master, reverting that merge will simply undo the merge as you expected.

Re: Git pretty

#23

"Split off a logical chunk from your mess, stage it" should really be another box with "git add -p". Being able to pick and choose (and even edit) individual chunks to be staged is enormously useful. Quite possibly my favourite feature of git.

I agree with the git add -p , but I feel that at point, it often should be followed by a stash then a rebuild and/or some testing. Next, commit and unstash to continue.

Re: Git pretty

#24
magit mode in emacs has bailed me out numerous times from git messes. If you're an emacs and git user but not using magit, you're seriously missing out.

Re: Git pretty

#25

"Split off a logical chunk from your mess, stage it" should really be another box with "git add -p". Being able to pick and choose (and even edit) individual chunks to be staged is enormously useful. Quite possibly my favourite feature of git.

I agree with the git add -p , but I feel that at point, it often should be followed by a stash then a rebuild and/or some testing. Next, commit and unstash to continue.

Yep yep. `git add -p`, `git stash -p`, etc. That's exactly why that bit of the chart isn't very specific. There's a whole workflow right there, in that one little cycle. One of these days I'll get around to writing that one up :)

Re: Git pretty

#26

Earlier quoted context omitted.

I agree with the git add -p , but I feel that at point, it often should be followed by a stash then a rebuild and/or some testing. Next, commit and unstash to continue.

Yep yep. `git add -p`, `git stash -p`, etc. That's exactly why that bit of the chart isn't very specific. There's a whole workflow right there, in that one little cycle. One of these days I'll get around to writing that one up :)

git isolate! I've been trying to make something like this :( Unfortunately my git-fu is failing me.

Re: Git pretty

#27

magit mode in emacs has bailed me out numerous times from git messes. If you're an emacs and git user but not using magit, you're seriously missing out.

Dunno, I've been very happy with egg. But then, due to a large part of my career being maintenance, I've fallen into a lot of self-discipline patterns that tend to keep me out of messes.

Re: Git pretty

#28
post #16

git is only good for people that was working like Linus. if you didn't have been accepting patches by email but instead had a fluid svn, perforce, etc central repository and people already collaborating with commit powers, then if you move to git "just because" (which is the reason of 99% migrations) you're going to have a bad time. sadly, my company decided to move just to use pull requests as a poor man's code revi…

Considering that there are multiple widely used code review systems based on git that aren't based on pull requests, I can safely say your premise is null and void. Not to mention I can't quite parse the broken grammar of your second sentence.

Re: Git pretty

#29

"Split off a logical chunk from your mess, stage it" should really be another box with "git add -p". Being able to pick and choose (and even edit) individual chunks to be staged is enormously useful. Quite possibly my favourite feature of git.

Mine too.

If you ever want that functionality on a non-git VCS, I co-wrote a tool that does just that (it predates git, actually) called commit-patch[1]. It integrates into Emacs nicely and also has 'commit-partial' for a nice command-line interface.

[1] http://porkrind.org/commit-patch/

Re: Git pretty

#30

magit mode in emacs has bailed me out numerous times from git messes. If you're an emacs and git user but not using magit, you're seriously missing out.

Dunno, I've been very happy with egg. But then, due to a large part of my career being maintenance, I've fallen into a lot of self-discipline patterns that tend to keep me out of messes.

egg looks pretty similar to magit in terms of functionality. I haven't tried it, but I would guess either one is fine.
Post reply on HN