git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Aaron M Watson <watsona4@gmail.com>
Cc: git@vger.kernel.org, "Jon Seymour" <jon.seymour@gmail.com>,
	"David Caldwell" <david@porkrind.org>,
	"Øystein Walle" <oystwa@gmail.com>, "Jeff King" <peff@peff.net>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"David Aguilar" <davvid@gmail.com>,
	"Alex Henrie" <alexhenrie24@gmail.com>
Subject: Re: [PATCH] Allow stashes to be referenced by index only
Date: Tue, 25 Oct 2016 14:41:30 -0700	[thread overview]
Message-ID: <xmqqshrkqf79.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <1477352413-4628-1-git-send-email-watsona4@gmail.com> (Aaron M. Watson's message of "Mon, 24 Oct 2016 19:40:13 -0400")

Aaron M Watson <watsona4@gmail.com> writes:

Aaron M Watson <watsona4@gmail.com> writes:

> Instead of referencing "stash@{n}" explicitly, it can simply be
> referenced as "n".
> Most users only reference stashes by their position
> in the stash stask (what I refer to as the "index").

It is unclear if the first sentence is a statement of the fact, an
expression of desire, or something else.  With the current codebase,
it cannot simply be referenced as "n", and you either "wish it were
possible", or "make it possible to do so", or perhaps little bit of
both.

This is why we tend to use imperative mood to give an order to the
codebase to "be like so" to make it clear.

Perhaps

  Instead of referencing "stash@{n}" explicitly, make it possible to
  simply reference as "n".  Most users only reference stashes by their
  position in the stash stask (what I refer to as the "index" here).

or something like that (which is what I tenatively rewritten this to
while queuing).

> @@ -404,6 +403,9 @@ parse_flags_and_rev()
>  					die "$(eval_gettext "unknown option: \$opt")"
>  				FLAGS="${FLAGS}${FLAGS:+ }$opt"
>  			;;
> +			*)
> +				REV="${REV}${REV:+ }'$opt'"
> +			;;
>  		esac
>  	done
>  
> @@ -422,6 +424,15 @@ parse_flags_and_rev()
>  		;;
>  	esac
>  
> +	case "$1" in
> +		*[!0-9]*)
> +			:
> +		;;
> +		*)
> +			set -- "${ref_stash}@{$1}"
> +		;;
> +	esac

I can see that you inherited the brokenness from an existing one in
the earlier hunk, but case arms in these two case statements are
indented one level too deep.  It would be good to fix it in a
follow-up patch (not a reroll of this patch).

Thanks.  Will queue.

  parent reply	other threads:[~2016-10-25 21:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-08 23:46 [PATCH] Allow stashes to be referenced by index only Aaron M Watson
2016-10-23  9:02 ` Jeff King
     [not found]   ` <CAB0+k9JrX7Ax26HfTEgoSyj02szFyHLayqTyW6KPuxVvXBOEOw@mail.gmail.com>
2016-10-24 12:54     ` Jeff King
2016-10-24 23:40 ` Aaron M Watson
2016-10-25  8:11   ` Jeff King
2016-10-25  8:20     ` Aaron and Ashley Watson
2016-10-25 21:41   ` Junio C Hamano [this message]
2016-10-26  0:12     ` Ramsay Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqshrkqf79.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=alexhenrie24@gmail.com \
    --cc=avarab@gmail.com \
    --cc=david@porkrind.org \
    --cc=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jon.seymour@gmail.com \
    --cc=oystwa@gmail.com \
    --cc=peff@peff.net \
    --cc=watsona4@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).