by philpem · 7y ago · 0 comments
Neither of us knew about Reflog at the time, so that didn't even get onto the list of things to try.
Management asked "what if you do that with Mercurial?"
Answer is, well, it won't let you do it without installing an extension. And the Wiki page for that extension contains a bunch of warnings about how you really should think long and hard about what you're trying to achieve -- and make as many backups as you can.
TRWTF of course is that my colleague hadn't pushed upstream for a month. Like I said -- former Subversion user. He didn't want his commit to mean someone else had to do a merge, and he didn't want anyone to see it until it was done.
Was "asking someone who knows how git works" on your list of things to try?
What about "learning how git works"? Was that on your list?
Frankly, you don't seem to have been trying very hard to get this work back.
If I can make an analogy.
There's little love lost on HN for C++. Anytime people mention C++ (possibly even here in this thread) people come out of the woodwork to talk about how hard it is to use, how it has too many features, blah blah.
I work in C++ every day. I don't think it's that hard.
When I have a question, I walk over and ask Chandler Carruth and Richard Smith. They are happy to help me debug my templates. Richard is the editor of the C++ spec, and Chandler is a well-known speaker, look him up on YouTube.
Over lunch we talk about new features of C++, we rant and gripe, and I learn.
Most people do not have Chandler and Richard in their life. Knowing them and the other experts on my team is a huge privilege. So when someone complains that C++ is too hard (wait for it, someone is going to do it here in this very thread...), it would be pretty insensitive of me to tell them that they should just ask someone who knows how C++ works.
Most of us in this thread do have someone in our life who is good at git, who helped us get started, and who saved our asses when we initially got stuck. Maybe that person isn't with us IRL, maybe that person is "just" a message board or IRC channel where we know we're welcome. But this too is a privilege.
If you've ever had trouble with anything and not had someone you could ask -- be it with C++, or real analysis, or whatever -- then I'd say you shouldn't throw stones at someone whose "whatever" happens to be git.
Someone posts that they'd tried to join two strings in C++ and print the result. And they couldn't figure out how to do it; they would keep losing the second string. So, they gave up and changed languages, losing a month's worth of work.
Would you think that was reasonable, because they didn't have Chandler Carruth and Richard Smith available to help?
The thing I object to is judging them at all.
They're not my coworker, someone I have to rely on and therefore might be annoyed if they're unproductive or whatever. They're a random person on the Internet who rather humbly admitted to making a mistake out of ignorance.
But try as I might, I cannot do so with C++ and git. They just make no logical sense to me.
I just had to write that rant out: https://wordpress.com/post/squarebits.wordpress.com/76
But if excavators were as hard to use as git, I'd never have mastered them.
Our "Git expert" was the one who blew away a month of work.
Mistyped as "git reset --hard HEAD~n"? git-revert is usually pretty nondestructive…
He is doing either some dangerous changes, which is not acceptable OR he is doing something that could be walled off by feature switch and integrated with at least weekly commits.
If it was some manager that told him to do that, fire that manager too!
Don't you have backups? The companies I worked for had backups for all the home directories, so if I deleted something I could ask the admins to restore it.
If there are no central backups I would sure as hell set up a local backup, so there are more than one copies of my work in case something goes bad.
...so you thought you lost a day's or a month's work, you didn't actually lose it.
You could just revert your revert commit, or check out an earlier revision.