From: Kenny Lee Sin Cheong <kenny.lee28@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/2] Add revision range support on "-" and "@{-1}"
Date: Tue, 17 Mar 2015 17:25:33 -0400 [thread overview]
Message-ID: <87egons4du.fsf@gmail.com> (raw)
In-Reply-To: <xmqq8uewp183.fsf@gitster.dls.corp.google.com> (Junio C. Hamano's message of "Mon, 16 Mar 2015 23:49:48 -0700")
On Tue, Mar 17 2015 at 02:49:48 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Junio C Hamano <gitster@pobox.com> writes:
>
> if (try to see if it is a revision or regvision range) {
> /* if failed ... */
> if (starts with '-') {
> do the option thing;
> continue;
> }
> /* args must be pathspecs from here on */
> check the '--' disambiguation;
> add pathspec to prune-data;
> } else {
> got_rev_arg = 1;
> }
>
> but I didn't trace the logic myself to see if that would work.
You're right. I was actually going to try and check all possible
suffixes of "-" but your solution saves us from doing that, and it
didn't break any tests.
On a similar note, would it be relevant to add similar changes to
rev-parse? While trying to write some test, I noticed that rev-parse
doesn't support "-". If I'm not mistaking it assumes everything that starts with "-"
must be an option. But since it is a plumbing tool I don't know if it
would be worth it or even an improvement.
next prev parent reply other threads:[~2015-03-17 21:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-16 15:11 [PATCH/RFC 0/2][GSoC] revision.c: Allow "-" as stand-in for "@{-1}" everywhere a branch is allowed Kenny Lee Sin Cheong
2015-03-16 15:11 ` [PATCH 1/2] "-" and "@{-1}" on various programs Kenny Lee Sin Cheong
2015-03-16 15:11 ` [PATCH 2/2] Add revision range support on "-" and "@{-1}" Kenny Lee Sin Cheong
2015-03-16 18:22 ` Junio C Hamano
2015-03-17 6:49 ` Junio C Hamano
2015-03-17 21:25 ` Kenny Lee Sin Cheong [this message]
2015-03-17 22:16 ` Junio C Hamano
2015-03-24 0:09 ` Kenny Lee Sin Cheong
2015-03-25 22:24 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87egons4du.fsf@gmail.com \
--to=kenny.lee28@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.