This is helping me sooo much that it would a crime not to share it. It's actually nothing fancy, just a very convenient thing that I've learned to get used to. ff is an executable script I use to find files in a git repository. Goes like this:

$ ff list
$ ff venue

It makes it easy to super quickly search for added files without having to use the slow find command which would also otherwise find backup files and other junk that isn't checked in.

To install it, create a file called ~/bin/ff and make it executable:

$ chmod +x ~/bin/ff

Then type this code in:

import sys, os
args = sys.argv[1:]
i = False
if '-i' in args:
   i = True
pattern = args[-1]
extra_args = ''
if len(args) > 1:
   extra_args = ' '.join(args[:-1])
param = i and "-i" or ""
cmd = "git ls-files | grep %s %s '%s'" % (param, extra_args, pattern)
Tom - 26 March 2011 [«« Reply to this]
Why not just add to your .bashrc:

alias ff="git ls-files | grep"
iivvoo - 28 March 2011 [«« Reply to this]
fyi your postings keep appearing double (with a significant delay) in my google reader.

Your email will never ever be published