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

Re: [PATCH 1/3] checkout.c: add strict usage of -- before file_path

From
Junio C Hamano <gitster@pobox.com>
Date
May 14, 2018, 01:51 UTC
Message-ID
<xmqqsh6vc8do.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<CACsJy8DZ1QvjO+JdbB76TOLtB2wp4Ya+CgsTyD1oz2Y+ZdKdYQ@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
>
> I would like an option to revert back to current behavior. I'm not a
> new user. I know what I'm doing. Please don't make me type more.

I can guarantee that nobody will stay a newbie. They either become more proficient and aware of what they are doing without having to think, at which point they start feeling the same way as you are. Or they leave the Git ecosystem and move to better things ;-)

> And '--" is not completely useless. If you have <file> and <branch>
> with the same name, you have to give "--" to to tell git what the
> first argument means.
Correct.

We _could_ do better than the corrent code, though, when we happen to have a file called 'master'. "git checkout master master" cannot mean anything other than "I want to make the index and the working tree copies of 'master' file to match what is recorded on the master branch", but I think we do require "git checkout master -- master" disambiguation.

Previous: Philip OakleyNext: Kevin Daudt
Message 8 of 11 in “checkout.c: add strict usage of -- before file_path”
  1. 1/3 checkout.c: add strict usage of -- before file_pathDannier Castro L, May 13, 2018
  2. 2/3 test: update tests for strict usage of -- checkoutDannier Castro L, May 13, 2018
  3. 3/3 doc: update doc for strict usage of -- checkoutDannier Castro L, May 13, 2018
  4. Duy NguyenMay 13, 2018
  5. Dannier Castro LMay 13, 2018
  6. SZEDER GáborMay 13, 2018
  7. Philip OakleyMay 13, 2018
  8. Junio C HamanoMay 14, 2018
  9. Kevin DaudtMay 13, 2018
  10. Duy NguyenMay 14, 2018
  11. Duy NguyenMay 14, 2018

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.