Live data from Hacker News

New in Git: switch and restore

banterly.net

51–60 of 550 posts

Re: New in Git: switch and restore

#51
post #43

This reminds me of the old xkcd [1] about how standards proliferate... Situation: Git has 137 difficult and unintuitive subcommands [2], and new users can't keep straight which ones they should use. "Oh man, that's awful, let's add new subcommands that are clear, and do just one thing well!" Soon: Situation: Git's CLI has 138 difficult and unintuitive subcommands. [1] https://xkcd.com/927/ > [2] Yup, seriously, as of…

Except this is actually the opposite… they turned one command that did too many things into two commands which each do fewer things.

Re: New in Git: switch and restore

#52
post #18

I knew about `git switch` but this is the first time I hear about `git restore`. It also never occurred to me that the checkout command was overloaded in that particular way.

Doesn't seem overloaded, seems quite fitting. Checkout a hash or a file from a hash. Switch kinda seems "underloaded" in this way.

switch being underloaded to checkout is the same as checkout being overloaded to switch.

In the checkout model, branches are just named aliases for their current hash. This seems trivial to me. Do we really need to use another vocabulary spot up in our heads for a command that is strictly a more-restricted checkout?

Re: New in Git: switch and restore

#53
post #18

I knew about `git switch` but this is the first time I hear about `git restore`. It also never occurred to me that the checkout command was overloaded in that particular way.

Doesn't seem overloaded, seems quite fitting. Checkout a hash or a file from a hash. Switch kinda seems "underloaded" in this way.

Yea it never bothered me and I never understood why people kept complaining about it online. It seemed very superficial complaint.

The way you use git is by first understanding its model. If you understand the git model, everything makes sense.

If you come to it expecting it to be a tool that magically does what you want, I guess you will be very disappointed.

Re: New in Git: switch and restore

#54

Earlier quoted context omitted.

> but I'm seriously falling behind due to jetbrains integration This IntelliJ integration is the source of quite a lot of git problems in teams I worked with. I'm quite flabbergasted by this - devs claim to know git on their CV, come in and know what "commit" is and how to use the IntelliJ UI, but don't even understand what its doing. And everyone is acting like it's OK and learning git is a "hard thing ill never nee…

I think you're approaching git and software dev from a bottom up perspective. You learn the tools, understand why they exist, and then use the tools to solve higher level problems. Unfortunately due to time constraints, interest levels, and simply ease people go top down. They need to switch branch, so they will follow the least effort principle and use a UI. Barely understanding many fundamental tools is common thes…

> I think you're approaching git and software dev from a bottom up perspective. You learn the tools, understand why they exist, and then use the tools to solve higher level problems

Actually, I'm trying to look at it more from a "shallow sea" perspective - you have a problem and are given a tool to solve it. But do you not dive in just a bit to see "hey what is this tool" after you solve the problem?

Or after using it for a while?

UI is also something you have to learn how to use.

Sourcetree UI is as complicated as terminal for someone who never used it.

>I have to deliver products and deliverables, when and what do I focus on wrt gaps in my knowledge? Git? Unix commands? OWASP Security principles? Cache busting? global state management? ORM integrations with popular DBs? Kubernetes configs?

With that mentality, what do you ever learn?

Do you just keep on chugging year after year with "duct-tape the tools"?

Where is the joy in that? Where is the growth?

Are you always in a rush to deliver software without a moment to think?

You learn about the level you're using - like, are you using git daily? Just reading a tutorial or two and spending 5 mins a day with it in the terminal is going to do wonders for understanding it long-term.

>Barely understanding many fundamental tools is common these days for devs

It's common for someone starting to develop or starting to use a tool - hell, 8 years ago I have been as confused as "wtf is this git" as anyone.

Gradle was magic to me. Terminal was a dark and scary place.

That doesn't mean that it is okay to stay at that level.

If we accept "not trying to understand" as the new common, then we accept failure and ignorance as the new common.

We accept the world of broken software because people don't understand what they're doing - and we're telling them "you don't need to understand so don't even bother".

And hell, maybe that's gatekeeping, but fuck it, I'll rather be St. Peter at the gates than accept a world where learning and understanding is something "we don't have time for".

Re: New in Git: switch and restore

#58
post #44

Earlier quoted context omitted.

> but I'm seriously falling behind due to jetbrains integration This IntelliJ integration is the source of quite a lot of git problems in teams I worked with. I'm quite flabbergasted by this - devs claim to know git on their CV, come in and know what "commit" is and how to use the IntelliJ UI, but don't even understand what its doing. And everyone is acting like it's OK and learning git is a "hard thing ill never nee…

How do we allow our culture to be so lazy that people resist using one of the basic tools because "oh its hard I gotta remember 5 commands" and we find it OK? No wonder the plane is burning. Its probably a rhetorical question but I think its worth answering anyway. Experienced developers had the luxury of learning git, say, over a 10 year period. I certainly know a lot more git than 10 years ago. If you are a new dev…

>Experienced developers had the luxury of learning git, say, over a 10 year period. I certainly know a lot more git than 10 years ago.

The depressing thing is I'm not talking just about off-the-shelf newbies, I'm also talking about experienced devs.

>Its depressing to say it, but I think not understanding the tools is only natural and is probably the new normal in this age of complexity.

Yes, unfortunately, this is becoming the new normal. But what is the next "new normal" after this? More complexity and obscurity? How long can we keep building that house of cards before it collapses upon us?

Post reply on HN