5 ms·
>Today, Git has a reputation for being a tool that erases your working tree without warning if you use the wrong command. This is news to me.
by hprotagonist 9y ago
>Today, Git has a reputation for being a tool that erases your working tree without warning if you use the wrong command.
This is news to me.
- rpazyaquian 9y agoNot to me. This happens all the time when you're learning the tool.
- jakebasile 9y ago>> Today, $SHELL has a reputation for being a tool that erases your working tree without warning if you use the wrong command What a vacuous statement. If you use something incorrectly, it works incorrectly.
- tqkxzugoaupvwqr 9y agoIf a tool allows you to easily destroy something, the tool needs a safety switch.
- mikeash 9y agoThere's a pretty big difference between "works incorrectly" and "irreversibly erases important data."
- BlackjackCF 9y agoGit can totally screw you over if you're learning and you're not careful. But what's nice is you can also (usually) revert your Git oopsie. Still, I don't usually run into the problems described because I try to keep Git as simple as possible.
- stephengillie 9y agoBack in 2013, I was working for one of Redfin's competitors, near Redmond. We were moving the developers off VisualSourceSafe, and the DevOps expert (hired at the same time as me) was a Git pro, so we tried Git. Git lasted almost a week. The last straw was when a junior developer accidentally deleted the main line repo. We switched to TFS and never had problems like that again.
- int_19h 9y agoWhy did your junior developer have sufficient permissions to delete branches in your main repo?
- stephengillie 9y agoPresumably because permissions were not set correctly. The poor fellow was tasked with compiling 20-year old code with a completely circular-linked library. He spent months hacking it into shape, and made great progress. But this problem continues to occur. Last year, working on an Ops team, team members started noticing their scripts were no longer present on production servers. It turns out a team member was modifying code and checking it in. The problem is that Git clobbers unchanged files, so he was unknowingly reverting changes. After years of seeing numerous professional developers and engineers continuously have team-impacting, show-stopping issues using a tool, I must assume the tool is defective in some way.
- int_19h 9y ago> Presumably because permissions were not set correctly. Which, of course, is also potentially a problem with TFS, and a developer can similarly wipe out the repo if permissions allow them to. I'll grant you that it's easier to go so with Git by doing something like push -f, so it's more important to have permissions right in that case. > The problem is that Git clobbers unchanged files Except it doesn't? I'm not sure what was broken in your case, but that's definitely not normal or expected Git behavior, and I can't think of any time I've seen anything like that. About the only case I can think of where Git insists on "modifying" random files is when line endings are mismatched, and the repo is not configured properly. But even then it's not lossy.
- stephengillie 9y ago> Except it doesn't? I'm not sure what was broken in your case, but that's definitely not normal or expected Git behavior, and I can't think of any time I've seen anything like that. About the only case I can think of where Git insists on "modifying" random files is when line endings are mismatched, and the repo is not configured properly. But even then it's not lossy. Git does this by design. There seems to be no concept of line-item uploads - either you have to push the whole fork or none of it. There seems to be no concept of "I haven't modified this file", and an assumption that a user will frequently be fetching and aware of the entire code base. Some tools help with this awareness, by auto-fetching frequently, so you know when others have uploaded code and you need to merge the master back into your branch. (Err diff the mainline against your development copy, so you can integrate the upstream changes into yours.) Mandatory workflows like this should be automated as part of the tool, but here they are very clearly left manual.