Re: more git updates..

Ralph Corderoy
2005-04-09T23:25:28Z

Hi Linus,

> Btw, the NUL-termination makes this really easy to use even in shell
> scripts, ie you can do
>
> diff-tree <sha1> <sha1> | xargs -0 do_something
>
> and you'll get each line as one nice argument to your "do_something"
> script. So a do_diff could be based on something like
>
> #!/bin/sh

Watch out for when xargs invokes do_something more than once and the `<'
is parsed by a different one than the `>'. A `while read ...; do ...
done' would avoid that, but wouldn't like the NULs instead of LFs.

Cheers,

Ralph.