Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: git/git
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 110240588d
Choose a base ref
...
head repository: git/git
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f22f682695
Choose a head ref
  • 13 commits
  • 39 files changed
  • 2 contributors

Commits on May 29, 2018

  1. Merge branch 'nd/command-list' into nd/complete-config-vars

    * nd/command-list:
      completion: allow to customize the completable command list
      completion: add and use --list-cmds=alias
      completion: add and use --list-cmds=nohelpers
      Move declaration for alias.c to alias.h
      completion: reduce completable command list
      completion: let git provide the completable command list
      command-list.txt: documentation and guide line
      help: use command-list.txt for the source of guides
      help: add "-a --verbose" to list all commands with synopsis
      git: support --list-cmds=list-<category>
      completion: implement and use --list-cmds=main,others
      git --list-cmds: collect command list in a string_list
      git.c: convert --list-* to --list-cmds=*
      Remove common-cmds.h
      help: use command-list.h for common command list
      generate-cmds.sh: export all commands to command-list.h
      generate-cmds.sh: factor out synopsis extract code
    gitster committed May 29, 2018
    Configuration menu
    Copy the full SHA
    17b3e51 View commit details
    Browse the repository at this point in the history
  2. Add and use generic name->id mapping code for color slot parsing

    Instead of hard coding the name-to-id mapping in C code, keep it in an
    array and use a common function to do the parsing. This reduces code
    and also allows us to list all possible color slots later.
    
    This starts using C99 designated initializers more for convenience
    (the first designated initializers have been introduced in builtin/clean.c
    for some time without complaints)
    
    Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    pclouds authored and gitster committed May 29, 2018
    Configuration menu
    Copy the full SHA
    a73b368 View commit details
    Browse the repository at this point in the history
  3. grep: keep all colors in an array

    This is more inline with how we handle color slots in other code. It
    also allows us to get the list of configurable color slots later.
    
    Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    pclouds authored and gitster committed May 29, 2018
    Configuration menu
    Copy the full SHA
    fa151dc View commit details
    Browse the repository at this point in the history
  4. fsck: factor out msg_id_info[] lazy initialization code

    This array will be used by some other function than parse_msg_id() in
    the following commit. Factor out this prep code so it could be called
    from that one.
    
    Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    pclouds authored and gitster committed May 29, 2018
    Configuration menu
    Copy the full SHA
    a46baac View commit details
    Browse the repository at this point in the history
  5. help: add --config to list all available config

    Sometimes it helps to list all available config vars so the user can
    search for something they want. The config man page can also be used
    but it's harder to search if you want to focus on the variable name,
    for example.
    
    This is not the best way to collect the available config since it's
    not precise. Ideally we should have a centralized list of config in C
    code (pretty much like 'struct option'), but that's a lot more work.
    This will do for now.
    
    Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    pclouds authored and gitster committed May 29, 2018
    Configuration menu
    Copy the full SHA
    3ac68a9 View commit details
    Browse the repository at this point in the history
  6. fsck: produce camelCase config key names

    Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    pclouds authored and gitster committed May 29, 2018
    Configuration menu
    Copy the full SHA
    a4a9cc1 View commit details
    Browse the repository at this point in the history
  7. advice: keep config name in camelCase in advice_config[]

    For parsing, we don't really need this because the main config parser
    will lowercase everything so we can do exact matching. But this array
    now is also used for printing in `git help --config`. Keep camelCase
    so we have a nice printout.
    
    Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    pclouds authored and gitster committed May 29, 2018
    Configuration menu
    Copy the full SHA
    fb6fbff View commit details
    Browse the repository at this point in the history
  8. am: move advice.amWorkDir parsing back to advice.c

    The only benefit from this move (apart from cleaner code) is that
    advice.amWorkDir should now show up in `git help --config`. There
    should be no regression since advice config is always read by the
    git_default_config().
    
    While at there, use advise() like other code. We now get "hint: "
    prefix and the output is stderr instead of stdout (which is also the
    reason for the test update because stderr is checked in a following
    test and the extra advice can fail it).
    
    Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    pclouds authored and gitster committed May 29, 2018
    Configuration menu
    Copy the full SHA
    431bb23 View commit details
    Browse the repository at this point in the history
  9. completion: drop the hard coded list of config vars

    The new help option --config-for-completion is a machine friendlier
    version of --config where all the placeholders and wildcards are
    dropped, leaving only the good, completable prefixes for
    git-completion.bash to consume.
    
    Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    pclouds authored and gitster committed May 29, 2018
    1 Configuration menu
    Copy the full SHA
    e17ca92 View commit details
    Browse the repository at this point in the history
  10. completion: keep other config var completion in camelCase

    The last patch makes "git config <tab>" shows camelCase names because
    that's what's in the source: config.txt. There are still a couple
    manual var completion in this code. Let's make them follow the naming
    convention as well.
    
    In theory we could automate this part too because we have the
    information. But let's stick to one step at a time and leave this for
    later.
    
    Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    pclouds authored and gitster committed May 29, 2018
    Configuration menu
    Copy the full SHA
    f45db83 View commit details
    Browse the repository at this point in the history
  11. completion: support case-insensitive config vars

    Config variables are case-insensitive but this case/esac construct is
    case-sensitive by default. For bash v4, it'll be easy. For platforms
    that are stuck with older versions, we need an external command, but
    that is not that critical. And where this additional overhead matters
    the most is Windows, but luckily Git for Windows ships with Bash v4.
    
    Helped-by: SZEDER Gábor <[email protected]>
    Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    pclouds authored and gitster committed May 29, 2018
    Configuration menu
    Copy the full SHA
    bea2125 View commit details
    Browse the repository at this point in the history
  12. log-tree: allow to customize 'grafted' color

    Commit 76f5df3 (log: decorate grafted commits with "grafted" -
    2011-08-18) lets us decorate grafted commits but I forgot about the
    color.decorate.* config.
    
    Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    pclouds authored and gitster committed May 29, 2018
    Configuration menu
    Copy the full SHA
    09c4ba4 View commit details
    Browse the repository at this point in the history
  13. completion: complete general config vars in two steps

    There are 581 config variables as of now when you do "git config
    <tab>" which can fill up a few screens and is not very helpful when
    you have to look through columns of text to find what you want.
    
    This patch instead shows you only first level when you do
    
        git config <tab>
    
    There are 78 items, which use up 8 rows in my screen. Compared to
    screens of text, it's pretty good. Once you have chosen you first
    level, e.g. color:
    
        git config color.<tab>
    
    will show you all color.*
    
    This is not a new idea. branch.* and remote.* completion already does
    this for second and third levels. For those variables, you'll need to
    <tab> three times to get full variable name.
    
    Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]>
    Signed-off-by: Junio C Hamano <[email protected]>
    pclouds authored and gitster committed May 29, 2018
    Configuration menu
    Copy the full SHA
    f22f682 View commit details
    Browse the repository at this point in the history
Loading