News for hackers. Stuff that matters.
Re:Commits are snapshots not diffs (2020) by breck on Thursday April 08, 2021 @02:31PM (#26742113)
Agreed. Git should be treated as a deep skill, as important to practice and train with as unit testing and regular expressions.

Think of your git history as a product and art form in itself. If you don’t enjoy writing your commit history, readers will not enjoy reading it.

On a tactical level, I highly recommend buying Sublime Merge 2.

Re:Commits are snapshots not diffs (2020) by blacktriangle on Thursday April 08, 2021 @04:01PM (#26743085)
Alternative interpretation: git is a terrible terrible tool. It solve's Linus' problem, but he also wrote the damn thing. Had GitHub not entered the scene we'd likely all be using something else, maybe even SVN still.

Maybe distributed source control really is this complicated and treating git as a deep skill is justified, but having also used Darcs and Mercurial I have a hard time believing that git's usability issues are inherent complexity and are in fact an artifact of git itself.

Re:Commits are snapshots not diffs (2020) by chipotle_coyote on Thursday April 08, 2021 @03:27PM (#26742697)
I found Sublime Merge -- although it may have been version 1 when I tried it! -- very unintuitive and fiddly, a lot like using Vim for doing three-way merges. Definitely one of those "YMMV" kinds of tools. (I mean, I'm sure Vim is terrific at it once you get the hang of it.)

Personally, I've settled on

* Getting pretty familiar with the git command line

* Using a decent GUI diff and three-way merge tool (I use Kaleidoscope)

* Using GitUp, an open source Mac git client, on occasions where I want to get kind of arcane: committing individual lines of files in separate commits, re-ordering commits (on an unmerged feature branch because I'm not a complete monster), etc.

I suspect having already discovered GitUp is a good chunk of why I didn't get into Sublime Merge; it can do a lot of advanced stuff in ways I personally find easier to grok.

Re:Commits are snapshots not diffs (2020) by codyb on Thursday April 08, 2021 @02:33PM (#26742139)
Regular expressions? I really enjoy using them and futzing around but I encourage the people I work with to stay away and to avoid using in production when possible.
Re:Commits are snapshots not diffs (2020) by turminal on Thursday April 08, 2021 @02:40PM (#26742220)
Regular expressions are useful as tools for searching through code, filtering logs, searching through the filesystem..., even if you never commit them into your codebase.
Re:Commits are snapshots not diffs (2020) by breck on Thursday April 08, 2021 @03:21PM (#26742644)
Yes, good clarification. I probably write 10x (maybe 100x? more?) more throwaway regexes than regexes I commit.
Re:Commits are snapshots not diffs (2020) by trulyme on Thursday April 08, 2021 @04:17PM (#26743224)
Whoa, why? That sounds like an awful advice to me. By all means, use regexes, but make sure you understand the theory behind them (state machines) so you will know not to parse HTML with them. They are really pretty easy to do right once you grasp the concepts.
Re:Commits are snapshots not diffs (2020) by breck on Thursday April 08, 2021 @06:34PM (#26744645)
You can write correct ad hoc regex parsers for many subsets of HTML depending upon your needs.