1. 15 12月, 2010 1 次提交
    • P
      bash: get --pretty=m<tab> completion to work with bash v4 · da48616f
      Peter van der Does 提交于
      Bash's programmable completion provides the COMP_WORDS array variable,
      which holds the individual words in the current command line.  In bash
      versions prior to v4 "words are split on shell metacharacters as the
      shell parser would separate them" (quote from bash v3.2.48's man
      page).  This behavior has changed with bash v4, and the command line
      "is split into words as readline would split it, using COMP_WORDBREAKS
      as" "the set of characters that the readline library treats as word
      separators" (quote from bash v4's man page).
      
      Since COMP_WORDBREAKS contains the characters : and = by default, this
      behavior change in bash affects git's completion script.  For example,
      before bash 4, running
      
      	$ git log --pretty=m <tab><tab>
      
      would give a list of pretty-printing formats starting with 'm' but now
      it completes on branch names.
      
      It would be possible to work around this by removing '=' and ':' from
      COMP_WORDBREAKS, but as noticed in v1.5.6.4~9^2 (bash completion:
      Resolve git show ref:path<tab> losing ref: portion, 2008-07-15), that
      would break *other* completion scripts.  The bash-completion library
      includes a better workaround: the _get_comp_words_by_ref function
      re-assembles a copy of COMP_WORDS, excluding a collection of word
      separators of the caller's choice.  Use it.
      
      As a bonus, this also improves behavior when tab is pressed with the
      cursor in the middle of a word.
      
      To avoid breaking setups with the bash-completion library not already
      loaded, if the _get_comp_words_by_ref function is not defined then a
      shim that just reads COMP_WORDS will be used instead (no change from
      the current behavior in that case).
      Signed-off-by: NPeter van der Does <peter@avirtualhome.com>
      Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
      Explained-by: NSZEDER Gábor <szeder@ira.uka.de>
      da48616f
  2. 03 12月, 2010 3 次提交
  3. 02 12月, 2010 5 次提交
  4. 13 9月, 2010 1 次提交
  5. 12 9月, 2010 1 次提交
  6. 11 9月, 2010 1 次提交
  7. 10 9月, 2010 2 次提交
  8. 07 9月, 2010 2 次提交
  9. 06 9月, 2010 4 次提交
  10. 04 9月, 2010 2 次提交
  11. 02 9月, 2010 7 次提交
  12. 30 8月, 2010 2 次提交
  13. 27 8月, 2010 1 次提交
  14. 26 8月, 2010 2 次提交
    • E
      tree-walk: Correct bitrotted comment about tree_entry() · 2244eab0
      Elijah Newren 提交于
      There was a code comment that referred to the "above two functions" but
      over time the functions immediately preceding the comment have changed.
      Just mention the relevant functions by name.
      Signed-off-by: NElijah Newren <newren@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      2244eab0
    • L
      Fix 'git log' early pager startup error case · 1fda91b5
      Linus Torvalds 提交于
      We start the pager too early for several git commands, which results in
      the errors sometimes going to the pager rather than show up as errors.
      
      This is often hidden by the fact that we pass in '-X' to less by default,
      which causes 'less' to exit for small output, but if you do
      
        export LESS=-S
      
      you can then clearly see the problem by doing
      
        git log --prretty
      
      which shows the error message ("fatal: unrecognized argument: --prretty")
      being sent to the pager.
      
      This happens for pretty much all git commands that use USE_PAGER, and then
      check arguments separately. But "git diff" does it too early too (even
      though it does an explicit setup_pager() call)
      
      This only fixes it for the trivial "git log" family case.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      1fda91b5
  15. 25 8月, 2010 2 次提交
  16. 23 8月, 2010 1 次提交
  17. 22 8月, 2010 3 次提交