Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Jan 28, 2009
  1. Make opt_parse_with_commit() non-static

    Jake Goulding authored committed
    Moving opt_parse_with_commit() from branch to a common location, in
    preparation for using it in tag. Rename it to match naming convention
    of other option parsing functions.
    
    Signed-off-by: Jake Goulding <goulding@vivisimo.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Nov 15, 2008
  1. @tuncer

    Teach/Fix pull/fetch -q/-v options

    tuncer authored committed
    Implement git-pull --quiet and git-pull --verbose by
    adding the options to git-pull and fixing verbosity
    handling in git-fetch.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Aug 6, 2008
  1. Sync with 1.5.6.5

    authored
  2. Files given on the command line are relative to $cwd

    authored
    When running "git commit -F file" and "git tag -F file" from a
    subdirectory, we should take it as relative to the directory we started
    from, not relative to the top-level directory.
    
    This adds a helper function "parse_options_fix_filename()" to make it more
    convenient to fix this class of issues.  Ideally, parse_options() should
    support a new type of option, "OPT_FILENAME", to do this uniformly, but
    this patch is meant to go to 'maint' to fix it minimally.
    
    One thing to note is that value for "commit template file" that comes from
    the command line is taken as relative to $cwd just like other parameters,
    but when it comes from the configuration varilable 'commit.template', it
    is taken as relative to the working tree root as before.  I think this
    difference actually is sensible (not that I particularly think
    commit.template itself is sensible).
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jul 22, 2008
  1. parse-options: fix segmentation fault when a required value is missing

    Olivier Marin authored committed
    p->argc represent the number of arguments that have not been parsed yet,
    _including_ the one we are currently parsing. If it is not greater than
    one then there is no more argument.
    
    Signed-off-by: Olivier Marin <dkr@freesurf.fr>
    Acked-by: Pierre Habouzit <madcoder@debian.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jul 16, 2008
  1. parse-options.c: make check_typos() static

    Nanako Shiraishi authored committed
    This function is not used by any other file.
    
    Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. Merge branch 'mv/merge-in-c'

    authored
    * mv/merge-in-c:
      reduce_heads(): protect from duplicate input
      reduce_heads(): thinkofix
      Add a new test for git-merge-resolve
      t6021: add a new test for git-merge-resolve
      Teach merge.log to "git-merge" again
      Build in merge
      Fix t7601-merge-pull-config.sh on AIX
      git-commit-tree: make it usable from other builtins
      Add new test case to ensure git-merge prepends the custom merge message
      Add new test case to ensure git-merge reduces octopus parents when possible
      Introduce reduce_heads()
      Introduce get_merge_bases_many()
      Add new test to ensure git-merge handles more than 25 refs.
      Introduce get_octopus_merge_bases() in commit.c
      git-fmt-merge-msg: make it usable from other builtins
      Move read_cache_unmerged() to read-cache.c
      Add new test to ensure git-merge handles pull.twohead and pull.octopus
      Move parse-options's skip_prefix() to git-compat-util.h
      Move commit_list_count() to commit.c
      Move split_cmdline() to alias.c
    
    Conflicts:
    	Makefile
    	parse-options.c
Commits on Jul 9, 2008
  1. @MadCoder

    parse-options: add PARSE_OPT_LASTARG_DEFAULT flag

    MadCoder authored committed
    If you set this for a given option, and the optoin appears without an
    argument on the command line, then the `defval' is used as its argument.
    
    Note that this flag is meaningless in presence of OPTARG or NOARG flags.
    (in the current implementation it will be ignored, but don't rely on it).
    
    Signed-off-by: Pierre Habouzit <madcoder@debian.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jul 1, 2008
  1. Move parse-options's skip_prefix() to git-compat-util.h

    Miklos Vajna authored committed
    builtin-remote.c and parse-options.c both have a skip_prefix() function,
    for the same purpose. Move parse-options's one to git-compat-util.h and
    let builtin-remote use it as well.
    
    Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jun 30, 2008
  1. @MadCoder

    parse-opt: add PARSE_OPT_KEEP_ARGV0 parser option.

    MadCoder authored committed
    This way, argv[0] isn't clobbered when parse-options filters argv[].
    
    Signed-off-by: Pierre Habouzit <madcoder@debian.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. @MadCoder

    parse-opt: fake short strings for callers to believe in.

    MadCoder authored committed
    If we begin to parse -abc and that the parser knew about -a and -b, it
    will fake a -c switch for the caller to deal with.
    
    Of course in the case of -acb (supposing -c is not taking an argument) the
    caller will have to be especially clever to do the same thing. We could
    think about exposing an API to do so if it's really needed, but oh well...
    
    Signed-off-by: Pierre Habouzit <madcoder@debian.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  3. @MadCoder

    parse-opt: do not print errors on unknown options, return -2 intead.

    MadCoder authored committed
    This way we can catch "unknown" options more easily.
    
    Signed-off-by: Pierre Habouzit <madcoder@debian.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  4. @MadCoder

    parse-opt: create parse_options_step.

    MadCoder authored committed
    For now it's unable to stop at unknown options, this commit merely
    reorganize some code around.
    
    Signed-off-by: Pierre Habouzit <madcoder@debian.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  5. @MadCoder

    parse-opt: Export a non NORETURN usage dumper.

    MadCoder authored committed
    Signed-off-by: Pierre Habouzit <madcoder@debian.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  6. @MadCoder

    parse-opt: have parse_options_{start,end}.

    MadCoder authored committed
    Make the struct optparse_t public under the better name parse_opt_ctx_t.
    
    Signed-off-by: Pierre Habouzit <madcoder@debian.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jun 23, 2008
  1. Merge branch 'maint'

    authored
    * maint:
      Extend parse-options test suite
      api-parse-options.txt: Introduce documentation for parse options API
      parse-options.c: fix documentation syntax of optional arguments
      api-builtin.txt: update and fix typo
  2. parse-options.c: fix documentation syntax of optional arguments

    Michele Ballabio authored committed
    When an argument for an option is optional, short options don't need a
    space between the option and the argument, and long options need a "=".
    Otherwise, arguments are misinterpreted.
    
    Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jun 14, 2008
  1. @peff

    avoid whitespace on empty line in automatic usage message

    peff authored committed
    When outputting a usage message with a blank line in the
    header, we would output a line with four spaces. Make this
    truly a blank line.
    
    This helps us remove trailing whitespace from a test vector.
    
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Apr 10, 2008
  1. Merge branch 'maint-1.5.4' into maint

    authored
    * maint-1.5.4:
      core-tutorial.txt: Fix showing the current behaviour.
      git-archive: ignore prefix when checking file attribute
      Fix documentation syntax of optional arguments in short options.
  2. @jasampler

    Fix documentation syntax of optional arguments in short options.

    jasampler authored committed
    When an argument for an option is optional, like in -n from git-tag,
    puting a space between the option and the argument is interpreted
    as a missing argument for the option plus an isolated argument.
    Documentation now reflects the need to write the parameter following
    the option -n, as in "git tag -nARG", for instance.
    
    Signed-off-by: Carlos Rica <jasampler@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Mar 27, 2008
  1. parse-options.c: introduce OPT_DATE

    Michele Ballabio authored committed
    There are quite a few places that will need to call approxidate(),
    when they'll adopt the parse-options system, so this patch adds the
    function parse_opt_approxidate_cb(), used by OPT_DATE.
    
    Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Mar 12, 2008
  1. Merge branch 'js/remote'

    authored
    * js/remote:
      "remote update": print remote name being fetched from
      builtin remote rm: remove symbolic refs, too
      remote: fix "update [group...]"
      remote show: Clean up connection correctly if object fetch wasn't done
      builtin-remote: prune remotes correctly that were added with --mirror
      Make git-remote a builtin
      Test "git remote show" and "git remote prune"
      parseopt: add flag to stop on first non option
      path-list: add functions to work with unsorted lists
    
    Conflicts:
    
    	parse-options.c
Commits on Mar 2, 2008
  1. @MadCoder

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

    MadCoder authored 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 Mar 1, 2008
  1. @dscho

    parseopt: add flag to stop on first non option

    dscho authored committed
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jan 26, 2008
  1. @MadCoder

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

    MadCoder authored 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 Dec 22, 2007
  1. @MadCoder

    Force the sticked form for options with optional arguments.

    MadCoder authored committed
    This forbids "git tag -n <number> -l" we allowed earlier, so
    adjust t7004 while at it.
    
    Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Commits on Nov 23, 2007
  1. @MadCoder

    parse-options: Allow to hide options from the default usage.

    MadCoder authored committed
    This is useful for backward-compatibility aliases, or very advanced command
    line switches introduced for internal git usages and have no real use for a
    user.
    
    parse-options still shows them if the user asks for --help-all.
    
    Signed-off-by: Pierre Habouzit <madcoder@debian.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Nov 12, 2007
  1. @MadCoder

    parse-options new features.

    MadCoder authored committed
    options flags:
    ~~~~~~~~~~~~~
      PARSE_OPT_NONEG allow the caller to disallow the negated option to exists.
    
    option types:
    ~~~~~~~~~~~~
      OPTION_BIT: ORs (or NANDs) a mask.
      OPTION_SET_INT: force the value to be set to this integer.
      OPTION_SET_PTR: force the value to be set to this pointer.
    
    helper:
    ~~~~~~
      HAS_MULTI_BITS (in git-compat-util.h) is a bit-hack to check if an
      unsigned integer has more than one bit set, useful to check if conflicting
      options have been used.
    
    Signed-off-by: Pierre Habouzit <madcoder@debian.org>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Nov 6, 2007
  1. @dscho

    parse-options: abbreviation engine fix.

    dscho authored 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. @MadCoder

    parse-options: allow callbacks to take no arguments at all.

    MadCoder authored committed
    Signed-off-by: Pierre Habouzit <madcoder@debian.org>
    Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
  2. @dscho

    parse-options: Allow abbreviated options when unambiguous

    dscho authored committed
    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".
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
  3. @MadCoder

    Add shortcuts for very often used options.

    MadCoder authored committed
    It helps with consistency of the help strings, for example.
    
    Signed-off-by: Pierre Habouzit <madcoder@debian.org>
    Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
  4. @MadCoder

    parse-options: make some arguments optional, add callbacks.

    MadCoder authored committed
    * add the possibility to use callbacks to parse some options, this can
      help implementing new options kinds with great flexibility. struct option
      gains a callback pointer and a `defval' where callbacks user can put
      either integers or pointers. callbacks also can use the `value' pointer
      for anything, preferably to the pointer to the final storage for the value
      though.
    
    * add a `flag' member to struct option to make explicit that this option may
      have an optional argument. The semantics depends on the option type. For
      INTEGERS, it means that if the switch is not used in its
      --long-form=<value> form, and that there is no token after it or that the
      token does not starts with a digit, then it's assumed that the switch has
      no argument. For STRING or CALLBACK it works the same, except that the
      condition is that the next atom starts with a dash. This is needed to
      implement backward compatible behaviour with existing ways to parse the
      command line. Its use for new options is discouraged.
    
    Signed-off-by: Pierre Habouzit <madcoder@debian.org>
    Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
  5. @raalkml

    Rework make_usage to print the usage message immediately

    raalkml authored committed
    Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
    Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
  6. @MadCoder

    parse-options: be able to generate usages automatically

    MadCoder authored committed
    Signed-off-by: Pierre Habouzit <madcoder@debian.org>
    Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Something went wrong with that request. Please try again.