Android ProGuard and Git Tip

If you’re obfuscating your Android applications using ProGuard, make sure to keep the proguard/ directory at the root of your Android project under revision control. This may seem contrary to what you’d feel like doing, as the files are autogenerated, but it will help if you ever need to debug a stack trace from your published application. Typically when I’m ready to release, and after I’ve done every other change, I will bump the revision in my AndroidManifest.xml and generate a new .apk from eclipse, then test it out on my device. »

My .gitconfig - 2011 Edition

It’s been just shy of five years since I first blogged about my .gitconfig file, so I figured now would be a good time to revisit it. If you’re not already aware, you can set git configuration values in a .gitconfig file in your home directory, and have them apply to all git repositories you work on. This is particularly useful for aliases and to set your email address. My current .gitconfig: [user] name = James Bowes email = $EMAIL_ADDRESS [alias] ci = commit -a co = checkout st = status praise = blame br = branch diffstat = diff --stat cat = !cat @ ds = diff --stat lol = log --graph --decorate --pretty=oneline --abbrev-commit lola = log --graph --decorate --pretty=oneline --abbrev-commit --all [apply] whitespace = warn [diff] rename = copy renamelimit = 600 [pager] color = true [color] branch = auto diff = auto interactive =auto status = auto [push] default = upstream [github] user = jbowes token = $GITHUB_TOKEN I cribbed _lol _and lola from Adrian. »

Graphing Git Repository Activity In ASCII

Here’s a quick little script I wrote up (adapted from this perlmonks post) to show git repository activity as an ascii graph, like so: The X axis represents a day, with the current day being on the far right. The Y axis is no. of lines added + no. of lines deleted during that day. EDIT (2009/02/03): Wordpress.com won’t let me attach a .pl file, so here’s the contents: #!/usr/bin/perl # # git-graph.pl - Generate an ascii graph of git repository activity # # Copyright (C) 2008 James Bowes <jbowes@dangerouslyinc.com> # # Graphing routine Adapted from http://www.perlmonks.org/?node_id=336907 sub get_activity { my $day = shift; my $git_cmd = 'git diff --shortstat "@{' . »

git bisect: A practical example with yum

I used git bisect to track down a bug in yum last night. It was so easy and practical that I figured I should record it here, so that others might want to give git a try. I was attempting to install mutt, and yum failed (printing a traceback) after the rpms had been downloaded, but before the test transaction finished. So I started git bisect, and marked the current point as bad: $> git bisect start $> git bisect bad The yum 3.1.0 release didn’t have this bug (it was the version I had installed at the time), so I marked it as good: $> git bisect good yum-3-1-0 Bisecting: 15 revisions left to test after this [1d0454af41ef6361604cafa8c7a13d80bc183c63] make it so that we see that the local rpm is present and then don't download Git automatically checks out the next revision for you to test. »

Giving back to git

It must be obvious from previous posts that I love git. Tonight I sent a patch to the mailing list. It’s small and simple; it lets you save options for cvsimport in your config file, rather than supplying them each time you run it. Hopefully it will be of use to others. »

My .gitconfig

**Update: **I’ve posted a revised version of my .gitconfig here. By default, git does not include aliases for commands. For instance, ‘git status’ works but ‘git st’ does not. This will hurt your noggin if you are used to using cvs or svn. Also, the internet is for posting config files on. So here are the contents of my .gitconfig: [user] name = James Bowes email = MY_EMAIL [alias] ci = commit -a co = checkout st = status -a praise = blame [apply] whitespace = strip [diff] color = auto rename = copy [pager] color = true [status] color = auto Just drop that into ~/.gitconfig and you’re all set. »