From: Junio C Hamano <gitster@pobox.com>
To: Kenny Lee Sin Cheong <kenny.lee28@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/2] Add revision range support on "-" and "@{-1}"
Date: Wed, 25 Mar 2015 15:24:26 -0700 [thread overview]
Message-ID: <xmqqa8z01zs5.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <87r3sfz25t.fsf@gmail.com> (Kenny Lee Sin Cheong's message of "Mon, 23 Mar 2015 20:09:50 -0400")
Kenny Lee Sin Cheong <kenny.lee28@gmail.com> writes:
> If I'm understanding correctly, the problem of checking revisions before
> arg is that an option fed to handle_revision_arg() might die() before getting
> checked as an option in cases where a file with the same name exists?
>
> But doesn't verify_non_filename() already return silently if arg begins
> with "-"? It die() only after making that check.
>
> If an option with ".." in it such as -$opt..ion is really given to
> handle_revision_arg() then verify_non_filename should not be a problem.
Yes, but should we be relying on that behaviour? The special casing
to assume that no sane person would name a file starting with a dash
is what I find somewhat disturbing.
prev parent reply other threads:[~2015-03-25 22:24 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
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 [this message]
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=xmqqa8z01zs5.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=kenny.lee28@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.
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 NNTP newsgroup(s).