sophie: A cartoon-like representation of a girl standing on a hill, with brown hair, blue eyes, a flowery top, and blue skirt. ☀ (0)
Sophie ([personal profile] sophie) wrote in [site community profile] dw_dev 2013-06-26 08:55 pm (UTC)

Thanks! You're right, deleting and re-forking will throw away history. Let me explain a little bit about what's happening here, though, to make it a bit clearer as to why I think this is beneficial in this case.

Firstly, a bit of background: A lot of our developers are fairly new to git, and in fact to programming in general. One of the aims of the Dreamhack box is to provide a playground to encourage messing around with the code without fear that anything you do will mess up your Dreamhack beyond repair, because if you're not sure whether you might mess things up, it can really get in the way of experimentation. Yes, people can always ask me for help (and I'm always open to helping people!), but it's a fact of human nature that you generally don't want to bother other people with problems that you consider to have been your own fault, especially if it's something that sounds like it should be major, like reinstalling your account or unbreaking your Dreamhack.

When it worked, the reinstaller script could be triggered by running a single command. Within a minute, the reinstaller would warn you what it was going to do. Within another minute, it logged you off the system, killed all your processes, deleted your user account and everything associated with it, and then set you back up again as if you were a completely new user. In total, it took about 5-10 minutes, and you would be back up and running again, being guaranteed a working Dreamhack without having to talk to a soul. That sort of guarantee is invaluable in a "playground" environment such as this. (I'd call it a sandbox, but it isn't a sandbox in the true technical sense of the word, hence "playground" instead.)

OTOH, while you're almost certain to be able to get back to a working state with git in the way you describe, there are several reasons why that might not be the best method. From a technical perspective, the local git repository may be corrupted in such a fashion that it just doesn't work as expected. From a psychological perspective, because git never throws away commits, you'll still know that your old "baggage" is still in there somewhere, which might throw you off. You would also need to make sure your old branches were deleted, otherwise you might accidentally refer to them in a future command and end up with something wholly unlike what you expected.

Deleting and re-forking on GitHub, then reinstalling the local user account, is by far the easiest way to deal with these problems. (Why not just clone the re-forked repository back to the user account? Because it's not just repository problems that can affect your Dreamhack. Each Dreamhack has their own Apache configuration file which can be edited as need be, and it's possible - though unlikely - that if you were editing the config, or removed the file totally, you could break your Dreamhack that way. While it would be easy enough to fix - and in fact I may just make a script to make it easy to replace your Apache config file if need be - it's another thing that can go wrong.)

All told, it's about three things - a guarantee that it's going to work as you expect it to, a psychological guarantee that you're not going to have anything left that could mess it up, and the knowledge that you don't have to tell anybody if you don't have the spoons for human interaction; you can just reinstall and continue hacking.

Hopefully that helps clear up why I think doing this is the best way in this case!

Post a comment in response:

If you don't have an account you can create one now.
No Subject Icon Selected
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org