Re: more git updates..

From: Ralph Corderoy
Date: Sat Apr 09 2005 - 18:29:25 EST



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.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/