Bryan Larsen <[EMAIL PROTECTED]> writes:

> For the record, "${XARGS} -0r" may be uglier than "xargs -0r", but
> replacing it with several lines of shell magic is a loss.

OK, OK, the one I suggested for xargs was _U_G_L_Y_.

The one Linus suggested looks to me the cleanest.  That is, to
give an extra parameter upfront to the command run by xargs.  My
favorite trick is like this:

  git-fsck-cache --cache --unreachable "$@" |
  sed -ne '/unreachable /{
      s/unreachable [^ ][^ ]* //
      s|\(..\)|\1/|p
  }' | {
          cd "$GIT_OBJECT_DIRECTORY" || exit
-         xargs -r $dryrun rm -f
+         xargs $dryrun rm -f ""
  }

Dry-run would say: 

    rm -f  00/012345...
    rm -f  01/234567...

without visual distraction of having printable phoney names, or
just (with an invisible trailing space):

    rm -f  

During a real run, "rm -f" would not complain "cannot remove `':
Is a directory", either.

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to