Merge branch 'mk/grep-max-depth'
authorJunio C Hamano <gitster@pobox.com>
Tue, 11 Aug 2009 05:15:12 +0000 (22:15 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 11 Aug 2009 05:15:12 +0000 (22:15 -0700)
* mk/grep-max-depth:
grep: Add --max-depth option.

1  2 
contrib/completion/git-completion.bash
index 745b5fb78be02086d7d94aaaeaa40930150430f9,fb05c4884c67158a160cb77a5be3e42767c0f0db..5543dc4d14e22b065cbc41ed8af0f695c0464152
  #       GIT_PS1_SHOWSTASHSTATE to a nonempty value. If something is stashed,
  #       then a '$' will be shown next to the branch name.
  #
 +#       If you would like to see if there're untracked files, then you can
 +#       set GIT_PS1_SHOWUNTRACKEDFILES to a nonempty value. If there're
 +#       untracked files, then a '%' will be shown next to the branch name.
 +#
  # To submit patches:
  #
  #    *) Read Documentation/SubmittingPatches
@@@ -136,7 -132,6 +136,7 @@@ __git_ps1 (
                local w
                local i
                local s
 +              local u
                local c
  
                if [ "true" = "$(git rev-parse --is-inside-git-dir 2>/dev/null)" ]; then
                        if [ -n "${GIT_PS1_SHOWSTASHSTATE-}" ]; then
                                git rev-parse --verify refs/stash >/dev/null 2>&1 && s="$"
                        fi
 +
 +                      if [ -n "${GIT_PS1_SHOWUNTRACKEDFILES-}" ]; then
 +                         if [ -n "$(git ls-files --others --exclude-standard)" ]; then
 +                            u="%"
 +                         fi
 +                      fi
                fi
  
                if [ -n "${1-}" ]; then
 -                      printf "$1" "$c${b##refs/heads/}$w$i$s$r"
 +                      printf "$1" "$c${b##refs/heads/}$w$i$s$u$r"
                else
 -                      printf " (%s)" "$c${b##refs/heads/}$w$i$s$r"
 +                      printf " (%s)" "$c${b##refs/heads/}$w$i$s$u$r"
                fi
        fi
  }
@@@ -1047,6 -1036,7 +1047,7 @@@ _git_grep (
                        --extended-regexp --basic-regexp --fixed-strings
                        --files-with-matches --name-only
                        --files-without-match
+                       --max-depth
                        --count
                        --and --or --not --all-match
                        "