Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Commits on Feb 26, 2012
  1. @gitster

    test-parse-options: convert to OPT_BOOL()

    René Scharfe authored gitster committed
    Introduce OPT_BOOL() to test-parse-options and add some tests for
    these "true" boolean options. Rename OPT_BOOLEAN to OPT_COUNTUP and
    OPTION_BOOLEAN to OPTION_COUNTUP as well.
    
    Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Sep 28, 2011
  1. @gitster

    parseopt: add OPT_NOOP_NOARG

    René Scharfe authored gitster committed
    Add OPT_NOOP_NOARG, a helper macro to define deprecated options in a
    standard way.  The help text is taken from the no-op option -r of
    git revert.
    
    The callback could be made to emit a (conditional?) warning later.  And
    we could also add OPT_NOOP (requiring an argument) etc. as needed.
    
    Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jun 22, 2011
  1. @peff @gitster

    parse-options: add OPT_STRING_LIST helper

    peff authored gitster committed
    This just adds repeated invocations of an option to a list
    of strings. Using the "--no-<var>" form will reset the list
    to empty.
    
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Feb 15, 2011
  1. @mjg @gitster

    Make <identifier> lowercase as per CodingGuidelines

    mjg authored gitster committed
    *.c part for matches with '<[A-Z]+>' (and affected test).
    
    Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Nov 15, 2010
  1. @gitster

    add description parameter to OPT__QUIET

    René Scharfe authored gitster committed
    Allows better help text to be defined than "be quiet".  Also make use
    of the macro in a place that already had a different description.  No
    object code changes intended.
    
    Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @gitster

    add description parameter to OPT__DRY_RUN

    René Scharfe authored gitster committed
    Allows better help text to be defined than "dry run".  Also make use
    of the macro in places that already had a different description.  No
    object code changes intended.
    
    Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  3. @gitster

    add description parameter to OPT__VERBOSE

    René Scharfe authored gitster committed
    Allows better help text to be defined than "be verbose".  Also make use
    of the macro in places that already had a different description.  No
    object code changes intended.
    
    Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Sep 29, 2009
  1. @andreas-schwab @spearce

    parse-opt: ignore negation of OPT_NONEG for ambiguity checks

    andreas-schwab authored spearce committed
    parse_long_opt always matches both --opt and --no-opt for any option
    "opt", and only get_value checks whether --no-opt is actually valid.
    Since the options for git branch contains both "no-merged" and "merged"
    there are two matches for --no-merge, but no exact match.  With this
    patch the negation of a NONEG option is rejected earlier, but it changes
    the error message from "option `no-opt' isn't available" to "unknown
    option `no-opt'".
    
    [jk: added test]
    
    Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Commits on Jun 21, 2009
  1. @torvalds @gitster

    Fix various sparse warnings in the git source code

    torvalds authored gitster committed
    There are a few remaining ones, but this fixes the trivial ones. It boils
    down to two main issues that sparse complains about:
    
     - warning: Using plain integer as NULL pointer
    
       Sparse doesn't like you using '0' instead of 'NULL'. For various good
       reasons, not the least of which is just the visual confusion. A NULL
       pointer is not an integer, and that whole "0 works as NULL" is a
       historical accident and not very pretty.
    
       A few of these remain: zlib is a total mess, and Z_NULL is just a 0.
       I didn't touch those.
    
     - warning: symbol 'xyz' was not declared. Should it be static?
    
       Sparse wants to see declarations for any functions you export. A lack
       of a declaration tends to mean that you should either add one, or you
       should mark the function 'static' to show that it's in file scope.
    
       A few of these remain: I only did the ones that should obviously just
       be made static.
    
    That 'wt_status_submodule_summary' one is debatable. It has a few related
    flags (like 'wt_status_use_color') which _are_ declared, and are used by
    builtin-commit.c. So maybe we'd like to export it at some point, but it's
    not declared now, and not used outside of that file, so 'static' it is in
    this patch.
    
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on May 25, 2009
  1. @bebarino @gitster

    parse-opts: add OPT_FILENAME and transition builtins

    bebarino authored gitster committed
    Commit dbd0f5c (Files given on the command line are relative to $cwd,
    2008-08-06) introduced parse_options_fix_filename() as a minimal fix.
    OPT_FILENAME is intended to be a more robust fix for the same issue.
    OPT_FILENAME and its associated enum OPTION_FILENAME are used to
    represent filename options within the parse options API.
    
    This option is similar to OPTION_STRING. If --no is prefixed to the
    option the filename is unset. If no argument is given and the default
    value is set, the filename is set to the default value. The difference
    is that the filename is prefixed with the prefix passed to
    parse_options() (or parse_options_start()).
    
    Update git-apply, git-commit, git-fmt-merge-msg, and git-tag to use
    OPT_FILENAME with their filename options. Also, rename
    parse_options_fix_filename() to fix_filename() as it is no longer
    extern.
    
    Signed-off-by: Stephen Boyd <bebarino@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @bebarino @gitster

    parse-opts: prepare for OPT_FILENAME

    bebarino authored gitster committed
    To give OPT_FILENAME the prefix, we pass the prefix to parse_options()
    which passes the prefix to parse_options_start() which sets the prefix
    member of parse_opts_ctx accordingly. If there isn't a prefix in the
    calling context, passing NULL will suffice.
    
    Signed-off-by: Stephen Boyd <bebarino@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on May 9, 2009
  1. @gitster

    parseopt: add PARSE_OPT_NODASH

    René Scharfe authored gitster committed
    Add support for options that don't start with a dash.  Initially, they
    don't accept arguments and can only be short options, i.e. consist of a
    single character.
    
    Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @gitster

    parseopt: add OPT_NUMBER_CALLBACK

    René Scharfe authored gitster committed
    Add a way to recognize numerical options.  The number is passed to
    a callback function as a string.
    
    Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  3. @gitster

    parseopt: add OPT_NEGBIT

    René Scharfe authored gitster committed
    Add OPTION_NEGBIT and OPT_NEGBIT, mirroring OPTION_BIT and OPT_BIT.
    OPT_NEGBIT can be used together with OPT_BIT to define two options
    that cancel each other out.
    
    Note: this patch removes the reminder from the test script because
    it adds a test for --no-or4 and there already was one for --or4.
    
    Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Aug 14, 2008
  1. @gitster

    test-parse-options: use appropriate cast in length_callback

    Brandon Casey authored gitster committed
    OPT_CALLBACK() is passed &integer which is now an "int" rather than
    "unsigned long". Update the length_callback function.
    
    Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jul 30, 2008
  1. @gitster

    Fix test-parse-options "integer" test

    gitster authored
    OPT_INTEGER() works on an integer, not on an unsigned long.  On a big
    endian architecture with long larger than int, integer test gives bogus
    results because of this bug.
    
    Reported by H.Merijn Brand in HP-UX 64-bit environment.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jun 23, 2008
  1. @sbeyer @gitster

    Extend parse-options test suite

    sbeyer authored gitster committed
    This patch serves two purposes:
     1. test-parse-option.c should be a more complete
        example for the parse-options API, and
     2. there have been no tests for OPT_CALLBACK,
        OPT_DATE, OPT_BIT, OPT_SET_INT and OPT_SET_PTR
        before.
    
    Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Mar 2, 2008
  1. @MadCoder @gitster

    parse-options: new option type to treat an option-like parameter as a…

    MadCoder authored gitster committed
    …n argument.
    
    This is meant to be used to keep --not and --all during revision parsing.
    
    Signed-off-by: Pierre Habouzit <madcoder@debian.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jan 26, 2008
  1. @MadCoder @gitster

    parse-options: catch likely typo in presense of aggregated options.

    MadCoder authored gitster committed
    If options are aggregated, and that the whole token is an exact
    prefix of a long option that is longer than 2 letters, reject
    it.  This is to prevent a common typo:
    
    	$ git commit -amend
    
    to get interpreted as "commit all with message 'end'".
    
    The typo check isn't performed if there is no aggregation,
    because the stuck form is the recommended one.  If we have `-o`
    being a valid short option that takes an argument, and --option
    a long one, then we _MUST_ accept -option as "'o' option with
    argument 'ption'", which is our official recommended form.
    
    Signed-off-by: Pierre Habouzit <madcoder@debian.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Nov 6, 2007
  1. @dscho @gitster

    parse-options: abbreviation engine fix.

    dscho authored gitster committed
    When an option could be an ambiguous abbreviation of two options, the code
    used to error out.  Even if an exact match would have occured later.
    
    Test and original patch by Pierre Habouzit.
    
    Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Oct 30, 2007
  1. @dscho @gitster

    Add tests for parse-options.c

    dscho authored gitster committed
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Something went wrong with that request. Please try again.