Archive for February, 2010

Current Working Git or SVN Branch on the Prompt

Git LogoThis is a nifty tip I picked up somewhere on the Internet to show the Git or Subversion branch you are currently working in on the command line prompt, which I modified to include your stash level. I haven’t done a ton of serious programming under Subversion, but I know with Git I’m branching all the time (branches are so cheap in Git!). I wasn’t sure if I’d like the results before I tried it, but as it turns out, it’s even more helpful than I thought it’d be.

Edit your ~/.bash_profile to mirror the following functions. Of course, you may change the details of PS1 to your liking; it’s the \$(parse_git_branch)\$(parse_svn_branch) that’s important.

And what you end up with looks like (in this particular case):
[BinaryMuse ~/repo.git/src (FIX-15013 +2)]:

Enjoy!

, , , , ,

1 Comment

The Operating System Wars: Can’t We All Just Get Along?

software dreamland by ~lopagof at deviantART
smallsoftware dreamland by ~lopagof at deviantART

There are a lot of choices in the world of technology these days, and it doesn’t take a well-thought-out Google query to find a huge following of people on any side of any given topic. Of course, there isn’t a digital war older or that has resulted in more casualties than our old favorite, "Which operating system is better?"

Everyone has their personal preferences when it comes to pretty much anything tech-oriented–from our favorite browser to which phone we carry, it’s hard to find anyone who’s not willing to share an opinion. And, to be honest, since the operating system is the basic building block for our core computing experience, it makes sense that the choice would be a highly subjective one. But for the life of me I can’t seem to understand why people take their choice of operating system so personally. You can make fun of a man’s car, you can insult his clothes, you might even be able to get away with speaking poorly about his religion, but don’t you dare make fun of his choice of operating system, or you risk getting the top twenty reasons x is better than y, where x is his operating system and y is, invariably, yours.

I understand that every operating system has its pros and cons. I use Windows 7, OS X, and Linux all on an almost daily basis, and there are things that frustrate me about each of them. And, like any good geek, I have my druthers, give the choice of any of them. But I understand that each of them have strengths, and I’m not afraid to mix-and-match as needed. I use Windows 7 on my home desktop, where I browse the web and game from time to time. I run OS X on my laptop, which is my primary work machine, on which I do my software development. And Ubuntu powers the server on which this very site runs.

But this drive–especially from IT people–to turn their operating system preference into a dogma, and to argue with fervor only used elsewhere when dealing with religion and politics, is counter-intuitive to what we do. An operating system is a tool, not entirely unlike all the other tools we use on our computers–compilers, text editors, browsers–and to turn it into more than that is, in my opinion, only a hindrance to the betterment of the world of technology as a whole and our ability to think and adapt to various tools and resources as individuals. I’m not saying we all need to join hands and sing songs around the campfire and all install OS Winnux, but a little tolerance probably isn’t a bad thing.

, , , , ,

2 Comments

How Come No One Told Me About Git?

Prior to my current job, I never really did any "serious" programming. I had a few web sites, some tools and such I created for myself at home, and so on. The biggest team I worked on for a serious project was two people strong–myself and a good friend of mine. I’ve never really had to worry about version control or multiple people working on code at the same time.

Fast forward to my current job. I still don’t work with a huge team of developers, so I don’t have to worry about people editing my code at the same time as myself. However, I do have to maintain fairly large codebases–one in particular. This brings me to the title of my post: how come no one told me about Git?

For those unaware, Git is a "free and open source, distributed version control system." I’ve been using Git a lot lately, and I have to say, it’s awesome. Easy to use and fairly easy to understand (some of it’s more obscure features requires a bit of reading), I’m even using it for projects that only I’m working on. Branching and merging/rebasing is so easy and fast, it’s cake to test out experimental features without worrying about your stable codebase. And keeping a customized open-source project up-to-date is simple. Just git pull changes into the stable branch, git checkout your custom branch, and git merge stable. I’ve even been able to integrate it with Bugzilla, so I can push patches directly from the command line to our issue tracking system.

Another awesome pseudo-feature of Git is the community around it. It’s easy to clone and fork projects with Git, and GitHub is the perfect tool for finding code and getting your own code out there. I’ve never really written any code to share with the open source world, but I’d really like to, or find a project where my (very limited) expertise would be helpful and contribute. I think Git and GitHub will be my doorway into that world.

If you’re curious about Git, check out "Why Git is Better Than X," an article that compares various version control systems.

, , ,

1 Comment