On Mon, Oct 13, 2014 at 2:31 PM, Jonathan Nieder <jrnieder@xxxxxxxxx> wrote: > Jeff King wrote: >> On Mon, Oct 13, 2014 at 09:10:22AM -0700, Jonathan Nieder wrote: > >>> There's another downside to that construct: it loses the exit >>> status from some_cmd. >> >> Yes, although I think in many cases it's not a big deal. For example, >> here we lose the exit code of count-objects, but it also is very >> unlikely to fail _and_ produce our expected output. > > It could segfault after producing the good output, but sure, > count-objects code doesn't change very often. "Doesn't change very often" is not the issue. Here we are not testing if it can count correctly without crashing, which *is* the real reason why it is perfectly fine to use $(git count-objects | sed ...) pattern here. There of course should be a test for count-objects to make sure it counts correctly without crashing. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html