Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Jun 21, 2009
  1. Linus Torvalds Junio C Hamano

    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. Stephen Boyd Junio C Hamano

    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. Stephen Boyd Junio C Hamano

    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. Junio C Hamano

    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. Junio C Hamano

    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. Junio C Hamano

    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. Junio C Hamano

    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. Junio C Hamano

    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. Stephan Beyer Junio C Hamano

    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. Pierre Habouzit Junio C Hamano

    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. Pierre Habouzit Junio C Hamano

    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 Junio C Hamano

    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 Junio C Hamano

    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.