From: Junio C Hamano Date: Tue, 03 Jul 2018 22:05:36 GMT Subject: Re: [PATCH 1/3] ls-tree: make optional Message-ID: In-Reply-To: Elijah Newren writes: > On Mon, Jul 2, 2018 at 8:58 PM, Joshua Nelson wrote: >> use syntax similar to `git-checkout` to make optional for >> `ls-tree`. if is omitted, default to HEAD. infer arguments as >> follows: >> >> 1. if args start with -- >> assume to be HEAD >> 2. if exactly one arg precedes --, treat the argument as >> 3. if more than one arg precedes --, exit with an error >> 4. if -- is not in args >> a) if args[0] is a valid object, treat is as such >> b) else, assume to be HEAD >> >> in all cases, every argument besides is treated as a > > Cool, this is something I've wanted a few times. Hmph, is it, and why? I'd prefer *not* to have such a DWIM in a command like ls-tree, aka plumbing commands, where predictability is worth 1000 times more than ease of typing.