News for hackers. Stuff that matters.
Re:What Could I Possibly Learn From a Mentor Half My Age by pacala on Monday September 12, 2016 @11:27AM (#12480514)
Deep knowledge of git is a sign of immaturity :) There are literally 10 commands one will ever need, which can be conveniently aliased to something more sane. Keep the brain space for something that produces higher value add.
Re:What Could I Possibly Learn From a Mentor Half My Age by teej on Monday September 12, 2016 @11:50AM (#12480716)
Ehh, I've been in situations where I screwed up so bad I had to find the "person who actually knows Git" come and save me. Let the kid go deep into whatever they want. Maybe having useful knowledge that others don't drives that person to like coding and makes it fun for them.
Re:What Could I Possibly Learn From a Mentor Half My Age by dasil003 on Monday September 12, 2016 @12:18PM (#12480982)
I disagree, git is my favorite VCS by far because of the power it gives to truly craft a record of ones development history. A finely crafted development history pays major dividends as a project ages. I just got a thank you note for commit messages I wrote 4 years ago on a previous project.

A lot of devs see commit messages and rebasing as useless pedantry, but once you start to take it seriously it only takes a little bit of extra time, and it provides so much future benefit via git-bisect and general spelunkability.

I also think it's worth investing more time in a tool based on its longevity in ones workload. In that regard I put git at the top of the food chain, as I expect to use it even longer than Linux, for example in my case: Git > Linux > Vim > Ruby/Python > OS X / GUI tools.

A side effect of being this good at git is the ability to bail out your colleagues when they royally fuck up a merge or rebase.

Re:What Could I Possibly Learn From a Mentor Half My Age by pacala on Monday September 12, 2016 @01:20PM (#12481618)
For development history, we're using good PRs and good PR comments on GitHub. We've started using GitHub squash commits, but not enough long term usage to say how reliable it is. No need to manually rebase or fix someone else's broken rebase.

The workflow is directly inspired by git-as-a-wrapper-around-Perforce used at Google.

Re:What Could I Possibly Learn From a Mentor Half My Age by dasil003 on Monday September 12, 2016 @04:17PM (#12483275)
I'm a big fan of PRs/comments on GitHub as well (although they do raise some data ownership issues). Squashed commits are interesting, but not something I've used personally in GitHub. I think squashing, especially automatically, has big tradeoffs.

It's nice to have a cohesive unit of change in a single commit, but if your mergeable features have a lot of moving parts it may be too much information in one giant blob, losing valuable history. There are certain things I like to be in individual commits, like for instance, DB migrations in Rails or Django, or Gemfile/Gemfile.lock upgrades. Having these in separate commits allows for easier conflict resolution later, and are also a nice granularity for practices like zero-downtime continuous deployment where you need to have multi-phase deploy of migrations (ie. phase 1: deploy migrations that add fields, phase 2: deploy code that requires new fields, phase 3: remove fields required by legacy code).

Maybe in a large team with a large volume of PRs then squashing by default is preferred so you can make sense of a fast-moving history, but given that it's so easy to squash selectively with `git rebase -i` that is my preferred method, at least for the team I'm on now.

Re:What Could I Possibly Learn From a Mentor Half My Age by barrkel on Monday September 12, 2016 @12:09PM (#12480898)
I find thinking of git as a DAG of diffs, and branches as mutable references to DAG nodes, a simplifying conceptualization. I found git really easy to pick up and much, much simpler to learn and use than svn or cvs.

Thinking of it this way, I know the solution to my code repo problems before I know the exact commands that perform the graph transitions. Because I have this mental model, I know the commands must exist in one form or another.

Re:What Could I Possibly Learn From a Mentor Half My Age by gregshap on Monday September 12, 2016 @11:56AM (#12480764)
1) You never know what someone means by 'deep knowledge' 2) What works on a personal project, or microservice repo, might not scale well with many engineers doing overlapping work in the same codebase 3) consider that even if you are perfect, other people can make mistakes that introduce issues 4) 'advanced' techniques can make a complex version history more readable, which pays dividends by saving brain space in the future
Re:What Could I Possibly Learn From a Mentor Half My Age by copperx on Monday September 12, 2016 @11:43AM (#12480667)
Some day you will be caught in a corner case and you'll spend half a day learning about git's internals.
Re:What Could I Possibly Learn From a Mentor Half My Age by alexbanks on Monday September 12, 2016 @11:57AM (#12480777)
Which I've always thought was a sign of mediocre software, but HN/Reddit seems to crucify those that criticize git.

I think Git is like Javascript, it takes relatively little time to learn enough to get up and running, causing most people to forgoe learning all they'll actually need to be successful.

Re:What Could I Possibly Learn From a Mentor Half My Age by pacala on Monday September 12, 2016 @11:57AM (#12480786)
I've been using git for 7 years now, never had the need to go deeper. Lately, I'm using github and pushing / saving my work every so often [kind of like CTRL + S in Windows Office in the '90s]. If something goes wrong, happy to yank the local git and start with a fresh clone from github :)
Re:What Could I Possibly Learn From a Mentor Half My Age by mixmastamyk on Monday September 12, 2016 @02:58PM (#12482601)
Re:What Could I Possibly Learn From a Mentor Half My Age by thesmallestcat on Monday September 12, 2016 @11:56AM (#12480763)
You have to know how git works to use those commands competently...
Re:What Could I Possibly Learn From a Mentor Half My Age by Koshkin on Monday September 12, 2016 @06:55PM (#12484338)
I am not sure if that would be a good thing to say about Git. The idea is that a well-designed system with a sane user interface should insulate the user as much as possible from the need to know the system's internals.
Re:What Could I Possibly Learn From a Mentor Half My Age by thesmallestcat on Monday September 12, 2016 @08:15PM (#12484791)
Not the internals, but what the commands are doing. What the index is, what a parent or child reference is, things like that are essential to using git effectively.