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=-4.7 required=3.0 tests=AWL,BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,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 D955120193 for ; Sun, 4 Sep 2016 07:21:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751986AbcIDHVn (ORCPT ); Sun, 4 Sep 2016 03:21:43 -0400 Received: from mout.gmx.net ([212.227.17.22]:50346 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751539AbcIDHVm (ORCPT ); Sun, 4 Sep 2016 03:21:42 -0400 Received: from virtualbox ([37.24.141.250]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0MFu0Y-1buFVK0DCQ-00EyxE; Sun, 04 Sep 2016 09:21:24 +0200 Date: Sun, 4 Sep 2016 09:21:22 +0200 (CEST) From: Johannes Schindelin X-X-Sender: virtualbox@virtualbox To: Jeff King cc: Aaron M Watson , git@vger.kernel.org, Jon Seymour , David Caldwell , =?UTF-8?Q?=C3=98ystein_Walle?= , =?UTF-8?Q?=C3=86var_Arnfj=C3=B6r=C3=B0_Bjarmason?= , David Aguilar , Alex Henrie Subject: Re: [PATCH] stash: allow ref of a stash by index In-Reply-To: <20160904015209.ba6arov46ntr2ouq@sigill.intra.peff.net> Message-ID: References: <1472944878.19860.4.camel@gmail.com> <20160904015209.ba6arov46ntr2ouq@sigill.intra.peff.net> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0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faPyCbZeyUTUaXEMyv+KbHTtZBK4/yJ4BWLJB3DvzTbiPqopI0Pf3FGLOFg HdEnEKW Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Hi, On Sat, 3 Sep 2016, Jeff King wrote: > On Sat, Sep 03, 2016 at 07:21:18PM -0400, Aaron M Watson wrote: > > > Allows stashes to be referenced by index only. Instead of referencing > > "stash@{n}" explicitly, it can simply be referenced as "n". > > This says "what" but not "why". I assume it is "because the former is > more annoying to type". > > Are there any backwards-compatibility issues you can think of? > > I think that "123456" could be a sha1, but I do not see much point in > referencing a sha1 as the argument of "stash show". And it looks like > this code path is called only from is_stash_like(), so presumably the > same logic would apply to other callers. Maybe we could make it unambiguous, e.g. by using # instead: #123456 cannot refer to a SHA-1. But then, '#' are comment-starting in shells, so they would have to by escaped. Maybe the best option would be to introduce a -n option, with the shortcut - thanks to e0319ff (parseopt: add OPT_NUMBER_CALLBACK, 2009-05-07). Ciao, Johannes