From: Jeff King <peff@peff.net>
To: "Øystein Walle" <oystwa@gmail.com>
Cc: "Aaron M Watson" <watsona4@gmail.com>, Git <git@vger.kernel.org>,
"Jon Seymour" <jon.seymour@gmail.com>,
"David Caldwell" <david@porkrind.org>,
"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
"David Aguilar" <davvid@gmail.com>,
"Alex Henrie" <alexhenrie24@gmail.com>
Subject: Re: [PATCH] stash: allow ref of a stash by index
Date: Mon, 5 Sep 2016 19:52:08 -0400 [thread overview]
Message-ID: <20160905235207.jkxmnrwoc6lllomk@sigill.intra.peff.net> (raw)
In-Reply-To: <CAFaJEqu-JUcwLjrQBk_huSa3DZfCf8O4eAZ=UgcXHzN=CLgtpw@mail.gmail.com>
On Mon, Sep 05, 2016 at 11:46:34PM +0200, Øystein Walle wrote:
> The bash-specific code is a no-go, so here's a way to do it in a way
> that I think is in line with Git's code style for shell scripts. I took
> the liberty of removing the '|| exit 1' since the rev is verified later
> on anyway, as can be seen in the last piece of context. That way the
> argument munging can be done at a later stage where we don't have to
> loop over multiple ones. The first rev-parse's purpose is just to apply
> --sq.
I wondered how that would impact the error message when there is no such
stash. It looks like rev-parse will still return the bogus name on
stdout, so we do not run afoul of the "No stash found" code path. We do
get:
$ git.compile stash show foobar
foobar is not a valid reference
instead of:
$ git stash show foobar
fatal: ambiguous argument 'foobar': unknown revision or path not in
the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
But I do not see that as a big downside (I might even call it an
improvement).
-Peff
next prev parent reply other threads:[~2016-09-05 23:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-03 23:21 [PATCH] stash: allow ref of a stash by index Aaron M Watson
2016-09-04 1:52 ` Jeff King
2016-09-04 7:01 ` Junio C Hamano
2016-09-04 7:21 ` Johannes Schindelin
2016-09-04 10:57 ` Philip Oakley
2016-09-05 21:46 ` Øystein Walle
2016-09-05 21:58 ` Øystein Walle
2016-09-05 23:52 ` Jeff King [this message]
2016-09-07 17:50 ` Junio C Hamano
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=20160905235207.jkxmnrwoc6lllomk@sigill.intra.peff.net \
--to=peff@peff.net \
--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=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).