Wednesday 30 January 2008

Why I like unix

I like unix because it is easy to do tasks with throw-away 1 liners that take less than a minute to come up with.

I had re-factored some patches from one source tree to another, and I needed to make sure that I hadn’t missed any fragments.

$ git-diff ccache..v4-0-vfs-proxy | grep '^+++' | sort | uniq | sed -e "s/^\+\+\+ b\///" | while read f ; do diff -bwu ../$f /home/projects/samba-git/$f ; done

So I get a list of files that my changes affected, and then compared those to the equivalent files in the new tree. The diff was small and consisted mostly of pre-existing changes between the two trees.

I was easily able to account for any other slight differences is the resulting files.

I suspect that there were git-tools to help here, but the point is that I didn’t have to learn the official way to do my task, but I was still able to do it quickly based on existing knowledge.

No comments:

Post a Comment