Live data from Hacker News

Some bad Git situations and how I got myself out of them

ohshitgit.com

211–220 of 352 posts

Re: Some bad Git situations and how I got myself out of them

#211
post #201

Getting to "Fuck this noise, I give up." is a very clear indication that you aren't competent enough and you should take a GOOD course about git as soon as humanly possible. Shameless plug: http://engineering.hipolabs.com/how-to-work-in-a-team-versio...

> Getting to "Fuck this noise, I give up." is a very clear indication that you aren't competent enough I think that's a tad judgemental for two reasons: 1- because git is legitimately hard to learn. Personally I suspect git is unnecessarily hard to learn, that command names and the concepts and workflows I need are possible to learn and use with less effort. For many years people around me have been asking for git he…

1- That's certainly true, git is really hard to learn. But if you're a developer it's worth getting comfortable with it, which means not going for the "nuclear option" every time something weird happens. Someone on StackOverflow has had your problem, and has the perfect fix, look that up instead.

2- Yes, absolutely, it's good to remember that it's a fairly painless and easy process to spin up fresh clones. Though, if all you want is a fresh copy, in 99% of cases a "git clean -xfd" will do that for you (read the man page to find out what the options mean! man pages are your friend!). Though that one is generally a "pull ripcord in case of emergency" type of command, "git stash" generally suffices and avoids risk of losing data.

Re: Some bad Git situations and how I got myself out of them

#212

Earlier quoted context omitted.

I'm curious, what would you say the % of sites you visit is where they're still useful without JS?

That question is not very useful the way it's written down. Some sites legimitately require JS (everything in the "web apps" territory; just try to imagine Grafana without JS), so I would ignore these (which I hope is in line with your intentions). Of the sites that are mostly static content, I would estimate around 60%. There's a small chunk of sites that are just blank with JS disabled, and there's a larger chunk t…

Yeah that was a poorly worded question, sorry. I'm interested in how far one can get without JavaScript on today's Internet. But it sounds like you don't disable it fully, just only on untrusted sites?

60% is better than I'd expect for sites you expect to work without JS. =)

Re: Some bad Git situations and how I got myself out of them

#214

I absolutely love git now. I'm still at uni (at a highly ranked but actually crap university where we don't learn git properly) and this year was my 'year in industry' as we call it in the UK, and my first proper experience with git, aside from `git init` at the end of my project and pushing it to a repo. I've become so much more confident with git. Seriously, with one caveat (i.e., you haven't pushed your changes to…

I would not expect a university to teach git. Maybe the theory of version control systems, their history, or a comparison of different version control systems.

But not how to use the tool.

Re: Some bad Git situations and how I got myself out of them

#215

Earlier quoted context omitted.

That question is not very useful the way it's written down. Some sites legimitately require JS (everything in the "web apps" territory; just try to imagine Grafana without JS), so I would ignore these (which I hope is in line with your intentions). Of the sites that are mostly static content, I would estimate around 60%. There's a small chunk of sites that are just blank with JS disabled, and there's a larger chunk t…

Yeah that was a poorly worded question, sorry. I'm interested in how far one can get without JavaScript on today's Internet. But it sounds like you don't disable it fully, just only on untrusted sites? 60% is better than I'd expect for sites you expect to work without JS. =)

I use uMatrix and enable first-party JS by default. That allows me to get by on most sites. Sometimes I have to enable additional domains, mostly:

- ajax.googleapis.com and the like

- somethingsomething.cloudfront.com

- variations of the same domain (for example, hn.algolia.com queries algolia.net and algolianet.com)

By the way, it's a very valid question whether my model is actually more secure than just uBlock, but I like it on an emotional level because I feel in control.

Re: Some bad Git situations and how I got myself out of them

#217
post #213

> This usually happens to me if I merge to master, then run tests/linters... and FML, I didn't put a space after the equals sign. Am I the only one that runs my tests before committing, let alone merging to master?

Yeah, pushing untested code to master is not such a great way to work. Push to a remote branch other than master, test it there, then merge it into master.

That's pretty much git 101

Re: Some bad Git situations and how I got myself out of them

#218
post #211
post #201

Earlier quoted context omitted.

> Getting to "Fuck this noise, I give up." is a very clear indication that you aren't competent enough I think that's a tad judgemental for two reasons: 1- because git is legitimately hard to learn. Personally I suspect git is unnecessarily hard to learn, that command names and the concepts and workflows I need are possible to learn and use with less effort. For many years people around me have been asking for git he…

1- That's certainly true, git is really hard to learn. But if you're a developer it's worth getting comfortable with it, which means not going for the "nuclear option" every time something weird happens. Someone on StackOverflow has had your problem, and has the perfect fix, look that up instead. 2- Yes, absolutely, it's good to remember that it's a fairly painless and easy process to spin up fresh clones. Though, if…

I totally agree, git is worth learning.

I don't recommend git stash, it frequently causes bad situations. Just branch instead, branching is safer and just as easy as stashing. Stash is not as safe as other git commands. From the man page: "If you mistakenly drop or clear stashes, they cannot be recovered through the normal safety mechanisms."

Re: Some bad Git situations and how I got myself out of them

#220
post #161

One of the nice workflows that's already built in to the git command line tools is this one. When you're working on a branch and realise that a commit you made a few commits back has a mistake in it: # Make correcting change git commit --all --fixup= # Continue working on branch, then at some point git rebase --interactive --autosquash The --fixup option creates commits with subjects formatted like 'fixup! previous c…

Even better in combination with the `:/grep` syntax that allows you to specify the commit by grepping the commit messages, prefering more recent commits: `git commit --all --fixup ':/implement some feat'`.

Mmm - nice. Glad I posted it now, as I didn't know that variation!
Post reply on HN