1. 26 3月, 2018 6 次提交
  2. 24 3月, 2018 1 次提交
  3. 23 3月, 2018 1 次提交
    • S
      completion: clear cached --options when sourcing the completion script · 8b0eaa41
      SZEDER Gábor 提交于
      The established way to update the completion script in an already
      running shell is to simply source it again: this brings in any new
      --options and features, and clears caching variables.  E.g. it clears
      the variables caching the list of (all|porcelain) git commands, so
      when they are later lazy-initialized again, then they will list and
      cache any newly installed commmands as well.
      
      Unfortunately, since d401f3de (git-completion.bash: introduce
      __gitcomp_builtin, 2018-02-09) and subsequent patches this doesn't
      work for a lot of git commands' options.  To eliminate a lot of
      hard-to-maintain hard-coded lists of options, those commits changed
      the completion script to use a bunch of programmatically created and
      lazy-initialized variables to cache the options of those builtin
      porcelain commands that use parse-options.  These variables are not
      cleared upon sourcing the completion script, therefore they continue
      caching the old lists of options, even when some commands recently
      learned new options or when deprecated options were removed.
      
      Always 'unset' these variables caching the options of builtin commands
      when sourcing the completion script.
      
      Redirect 'unset's stderr to /dev/null, because ZSH's 'unset' complains
      if it's invoked without any arguments, i.e. no variables caching
      builtin's options are set.  This can happen, if someone were to source
      the completion script twice without completing any --options in
      between.  Bash stays silent in this case.
      
      Add tests to ensure that these variables are indeed cleared when the
      completion script is sourced; not just the variables caching options,
      but all other caching variables, i.e. the variables caching commands,
      porcelain commands and merge strategies as well.
      Signed-off-by: NSZEDER Gábor <szeder.dev@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8b0eaa41
  4. 08 3月, 2018 4 次提交
  5. 10 2月, 2018 28 次提交