I really love *nix

So I’ve recently been playing with Ditz, a ruby-based distributed issue tracker, to go along with my distributed workflow in Git. It’s a good start, but not quite polished yet. I added the issue-claiming plugin, played with it for a while, and then realized that I don’t need it since I’m the only developer on the projects that I want to use it for.

Then I removed the plugin, but it left behind sections in the ditz yaml files that caused it to now spew warnings.

msoulier@egor:...ier/work/mbg-bugs$ ditz todo
warning: unknown field "claimer" in YAML for
tag:ditz.rubyforge.org,2008-03-06:issue; ignoring
warning: unknown field "claimer" in YAML for
tag:ditz.rubyforge.org,2008-03-06:issue; ignoring
warning: unknown field "claimer" in YAML for
tag:ditz.rubyforge.org,2008-03-06:issue; ignoring
warning: unknown field "claimer" in YAML for
tag:ditz.rubyforge.org,2008-03-06:issue; ignoring

Well that’s unacceptable. So now I need to remove this claimer line from each file. Well, this is *nix so I’m not doing it by hand. I could use a perl one-liner but I’m a tad more familiar with ex commands, editing in Vim all day as I do.

So, I make an exscript file containing this:

%g/^claimer:/d
wq

And then run it on the files like so

for file in $(find bugs -name "issue*.yaml")
do
   ex - $file < exscript
done

Presto. Fixed. So happy.

Post a Comment

Required fields are marked *

*
*

Follow

Get every new post delivered to your Inbox.