So today I made the switch to use GIT over SVN for all of my personal projects because we’ve been using it at IPC Media for months. One of the most useful things I’ve found is the ability to set up aliases for command commands, because let’s face it all developers want is to do the same job with less key presses.
Anyone that works with subversion will know that merging 2 branches is not always easy. Most of the time there is no issue, and you can merge one or multiple changes from one branch to another, but sometimes you end up with conflicts left right and center. This is done with the standard merge commands:
When I’m reviewing the changes I’ve made to an svn checkout I prefer to see the changes in colour. This would be very easy if I was someone that used a graphical editor, but I’m one of those people that prefer to use vim, or vi if I really have to. As a result I had to think of a way of changing svn diff into something that was easy to read. I found out that vim has a syntax highlight template for diff files, so it got me thinking. What about pushing the diff into a file and then viewing the file in vim.
Continue reading svn diff via vim
A few months back I wrote about iTerm2 – well it’s now in BETA and a lot more finished then it was back in January.
They have a new site now and it’s full of information about this improved version or the old iTerm.
Have you ever wanted a magic 8ball to use at work? A real one, even though nice to have on your desk, is not always practical. When I had a real one on my desk people were forever playing with it when they came to talk to me.
Making one is very simple. All you need is an array of values to use as responses, and a way to pick one of them at random. I could have written this in any number of languages, but this one is written in bash for simplicity.
We’ve all been there, you’re working on a project with lots of externals and we see a lot of noise when you run svn status or svn st (depending on your preference). Most of the time we just filter that out, but I decided to string a few grep statements together to make the output that little bit nicer to read.
I was having a discussion with one of the SysAdmins at work yesterday and we were talking about a system we use called puppet. I wanted to know if there was a way of making changes to one of the files currently under the control of puppet for testing purposes without stopping the puppet daemon. He pointed me in the direction of of the chattr and lsattr binaries.
These binaries allow you to mark any file on the machine as immutable or list the immutable status. If a file becomes immutable it means that not even root can delete or modify the file unless it removes the immutable flag first.
There are loads of little tips and tricks out there on how to make your svn operations a little easier. One which I found out recently was how to leverage bash’s brace expansion to reduce key strokes.
This powerful feature makes svn diff commands a lot easier.
Almost all command line users on Mac should be familiar with iTerm – which is a free replacement to the standard terminal application. However this tool now has a big brother in the pipeline called iTerm2.
iTerm2 is a fork of the original iTerm project and for most part, they are the same, but iTerm2 has a considerable number of improvements over it’s predecessor.
It’s a common problem developers face – how can I see just the changes that have been made and ignore all the line ending changes? This tends to happen when you have members of your team committing changes when they have checked out the code onto different operating systems, be it Windows, Mac of Linux.
svn diff doesn’t really have a built in option for ignoring whitespace, but gnu diff does, and it is possible to use it within an svn diff command by using –diff-cmd