From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 920F5C07E99 for ; Mon, 12 Jul 2021 19:47:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7BE5061249 for ; Mon, 12 Jul 2021 19:47:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236514AbhGLTt4 (ORCPT ); Mon, 12 Jul 2021 15:49:56 -0400 Received: from cloud.peff.net ([104.130.231.41]:46950 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234124AbhGLTt4 (ORCPT ); Mon, 12 Jul 2021 15:49:56 -0400 Received: (qmail 21274 invoked by uid 109); 12 Jul 2021 19:47:07 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Mon, 12 Jul 2021 19:47:07 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 9544 invoked by uid 111); 12 Jul 2021 19:47:07 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Mon, 12 Jul 2021 15:47:07 -0400 Authentication-Results: peff.net; auth=none Date: Mon, 12 Jul 2021 15:47:06 -0400 From: Jeff King To: Junio C Hamano Cc: "brian m. carlson" , Jiang Xin , Git List , Jiang Xin Subject: Re: [PATCH] revision: allow pseudo options after --end-of-options Message-ID: References: <20210708150316.10855-1-worldhello.net@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Mon, Jul 12, 2021 at 11:47:23AM -0700, Junio C Hamano wrote: > Jeff King writes: > > > I don't think fully-qualifying refs is a complete solution, though. The > > common use case for --end-of-options is that you're passing along names > > from somewhere else, and you don't know how to qualify them. E.g., in: > > > > git rev-list --end-of-options "$rev" -- > > > > you need to behave differently if you got "1234abcd" versus "foo" versus > > "refs/heads/foo". > > I suspect that you can prefix "^^" unconditionally, just like --not > can be emulated away by unconditionally prefixing "^". That would be clever, but I think we only parse a single "^": $ git rev-list ^HEAD [no output] $ git rev-list ^^HEAD fatal: bad revision '^^HEAD' $ git rev-parse ^HEAD ^d486ca60a51c9cb1fe068803c3f540724e95e83a $ git rev-parse ^^HEAD ^^HEAD fatal: ambiguous argument '^^HEAD': unknown revision or path not in the working tree. -Peff