Git is teh SUCK
Today, I had two separate incidents in which my git repository was corrupted! To the point that nothing, git fsck or git reflog or git just-work-or-i-WILL-shoot-you didn’t work.
The first time, there was no harm done, I just cloned my repository again, and moved on. The second time that it happened, it was after I had ~10 commits locally that weren’t pushed. I had my working copy intact, but I didn’t want to lose the history. I asked around, and got a couple of suggestion to move to mercurial instead, because git has no engineering behind it.
Based on that feedback, I …
Oh, wait, it isn’t this sort of a post.
What I actually did was setup Process Monitor and watched what git.exe was actually doing. I noticed that it was searching for a .git/objects directory, and couldn’t find it anywhere in the path. Indeed, looking there myself, it appeared clear that there was no objects directory under the .git dir. And checking in other repositories showed that they had it. So now I knew why, but I still had no idea who the #*@# decided to randomly @#$%( my repository, totally derailing my productivity.
That is where having multiple personalities come in handy, he did it. The one that isn’t writing this blog post, at some point during the day, there was a need to zip the repository and send it somewhere. Since the working copy is full of crap, that idiot issued the following:
ls -R obj | rm –F
ls -R bin | rm –F
(Not the exact commands, the idiot used the UI to do a search & delete).
You can guess the following from there. At this point, having come to this astounding discovery, I heroically went to the recycle bin, found the objects directory there, and rescued it! All is well, except that there is still a thrashing for uncommon stupidity owed.
And remember, it wasn’t me, it was the other one who did that!
And yes, the spelling mistake in the title is intentional.
Comments
haha :)
Why not to zip new clone of the repo (all crap should be in .gitignore already)
Shift delete is more fun
hehe, Oh yeah, Shift+Del is teh fun... :)
Heh!
I've done that on OS X
$ rm *;o
zsh: command not found: o
$ # fuuuuuuuuu
Try "git clean" instead.
That's why I use total commander and always search for the exact regex ^bin$|^obj$ .
That said, Mercurial is incredibly better than git. I became a Mercurial fanboy the moment I started using it for the first time.
Kudos for discovering the problem ;)
Talking about shift+delete...
It's nice to configure recycle bin (right click->properties->some checkbox) NOT to ask confirmation on deleting something and develop a habit to use del instead of shift+del.
@ configurator
i am using hg, too and also think that is a lot friendlier than git which has a certain stoneage flair to it :) - but it does not shield you from your stupidity.
I once applied a grep action on a solution directory, forgetting to exclude the .hg from it. Well, needless to say, I completely foobar'd my working copy holding a full day of work. It took a lot of sweat to rescue some of that...
So I got few more reasons for my initial assumption: Hg rules, Git sucks (details are here: blog.alexyakunin.com/.../...or-do4-git-versus.html ).
Btw, so far I didn't face any real issue with Hg - even although we have a pretty complex case with migrating changes from Subversion repository to it.
Just a note: if you need a zip/tarball of tree, you can just use 'git archive'
Wow.. Hg fan boys :) I think VSS is easy to understand :)
Yeah 'git archive' sounds like subversions 'svn export' feature - you can checkout a working copy without all of the .svn/.git folders.
@ configurator
The same with me, and few more persons I know. It seems the best answer to some Git fans is "just try it - I'm sure you didn't".
Hmm, they immediately dropped few hateful comments in by blog :\
git is faster, more flexible and more powerful. It's the old UX problem of easy to use vs. more productive. For some git is better, for other hg is better. End of story.
It doesn't matter if it's faster, more flexible and more powerful if it destroys your repository periodically.
Like I said the other day: Mercurial saved me after Git fell over on me.
Comment preview