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

Re: [PATCH] Check for -amend as a common wrong usage of --amend.

From
Pierre Habouzit <madcoder@debian.org>
Date
Jan 26, 2008, 10:42 UTC
Message-ID
<20080126104216.GA13922@artemis.madism.org>
In-Reply-To
<7vd4rp3y6e.fsf@gitster.siamese.dyndns.org>
On Sat, Jan 26, 2008 at 06:20:41AM +0000, Junio C Hamano wrote:
Show 15 quoted lines
> Joey Hess <joey@kitenet.net> writes:
> 
> > Some option parsers avoid this sort of ambiguity by not allowing short
> > options that take a string to be bundled in the same word with other
> > short options.
> >
> > So, for example, git-commit -am<msg> would not be allowed, while
> > git-commit -a -m<msg> and perhaps git-commit -am <msg> would be allowed.
> >
> > There could still be problems if there were a --mend option that could
> > be typoed as -mend.
> >
> > I don't know enough about compatability to say if this would work for git.
> 
> Yeah, I think that is quite a sensible workaround.
  I agree, I think that we should refuse things where the string after a
/one/ dash starts with 3 or more consecutive characters that are also
the beginning of a long option. I think that 2 is usually a bit "short"
to assume that it's a typo. I'll provide a patch soon
-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org
Previous: Junio C HamanoNext: Pierre Habouzit
Message 10 of 11 in “Check for -amend as a common wrong usage of --amend.”
  1. Check for -amend as a common wrong usage of --amend.Pascal Obry, Jan 24, 2008
  2. Pascal ObryJan 24, 2008
  3. Jörg SommerJan 26, 2008
  4. Johannes SchindelinJan 24, 2008
  5. Pascal ObryJan 24, 2008
  6. Charles BaileyJan 24, 2008
  7. Pascal ObryJan 24, 2008
  8. Joey HessJan 24, 2008
  9. Junio C HamanoJan 26, 2008
  10. Pierre HabouzitJan 26, 2008
  11. parse-options: catch some likely in presense of aggregated options.Pierre Habouzit, Jan 26, 2008

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.