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

Re: [PATCH 4/4 v4] sha1_name.c: teach get_sha1_1 "-" shorthand for "@{-1}"

From
Siddharth Kannan <kannan.siddharth12@gmail.com>
Date
Feb 22, 2017, 06:27 UTC
Message-ID
<CAN-3QhrAYJaVNf-4LKpT2uZQr1ubyxpd1Cpo-hVhGL8dh+_SXA@mail.gmail.com>
In-Reply-To
<xmqqshn8ip0j.fsf@gitster.mtv.corp.google.com>
On 21 February 2017 at 02:00, Junio C Hamano <gitster@pobox.com> wrote:
Show 8 quoted lines
> Siddharth Kannan <kannan.siddharth12@gmail.com> writes:
> > So, is it okay to stop with just supporting "-" and not support things
> > like "-@{yesterday}"?
>
> If the approach to turn "-" into "@{-1}" at that spot you did will
> cause "-@{yesterday}" to barf, then I'd say so be it for now ;-).
> We can later spread the understanding of "-" to functions deeper in
> the callchain and add support for that, no?

Yes, this can be done later. I will send these patches again, with only the changes that are discussed here.

I will keep the tests for "-@{yesterday}" as failing tests, if that would help in finding this again and fixing it later.

Thanks for your review, Junio!
-- 
Best Regards,

- Siddharth Kannan.
Previous: Junio C HamanoNext: Matthieu Moy
Message 13 of 16 in “WIP: allow "-" as a shorthand for "previous branch"”
  1. 0/4 WIP: allow "-" as a shorthand for "previous branch"Siddharth Kannan, Feb 16, 2017
  2. 1/4 revision.c: do not update argv with unknown optionSiddharth Kannan, Feb 16, 2017
  3. Matthieu MoyFeb 16, 2017
  4. Junio C HamanoFeb 16, 2017
  5. Matthieu MoyFeb 16, 2017
  6. Siddharth KannanFeb 16, 2017
  7. 2/4 revision.c: swap if/else blocksSiddharth Kannan, Feb 16, 2017
  8. 3/4 revision.c: args starting with "-" might be a revisionSiddharth Kannan, Feb 16, 2017
  9. 4/4 sha1_name.c: teach get_sha1_1 "-" shorthand for "@{-1}"Siddharth Kannan, Feb 16, 2017
  10. Junio C HamanoFeb 16, 2017
  11. Siddharth KannanFeb 20, 2017
  12. Junio C HamanoFeb 20, 2017
  13. Siddharth KannanFeb 22, 2017
  14. Matthieu MoyFeb 16, 2017
  15. Junio C HamanoFeb 16, 2017
  16. Siddharth KannanFeb 16, 2017

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.