git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] Add revision range support on "-" and "@{-1}"

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 25, 2015, 22:24 UTC
Message-ID
<xmqqa8z01zs5.fsf@gitster.dls.corp.google.com>
In-Reply-To
<87r3sfz25t.fsf@gmail.com>
Kenny Lee Sin Cheong <kenny.lee28@gmail.com> writes:
Show 9 quoted lines
> 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.

Previous: Kenny Lee Sin Cheong
Message 9 of 9 in “[GSoC] revision.c: Allow "-" as stand-in for "@{-1}" everywhere a branch is allowed”
  1. 0/2 [GSoC] revision.c: Allow "-" as stand-in for "@{-1}" everywhere a branch is allowedKenny Lee Sin Cheong, Mar 16, 2015
  2. 1/2 "-" and "@{-1}" on various programsKenny Lee Sin Cheong, Mar 16, 2015
  3. 2/2 Add revision range support on "-" and "@{-1}"Kenny Lee Sin Cheong, Mar 16, 2015
  4. Junio C HamanoMar 16, 2015
  5. Junio C HamanoMar 17, 2015
  6. Kenny Lee Sin CheongMar 17, 2015
  7. Junio C HamanoMar 17, 2015
  8. Kenny Lee Sin CheongMar 24, 2015
  9. Junio C HamanoMar 25, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.