r/programming • • Jun 19 '14

Reinventing GIT interface

http://tonsky.me/blog/reinventing-git-interface/
221 Upvotes

325 comments sorted by

View all comments

Show parent comments

22

u/rwilcox Jun 19 '14

Any halfway competent developer should be able to master git in a couple of weeks

I disagree. I've been using Git every day for 6 years now and I've found Git's learning curve to be like a rollercoaster loop-de-loop: you're doing OK, then suddenly you need to do something that makes you go WTF so much you feel like you know less than you did 6 months ago.

git add, git commit, git push, basic branch workflow, sure. Mastering Git? I'd say years.

Quick how do you find the name of the branches the current commit is on? Push the current branch to the server but name it something different? Tell me about git push --force. What does git fetch do? What's in your global core.excludesfile file?

(Seriously, the number of developers that don't even know about Git's global ignore options is staggering. (I should never see .DS_Store files in my Git repo, but what do I see all the fracking time? .DS_Store files... Yes, thanks OS X, but still....))

-5

u/[deleted] Jun 19 '14 edited Jun 19 '14

I don't get what more is beyond "mastering" it ... Once you can successfully deploy/support a project with it you're doing exactly what it was meant for.

Hell if you do something freakishly stupid you can still just hack the packfiles/objects directly ... it's not like the file format isn't documented.

We've shipped several dozen tagged releases of over a half dozen different projects to customers already and even have a few LTS branches floating around. I can't imagine another task I'd be doing with Git [on purpose] that I haven't already encountered.

edit: To answer your questions though: Which branch a commit is on? You don't because that's not how git works. You can always see if they are connected by doing something like git log foo..bar, why would you want to rename a branch but it's git push -u origin new_name, I never use --force ... and I've never used excludesfile

6

u/rwilcox Jun 19 '14

Which branch a commit is on? You don't because that's not how git works.

git branch -a --contains SHA1 (I knew I knew this...)

why would you want to rename a branch

Pushing a branch to a staging server that assumes the current code is on master. (Because stupid).

(git push destination current_branch:destination_branch)

I never use --force

Right, except that one or two times a year when you have to.

Anyway, every team seems to have this one developer whose head and shoulders better than everyone else at Git. I would not assume this is because the other developers suck, but because the more one (or maybe just me) learn about Git the more that thinking about Git as homeomorphic endofunctors mapping submanifolds of a Hilbert space seems like the sane way to view Git. Which may make Git logarithmically complex to learn.. and I say this as someone whose contributed to libgit2.

0

u/loup-vaillant Jun 21 '14

Git as homeomorphic endofunctors mapping submanifolds of a Hilbert space

Err… does that makes sense? (I don't know those terms —except endofunctor), so I can't say if you were being serious.