From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.5 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id D84CB20C31 for ; Thu, 7 Dec 2017 08:19:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750922AbdLGITN (ORCPT ); Thu, 7 Dec 2017 03:19:13 -0500 Received: from cloud.peff.net ([104.130.231.41]:50634 "HELO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1750869AbdLGITM (ORCPT ); Thu, 7 Dec 2017 03:19:12 -0500 Received: (qmail 27945 invoked by uid 109); 7 Dec 2017 08:19:12 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with SMTP; Thu, 07 Dec 2017 08:19:12 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 19331 invoked by uid 111); 7 Dec 2017 08:19:33 -0000 Received: from sigill.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.7) by peff.net (qpsmtpd/0.94) with ESMTPA; Thu, 07 Dec 2017 03:19:33 -0500 Authentication-Results: peff.net; auth=pass (cram-md5) smtp.auth=relayok Received: by sigill.intra.peff.net (sSMTP sendmail emulation); Thu, 07 Dec 2017 03:19:10 -0500 Date: Thu, 7 Dec 2017 03:19:10 -0500 From: Jeff King To: Christian Couder Cc: Jacob Keller , Git mailing list Subject: Re: git commit file completion recently broke Message-ID: <20171207081910.GA29464@sigill.intra.peff.net> References: <20171207002234.GA21003@sigill.intra.peff.net> <20171207002439.GB21003@sigill.intra.peff.net> <20171207005639.GB1975@sigill.intra.peff.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Thu, Dec 07, 2017 at 09:14:31AM +0100, Christian Couder wrote: > > I do think it may make sense for > > the "short" one to use NULL, like: > > > > skip_to_optional_val(arg, "--relative, &arg) > > > > but maybe some other callers would be more inconvenienced (they may have > > to current NULL back into the empty string if they want to string > > "--foo" the same as "--foo="). Oof, I lost all ability to type in that last sentence. :) It looks like you deciphered my meaning, though. > I discussed that with Junio and yeah there are many callers that want > "--foo" to be the same as "--foo=". Yeah, if this is the only case, then just calling the "_default" variant with NULL for this instance makes sense to me. > By the way I wonder if "--relative=" makes any sense, and if we should > emit a warning or just die in this case. I also wondered about that. It does function as "relative to the root of the tree". But of course if you want that you can just omit "--relative". Still, it could be a minor convenience for somebody who is filling in "--relative" in a script. That's reaching, I think, but I don't see any particular reason to _forbid_ it (especially since it has worked for many years). -Peff