News for hackers. Stuff that matters.
Re:Shit – An implementation of Git using POSIX shell by ddevault on Tuesday February 11, 2020 @07:27PM (#22304513)
You'll use git a hundred times a day, every day, for the rest of your career. It's easily worth the hour it'll take to learn it properly.
Re:Shit – An implementation of Git using POSIX shell by viraptor on Tuesday February 11, 2020 @08:04PM (#22304728)
Sure, but I also use a mouse. I could learn how the optical mouse works. I have some guesses about it too, but never actually learned the details.

But I'm a user of it - it works even if I don't understand exactly how and nobody tells me that I learned using the mouse "the wrong way" because of it.

Re:Shit – An implementation of Git using POSIX shell by outworlder on Tuesday February 11, 2020 @08:39PM (#22304932)
Yes, and you don't have to spend one hour learning how to push a button.

A version control system is tackling a non-trivial problem. Go learn it properly, otherwise you'll be one of the 'users' that, at best, will be stumped on trivial issues, losing productivity and running to others for help. At worst, you'll be making bad decisions and dragging down your team.

Would you also say that you don't need to learn anything and can just "guess" while working with a programming language?

Re:Shit – An implementation of Git using POSIX shell by onion2k on Wednesday February 12, 2020 @01:18AM (#22306335)
Go learn it properly, otherwise you'll be one of the 'users' that, at best, will be stumped on trivial issues, losing productivity and running to others for help. At worst, you'll be making bad decisions and dragging down your team.

I have no problem with people on my team asking each other for help, and I definitely don't consider it bad for productivity when they do. If someone on my team suggested people asking them for help was bad I would bring it up in their next one to one because that's a really bad sign something is wrong.

If everyone on my team decided to learn the internals of git so they didn't need to ask one another when a problem arose I would be genuinely concerned about how the team is working.

Re:Shit – An implementation of Git using POSIX shell by ptx on Wednesday February 12, 2020 @03:56AM (#22307126)
I think the point was "trivial issues". What if a Java programmer kept asking their teammates if the statement terminator in Java is colon or semicolon?
Re:Shit – An implementation of Git using POSIX shell by onion2k on Wednesday February 12, 2020 @05:22AM (#22307594)
Users can resolve trivial issues without knowing the internals though, so that wouldn't make sense.
Re:Shit – An implementation of Git using POSIX shell by ddevault on Tuesday February 11, 2020 @08:14PM (#22304782)
A typical mouse has 2-3 buttons, a wheel, and an X/Y axis.

Git is 100x more complex, if not more.

Give me a break. I'm sick of people glamorizing the idea that you should have your hand held through each step of every tool you use and never expend any effort on becoming an expert in the tools of your trade. Git is an engineering tool, designed by and for professionals. Imagine this kind of obscene complatency in other fields.

Re:Shit – An implementation of Git using POSIX shell by viraptor on Tuesday February 11, 2020 @09:08PM (#22305106)
I meant the tool-vs-internals idea, not the specific example here. If you want something comparable in complexity: we learn programming from `print "hello world"`, not from memory models and assembly. Some people even just start with `=sum(...)` in excel. Every programmer pretty much stops at the level that's useful and productive for them.

There's often sentiment that people should know more, but I don't think I've ever seen anyone saying starting programming from high level is "the wrong way".

Example from out of it: doctors learn both how to use USG and how it works. But in every case, I've seen it in that order: practice, then internals.

Re:Shit – An implementation of Git using POSIX shell by ddevault on Tuesday February 11, 2020 @09:09PM (#22305111)
>we learn programming from `print "hello world"`, not from memory models and assembly

You're talking to the wrong crowd with me, you know. I disagree with this approach, too. Maybe we start with "hello world" to get a taste, but the first thing we should do is start breaking it down.

Re:Shit – An implementation of Git using POSIX shell by viraptor on Tuesday February 11, 2020 @10:04PM (#22305346)
Thanks. I do understand where you're coming from - your original claim makes sense in that context :-)
Re:Shit – An implementation of Git using POSIX shell by onion2k on Wednesday February 12, 2020 @01:29AM (#22306409)
You understand git. If someone said you need to know how sed works, or grep, or babel, or clang, or bash, or perl, or literally any other tool that you use regularly that you don't know the internals of then you'd quite reaaonably say they were wrong because you're an expert what matters to you and you can do your job without knowing how something else works. Perhaps you should try to respect that other people choose to become experts in things that aren't git.
Re:Shit – An implementation of Git using POSIX shell by frant-hartm on Wednesday February 12, 2020 @05:09AM (#22307534)
If you use any of the tools listed, or any other tool, several times a day then it is reasonable to know the internals at least a bit. If you use grep (or git - the same applies) once a month then it's fine to just memorize some commands.
Re:Shit – An implementation of Git using POSIX shell by na85 on Wednesday February 12, 2020 @12:14AM (#22306012)
I don't think it's asking to have one's hand held to complain about git's poor interface. There's no reason other than lazy design to have a tool where to show all remotes it's

$ git remote -v

But to show all branches it's

$ git branch -a

It's like it's been purposefully designed to be obtuse.

Re:Shit – An implementation of Git using POSIX shell by edflsafoiewq on Wednesday February 12, 2020 @01:22AM (#22306371)
It seems like you've made this example obtuse.

`git remote` and `git branch` list the remotes and branches respectively.

Adding -v makes both of these verbose. It will additionally show what each branch/remote is "pointing at".

Adding -a to `git branch` shows remote tracking branches in additional to local branches. This not normally interesting so the default is to list only local branches.

Re:Shit – An implementation of Git using POSIX shell by reagent_finder on Wednesday February 12, 2020 @02:15AM (#22306627)
...yes, remote tracking branches are interesting as well, I don't know a situation where they wouldn't be.

There's plenty of weirdness in Git, but honestly my main complaint is that the interface is awful and the documentation makes Dostoyevski look modern and sleek.

Re:Shit – An implementation of Git using POSIX shell by majewsky on Wednesday February 12, 2020 @07:16AM (#22308183)
You clearly have not ever worked on repos where nobody ever cleans up after themselves as far as feature branches go. I'm working with repos with remote branches numbering in the hundreds. `git branch -a` is pretty useless at this point unless paired with grep.
Re:Shit – An implementation of Git using POSIX shell by rovr138 on Wednesday February 12, 2020 @10:35AM (#22309618)
this is what I have my alias set to - `git branch -a --sort=-committerdate`
Re:Shit – An implementation of Git using POSIX shell by oblio on Wednesday February 12, 2020 @07:22AM (#22308213)
That's just by accident. There's plenty of obtuse git commands , strange command names, non-standardized parameters, etc.
Re:Shit – An implementation of Git using POSIX shell by aspaceman on Wednesday February 12, 2020 @12:27AM (#22306059)
We're all talking about learning the internals of git and how it works, not it's poorly formed command lines. Pointing out how shitty the interface can be doesn't mean you shouldn't learn how your tools work.
Re:Shit – An implementation of Git using POSIX shell by reagent_finder on Wednesday February 12, 2020 @02:16AM (#22306632)
You say potato, I say potato. If the interface is clunky, you will learn by heart some switches and pass them on as cargo cult.
Re:Shit – An implementation of Git using POSIX shell by na85 on Thursday February 13, 2020 @06:42AM (#22316947)
>We're all talking about learning the internals of git and how it works, not it's poorly formed command lines.

But the argument is being put forward that to understand the command lines you have to understand the internals.

Re:Shit – An implementation of Git using POSIX shell by DagAgren on Wednesday February 12, 2020 @04:30AM (#22307327)
Every other field makes damn sure that their tools are usable, comfortable and as safe as they can be. While programmers act like it's your fault if you hurt yourself while using a chainsaw-hammer.
Re:Shit – An implementation of Git using POSIX shell by danShumway on Wednesday February 12, 2020 @09:30AM (#22309060)
I've watched children use a mouse for the first time, and there is definitely an internal model you needed to learn. No, you don't need to learn exactly how optics work, in the same way that you don't need to learn exactly how Git is reading from files, or how its hashing algorithm is implemented.

But you do need to understand that the mousepad doesn't correspond to points on the screen, and you have to learn to treat it more like a treadmill than anything else. Going back in time and thinking about it from a rollerball perspective can help with that -- new users have a tendency to use something like 90% more space because they don't grok that for long movements they have to pick up the mouse.

People are bringing up the mouse as simple because they're used to using mice. But hand anyone a mouse for the first time and you'll find out that they aren't simple. They're just doing comparatively less than Git, so the problem space is slightly easier to tackle. And that's even ignoring the hand-eye coordination problem we take for granted, and that can take weeks for someone new to computers to get over.

Talking about internal mechanics is broadly useful when teaching computer literacy -- everything from mice, to copy/cut-paste, to shift-selection of files, to the file browser itself benefits from trying to build a systemic, mental model of some kind of behind-the-scenes abstraction.

Re:Shit – An implementation of Git using POSIX shell by seba_dos1 on Wednesday February 12, 2020 @07:45AM (#22308355)
git is a data structure manipulation tool, mouse is a cursor manipulation tool. A much better analogy would be trying to use a mouse without having a good idea of what the cursor is for.

The only difference is that grasping the cursor will probably take you minutes because it's a simple concept, and grasping the data structure takes a bit more effort because it's just a more complicated topic.

You don't need to know the implementation details of git, but you need to know the data structure it operates on, cause otherwise you're just walking in the dark.

Re:Shit – An implementation of Git using POSIX shell by 2zcon on Wednesday February 12, 2020 @06:12AM (#22307851)
And the other IO device? People absolutely will tell you you're typing the wrong way.
Re:Shit – An implementation of Git using POSIX shell by RJIb8RBYxzAMX9u on Wednesday February 12, 2020 @12:19AM (#22306034)
I'm not certain that git will be the dominant VCS forever, as I'd used CVS, Perforce, Subversion, Mercurial, in various degrees when they were dominant (or at least relevant).

Who knows, maybe Linus will have another epiphany, while Microsoft somehow mismanages GitHub and squanders all the goodwill away. Then, a group of upstarts...

That said, wanting to learn git's internals for the sake of knowledge is fine as motivation.

Re:Shit – An implementation of Git using POSIX shell by 101404 on Wednesday February 12, 2020 @03:56AM (#22307127)
Then there's Gitlab and a few others.
Re:Shit – An implementation of Git using POSIX shell by jefurii on Wednesday February 12, 2020 @11:53AM (#22310403)
Also sourcehut / sr.ht.
Re:Shit – An implementation of Git using POSIX shell by Vinnl on Wednesday February 12, 2020 @05:06AM (#22307525)
Even if it stays at widely used as it is now for just two more years it'd already be worth the hour of effort.
Re:Shit – An implementation of Git using POSIX shell by im3w1l on Tuesday February 11, 2020 @07:53PM (#22304676)
It's not a given you will use it for the rest of your career. As two examples, neither Google nor Facebook use git.
Re:Shit – An implementation of Git using POSIX shell by cweagans on Wednesday February 12, 2020 @12:45AM (#22306166)
shrug I'm probably never going to work at either of those places. For pretty much everywhere else, Git works just fine.

Maybe if I play my cards right, I'll use git for the rest of my career. If not, maybe there will be something new eventually, but I imagine that the concepts learned in mastering Git would still be useful.

Re:Shit – An implementation of Git using POSIX shell by jschwartzi on Wednesday February 12, 2020 @10:29AM (#22309555)
You should give Mercurial a try. When you enable the changeset editing extensions it does everything Git does and is much easier to use and understand. I’ve trained people on both systems and Mercurial is much less creaky. The only reason everyone uses Git is for historical reasons because most of the modules In referring to weren’t added to Mercurial until like 09 when Git started seeing widespread use.
Re:Shit – An implementation of Git using POSIX shell by cweagans on Wednesday February 12, 2020 @01:41PM (#22311439)
I used mercurial quite a bit back in 2010. It's nice, but I don't see the value in sinking a bunch of time into it these days.

Every one of the projects that I interact with regularly are in a Git repo on some kind of Git hosting service and the projects are run by people who understand/use Git regularly. For those projects, switching to Mercurial is a net loss, even just considering the time it takes to migrate the codebase + related processes (think CI, issue queue integration, even the repo hosting itself).

Sure, I could use hg-git, but that doesn't gain me much either: now I'm the guy with the weird setup. If something goes wrong with my setup, it's too weird for other people to help with. If something goes wrong with somebody else's setup, I'm not that helpful because I have a weird setup.

Re:Shit – An implementation of Git using POSIX shell by democracy on Wednesday February 12, 2020 @01:07AM (#22306280)
many places were fine with cvs and svn as well
Re:Shit – An implementation of Git using POSIX shell by cweagans on Wednesday February 12, 2020 @09:28PM (#22314824)
Was anyone _really_ fine with cvs?
Re:Shit – An implementation of Git using POSIX shell by buck4roo on Wednesday February 12, 2020 @02:05AM (#22306568)
I'd add that folks should not be forcing the use of git, even within an organization that uses it.

Mercurial works great, has a sane CLI and can both manipulate and interoperate with git repos.

Many of the tools mentioned, at their core, are manipulating the same DAG data structures.

Re:Shit – An implementation of Git using POSIX shell by jschwartzi on Wednesday February 12, 2020 @10:23AM (#22309495)
I found Mercurial to be just as capable and much easier to learn. I’m really only considering moving my team to Git as a least-common-denominator move since nobody really makes tools for Mercurial outside of Facebook. Otherwise it’s harder to learn Git and definitely it’s harder to train interns and juniors to use it.
Re:Shit – An implementation of Git using POSIX shell by BossingAround on Wednesday February 12, 2020 @08:05AM (#22308444)
> neither Google nor Facebook use git

What do Google and FB use as their VCS? Also, any source? I don't mean this to be an attack, I am just genuinely amazed by the statement.

Re:Shit – An implementation of Git using POSIX shell by compiler-guy on Wednesday February 12, 2020 @12:52PM (#22310943)
Google uses a custom implementation of the Perforce interface called Piper. Google has looked at git and mercurial, but have concluded that they can't scale to the level they need it to. Read more about it here:

https://cacm.acm.org/magazines/2016/7/204032-why-google-stor...

Re:Shit – An implementation of Git using POSIX shell by Volt on Wednesday February 12, 2020 @08:19AM (#22308546)
Facebook uses Mercurial.