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

Re: [PATCH] parse-options: Allow abbreviated options when unambiguous

From
EWEric Wong <normalperson@yhbt.net>
Date
Oct 14, 2007, 22:49 UTC
Message-ID
<20071014224959.GA17828@untitled>
In-Reply-To
<Pine.LNX.4.64.0710142309010.25221@racer.site>
Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
Show 40 quoted lines
> Hi,
> 
> On Sun, 14 Oct 2007, Eric Wong wrote:
> 
> > Pierre Habouzit <madcoder@debian.org> wrote:
> > > On Sun, Oct 14, 2007 at 06:02:33PM +0000, Johannes Schindelin wrote:
> > > > Hi,
> > > > 
> > > > On Sun, 14 Oct 2007, Johannes Schindelin wrote:
> > > > 
> > > > > When there is an option "--amend", the option parser now recognizes 
> > > > > "--am" for that option, provided that there is no other option beginning 
> > > > > with "--am".
> > > > 
> > > > And an amend for ultra-abbreviated options (as you noticed on IRC):
> > > > 
> > > > diff --git a/parse-options.c b/parse-options.c
> > > > index afc6c89..acabb98 100644
> > > > --- a/parse-options.c
> > > > +++ b/parse-options.c
> > > > @@ -137,6 +137,11 @@ is_abbreviated:
> > > >  				abbrev_flags = flags;
> > > >  				continue;
> > > >  			}
> > > > +			/* negated and abbreviated very much? */
> > > > +			if (!prefixcmp("no-", arg)) {
> > > > +				flags |= OPT_UNSET;
> > > > +				goto is_abbreviated;
> > > > +			}
> > > >  			/* negated? */
> > > >  			if (strncmp(arg, "no-", 3))
> > > >  				continue;
> > > 
> > >   squashed on top on the previous, and pushed to my ph/parseopt branch.
> > 
> > Awesome.  Thanks to both of you.
> 
> Hehe, you're welcome.  Pierre even realised that my patch was not complete 
> (it did not catch overly short abbreviations "--n" and "--no"), and that 
> has been fixed, too.
Show 8 quoted lines
> While I have your attention: last weekend, I spoke to a guy from the 
> ffmpeg project, and he said that the only thing preventing them from 
> switching to git was the lack of svn:external support...
> 
> (Of course I know that it is more difficult than that: ffmpeg itself is an 
> svn:external of MPlayer, but maybe we can get both of them to switch ;-)
> 
> Do you have any idea when/if you're coming around to add that to git-svn?

Soonish, possibly within a next week, even. I have actually have started a project (using git) that wants to use SVN-hosted repositories directly submodules; so the fact that I'll actually need something like it bodes well for getting it implemented :)

-- 
Eric Wong
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 10 of 42 in “[RFC] CLI option parsing and usage generation for porcelains”
  1. Pierre HabouzitOct 13, 2007
  2. Wincent ColaiutaOct 13, 2007
  3. Eric WongOct 14, 2007
  4. Pierre HabouzitOct 14, 2007
  5. parse-options: Allow abbreviated options when unambiguousJohannes Schindelin, Oct 14, 2007
  6. Johannes SchindelinOct 14, 2007
  7. Pierre HabouzitOct 14, 2007
  8. Eric WongOct 14, 2007
  9. Johannes SchindelinOct 14, 2007
  10. Eric WongOct 14, 2007
  11. git-svn and submodules, was Re: [PATCH] parse-options: Allow abbreviated options when unambiguousJohannes Schindelin, Oct 14, 2007
  12. Benoit SIGOUREOct 15, 2007
  13. Andreas EricssonOct 15, 2007
  14. Benoit SIGOUREOct 15, 2007
  15. David KastrupOct 15, 2007
  16. Benoit SIGOUREOct 15, 2007
  17. Andreas EricssonOct 15, 2007
  18. Karl HasselströmOct 15, 2007
  19. .gitignore and svn:ignore [WAS: git-svn and submodules]Chris Shoemaker, Oct 15, 2007
  20. Eric WongOct 16, 2007
  21. Karl HasselströmOct 16, 2007
  22. Chris ShoemakerOct 16, 2007
  23. Linus TorvaldsOct 15, 2007
  24. Performance issue with excludes (was: Re: git-svn and submodules)Benoit SIGOURE, Oct 15, 2007
  25. Linus TorvaldsOct 15, 2007
  26. Benoit SIGOUREOct 15, 2007
  27. Linus TorvaldsOct 15, 2007
  28. Benoit SIGOUREOct 15, 2007
  29. Johannes SchindelinOct 13, 2007
  30. Pierre HabouzitOct 13, 2007
  31. Johannes SchindelinOct 13, 2007
  32. Pierre HabouzitOct 13, 2007
  33. Alex RiesenOct 13, 2007
  34. Pierre HabouzitOct 13, 2007
  35. Alex RiesenOct 13, 2007
  36. Pierre HabouzitOct 13, 2007
  37. Alex RiesenOct 13, 2007
  38. Pierre HabouzitOct 14, 2007
  39. Simplify usage string printingJonas Fonseca, Oct 14, 2007
  40. Pierre HabouzitOct 14, 2007
  41. Update manpages to reflect new short and long option aliasesJonas Fonseca, Oct 14, 2007
  42. Pierre HabouzitOct 14, 2007

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.