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

Re: [BUG] potential error in parsing git checkout options?

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
May 29, 2015, 12:23 UTC
Message-ID
<vpqiobb7eu1.fsf@anie.imag.fr>
In-Reply-To
<854038739.144343.1432895421483.JavaMail.zimbra@ensimag.grenoble-inp.fr>
Guillaume Pages <guillaume.pages@ensimag.grenoble-inp.fr> writes:
> Git version : 2.4.1.652.g8fd8657 
>
> When we run git checkout -babar, we would expect an error message like 
> "unknown switch 'a' " and we get "Switched to a new branch 'abar'".

Yes, the option-parser accepts sticked form (-bbranch) and unsticked (-b branch). This is the convention with most Unix commands (try "grep -e foo" Vs "grep -efoo").

It gets more confusing for "git -amend" Vs "git --amend", which got a special-case to avoid confusion (strictly speaking, it should have been equivalent to "git commit -a -m end").

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Guillaume Pages
Message 2 of 2 in “[BUG] potential error in parsing git checkout options?”
  1. Guillaume PagesMay 29, 2015
  2. Matthieu MoyMay 29, 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.