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.4 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 DDEE01F404 for ; Thu, 19 Apr 2018 05:10:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753223AbeDSFKp (ORCPT ); Thu, 19 Apr 2018 01:10:45 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:46042 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751565AbeDSFKo (ORCPT ); Thu, 19 Apr 2018 01:10:44 -0400 Received: by mail-wr0-f196.google.com with SMTP id u11-v6so10307375wri.12 for ; Wed, 18 Apr 2018 22:10:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=JTE2+tNTHkvpsmJrqcasXZ8txCLWmMoOwWLCYQnCf6w=; b=ekN2B//T08HJ3fEnBKB2OxA7l2PWWAnDDlr9rWQ3L4QNAlIuUwBv3PJx1aEkKB6GjZ KKiLaDLWBO4IRUaba4hFxEyhwFhKKLUAyskHmm9wd97qnKbFUpEx8VInRNBhic7JhN0U OdUGenEaAMTJiSP7lhokvkGpE8MHk1J4m3Zn8F4U3K7g0Mfoc1DPFZW9HnH7h+qwTum0 iqwx9LpixHB8MjuGca7Db0bwi40Qi1d35GmAmp7VmK7sL7zBgBZp3H7AOw+toZHhBNSi gXMORrSygRa9K+1Ii7GSjYcewHQLs9rXdKxUsCgMdUZI+DD/89Pd2zZJkfVlAKYZPpeX Wqcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=JTE2+tNTHkvpsmJrqcasXZ8txCLWmMoOwWLCYQnCf6w=; b=kJuqYRfPXV1QSPjImVGBkN9FSRnJnAapfccG9V9Hbb39kXifwJc5lVmW6BbCoZIyw1 ofSpL6O7zxw/fI8jbUiEXmkWL4aNRcFTXKjT/eCXInAGTwFENMklfGXl0VyJKMt490Pj Tj1NG8CcQotH7ALDQbvflbB/5q73kUxj0/E8MhHTSjG8erIJ8fQ0UmAHdBDJPWxFLhkZ vfged2k8mStm0mnnOuDCmneXGb58qz9bFNDedMA8feGPrYCEzLzHIJ9o9HK7hrl3ERE0 3DfeluLK1N/VPqPUg7Kwr+G5jvteD0uu79/iJDsFVWqg2bhVHIGL2pM26Ufzz6uJpXyO Sk8w== X-Gm-Message-State: ALQs6tB5/S2h3hh/Uji0AsxjMfxJ8xeuYj20w21pwjMburJtIWT53wfZ m2J2alm9vZSLemy0vqeBEkA= X-Google-Smtp-Source: AIpwx48gBnYzcVHbl1fl7j7U0xYqWoAgU3xk0tjNAFy2yHfOL12V76+DmIVfAxZErIROho6nXfQpsw== X-Received: by 10.28.23.149 with SMTP id 143mr3619584wmx.0.1524114643037; Wed, 18 Apr 2018 22:10:43 -0700 (PDT) Received: from localhost (112.68.155.104.bc.googleusercontent.com. [104.155.68.112]) by smtp.gmail.com with ESMTPSA id m16sm3679423wmb.42.2018.04.18.22.10.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 18 Apr 2018 22:10:40 -0700 (PDT) From: Junio C Hamano To: Linus Torvalds Cc: Git Mailing List , Paul-Sebastian Ungureanu Subject: Re: Silly "git gc" UI issue. References: Date: Thu, 19 Apr 2018 14:10:40 +0900 In-Reply-To: (Linus Torvalds's message of "Wed, 18 Apr 2018 19:29:47 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Linus Torvalds writes: > Maybe something like the attached patch? Then I get: > ... > [torvalds@i7 linux]$ time git gc --prune=npw > fatal: Failed to parse prune expiry value npw > > real 0m0.004s > user 0m0.002s > sys 0m0.002s > > and you could smush it into your commit (if you want my sign-off, take it) > > Linus > > builtin/gc.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/builtin/gc.c b/builtin/gc.c > index 3e67124ea..a4b20aaaf 100644 > --- a/builtin/gc.c > +++ b/builtin/gc.c > @@ -354,6 +354,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix) > const char *name; > pid_t pid; > int daemonized = 0; > + timestamp_t dummy; > > struct option builtin_gc_options[] = { > OPT__QUIET(&quiet, N_("suppress progress reporting")), > @@ -392,6 +393,9 @@ int cmd_gc(int argc, const char **argv, const char *prefix) > if (argc > 0) > usage_with_options(builtin_gc_usage, builtin_gc_options); > > + if (parse_expiry_date(prune_expire, &dummy)) > + die(_("Failed to parse prune expiry value %s"), prune_expire); > + At this point prune_expire could be NULL, so the if() needs a bit tightening, but otherwise it looks good. Here is the final one (at least for today). -- >8 -- Subject: [PATCH] parseopt: handle malformed --expire arguments nicer A few commands that parse --expire=