git cat-file supports --batch and --batch-check options, which take object names on standard input and provide object metadata and (for --batch) contents on standard output. It assumes that one object name appears per line. For sha1s this works fine, but for names this prevents the safe use of names that contain newline characters. To address this, git cat-file could support a -z option, which makes it accept '\0'-terminated names on stdin instead. git cat-file will also print a message of the form <object> SP missing LF to stdout for each object not found in the repository. This will need revising as well to allow for object names with newlines; perhaps it could drop the object name and just print "missing" and an LF, assuming the consumer of the data knows what it asked for. - Josh Triplett