This sort of parsing doesn't belong here, but in the function that looks up objects from strings. I'll merge this patch without the changes to porcelain.py.