Tuesday, September 27, 2011

Show a change log after a pull in Mercurial

When working in a team on the same mercurial repository, I often want to know what has changed singe my last pull. Turns out its easy to add a hook that will do just that.  To print the change log after every pulladd the following to the [hooks] section of your ~/.hgrc file:
[hooks]
changegroup.cnglog=hg log -M --stat -r $HG_NODE:tip

But of course, bright colours are fun, so we'll use hg styles to colour-code the log. Steve Losh has a good blog article about using styles to dress up the CLI. After downloading the styles to say /home/bryan/hg/, update the trigger to use the style:
[hooks]
changegroup.cnglog=hg log -M --stat -r $HG_NODE:tip --style /home/bryan/hg/map-cmdline.slog


Sunday, September 18, 2011

Gmail's Priority Inbox: Showing all unarchived mail for a label

If you use Gmail's priority inbox, you may have noticed you can add a section that will show all email for a given label, but there is no option to only show mail in the inbox for that label. Luckily there's a simple hack to do just that. Check out this stackexchange thread or follow the steps below.

  1. Go to the priority inbox settings tab.
  2. Click the options next to the section you want to show your work mail.
  3. Click "More Options..."
  4. Inspect the element for the "Work" Label
  5. You will notice on the surrounding div there is an attribute cfg="^all,Work", change the value to "^i,Work"
  6. Select the label on the page as you normally would