1. 20 Mar, 2014 1 commit
  2. 17 May, 2013 1 commit
  3. 10 May, 2013 1 commit
    • Jeff King's avatar
      grep: allow to use textconv filters · 335ec3bf
      Jeff King authored
      Recently and not so recently, we made sure that log/grep type operations
      use textconv filters when a userfacing diff would do the same:
      ef90ab66 (pickaxe: use textconv for -S counting, 2012-10-28)
      b1c2f57d (diff_grep: use textconv buffers for add/deleted files, 2012-10-28)
      0508fe53 (combine-diff: respect textconv attributes, 2011-05-23)
      "git grep" currently does not use textconv filters at all, that is
      neither for displaying the match and context nor for the actual grepping,
      even when requested by --textconv.
      Introduce an option "--textconv" which makes git grep use any configured
      textconv filters for grepping and output purposes. It is off by default.
      Signed-off-by: default avatarJeff King <[email protected]>
      Signed-off-by: default avatarMichael J Gruber <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
  4. 01 Feb, 2013 1 commit
  5. 03 Aug, 2012 1 commit
    • J Smith's avatar
      grep: add a grep.patternType configuration setting · 84befcd0
      J Smith authored
      The grep.extendedRegexp configuration setting enables the -E flag on grep
      by default but there are no equivalents for the -G, -F and -P flags.
      Rather than adding an additional setting for grep.fooRegexp for current
      and future pattern matching options, add a grep.patternType setting that
      can accept appropriate values for modifying the default grep pattern
      matching behavior. The current values are "basic", "extended", "fixed",
      "perl" and "default" for setting -G, -E, -F, -P and the default behavior
      When grep.patternType is set to a value other than "default", the
      grep.extendedRegexp setting is ignored. The value of "default" restores
      the current default behavior, including the grep.extendedRegexp
      Signed-off-by: default avatarJ Smith <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
  6. 20 May, 2012 1 commit
  7. 26 Apr, 2012 1 commit
    • Jeff King's avatar
      docs: stop using asciidoc no-inline-literal · 6cf378f0
      Jeff King authored
      In asciidoc 7, backticks like `foo` produced a typographic
      effect, but did not otherwise affect the syntax. In asciidoc
      8, backticks introduce an "inline literal" inside which markup
      is not interpreted. To keep compatibility with existing
      documents, asciidoc 8 has a "no-inline-literal" attribute to
      keep the old behavior. We enabled this so that the
      documentation could be built on either version.
      It has been several years now, and asciidoc 7 is no longer
      in wide use. We can now decide whether or not we want
      inline literals on their own merits, which are:
        1. The source is much easier to read when the literal
           contains punctuation. You can use `master~1` instead
           of `master{tilde}1`.
        2. They are less error-prone. Because of point (1), we
           tend to make mistakes and forget the extra layer of
      This patch removes the no-inline-literal attribute from the
      Makefile and converts every use of backticks in the
      documentation to an inline literal (they must be cleaned up,
      or the example above would literally show "{tilde}" in the
      Problematic sites were found by grepping for '`.*[{\\]' and
      examined and fixed manually. The results were then verified
      by comparing the output of "html2text" on the set of
      generated html pages. Doing so revealed that in addition to
      making the source more readable, this patch fixes several
      formatting bugs:
        - HTML rendering used the ellipsis character instead of
          literal "..." in code examples (like "git log A...B")
        - some code examples used the right-arrow character
          instead of '->' because they failed to quote
        - api-config.txt did not quote tilde, and the resulting
          HTML contained a bogus snippet like:
            <tt><sub></tt> foo <tt></sub>bar</tt>
          which caused some parsers to choke and omit whole
          sections of the page.
        - git-commit.txt confused ``foo`` (backticks inside a
          literal) with ``foo'' (matched double-quotes)
        - mentions of `A U Thor <[email protected]>` used to
          erroneously auto-generate a mailto footnote for
          [email protected]
        - the description of --word-diff=plain incorrectly showed
          the output as "[-removed-] and {added}", not "{+added+}".
        - using "prime" notation like:
            commit `C` and its replacement `C'`
          confused asciidoc into thinking that everything between
          the first backtick and the final apostrophe were meant
          to be inside matched quotes
        - asciidoc got confused by the escaping of some of our
          asterisks. In particular,
            `credential.\*` and `credential.<url>.\*`
          properly escaped the asterisk in the first case, but
          literally passed through the backslash in the second
      Signed-off-by: default avatarJeff King <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
  8. 26 Mar, 2012 1 commit
  9. 15 Jan, 2012 1 commit
  10. 05 Oct, 2011 1 commit
    • Junio C Hamano's avatar
      grep: teach --untracked and --exclude-standard options · 0a93fb8a
      Junio C Hamano authored
      In a working tree of a git managed repository, "grep --untracked" would
      find the specified patterns from files in untracked files in addition to
      its usual behaviour of finding them in the tracked files.
      By default, when working with "--no-index" option, "grep" does not pay
      attention to .gitignore mechanism. "grep --no-index --exclude-standard"
      can be used to tell the command to use .gitignore and stop reporting hits
      from files that would be ignored. Also, when working without "--no-index",
      "grep" honors .gitignore mechanism, and "grep --no-exclude-standard" can
      be used to tell the command to include hits from files that are ignored.
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
  11. 04 Aug, 2011 1 commit
    • Jeff King's avatar
      docs: put listed example commands in backticks · 5d2fc913
      Jeff King authored
      Many examples of git command invocation are given in asciidoc listing
      blocks, which makes them monospaced and avoids further interpretation of
      special characters.  Some manpages make a list of examples, like:
        git foo::
          Run git foo.
        git foo -q::
          Use the "-q" option.
      to quickly show many variants. However, they can sometimes be hard to
      read, because they are shown in a proportional-width font (so, for
      example, seeing the difference between "-- foo" and "--foo" can be
      This patch puts all such examples into backticks, which gives the
      equivalent formatting to a listing block (i.e., monospaced and without
      character interpretation).
      As a bonus, this also fixes an example in the git-push manpage, in which
      "git push origin :::" was accidentally considered a newly-indented list,
      and not a list item with "git push origin :" in it.
      Signed-off-by: default avatarJeff King <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
  12. 01 Aug, 2011 2 commits
  13. 06 Jun, 2011 2 commits
  14. 09 May, 2011 1 commit
    • Michał Kiedrowicz's avatar
      git-grep: Learn PCRE · 63e7e9d8
      Michał Kiedrowicz authored
      This patch teaches git-grep the --perl-regexp/-P options (naming
      borrowed from GNU grep) in order to allow specifying PCRE regexes on the
      command line.
      PCRE has a number of features which make them more handy to use than
      POSIX regexes, like consistent escaping rules, extended character
      classes, ungreedy matching etc.
      git isn't build with PCRE support automatically. USE_LIBPCRE environment
      variable must be enabled (like `make USE_LIBPCRE=YesPlease`).
      Signed-off-by: default avatarMichał Kiedrowicz <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
  15. 05 May, 2011 1 commit
  16. 30 Mar, 2011 1 commit
    • Joe Ratterman's avatar
      grep: allow -E and -n to be turned on by default via configuration · b22520a3
      Joe Ratterman authored
      Add two configration variables grep.extendedRegexp and grep.lineNumbers to
      allow the user to skip typing -E and -n on the command line, respectively.
      Scripts that are meant to be used by random users and/or in random
      repositories now have use -G and/or --no-line-number options as
      appropriately to override the settings in the repository or user's
      ~/.gitconfig settings. Just because the script didn't say "git grep -n" no
      longer guarantees that the output from the command will not have line
      Signed-off-by: default avatarJoe Ratterman <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
  17. 28 Mar, 2011 1 commit
  18. 11 Mar, 2011 1 commit
    • Jeff King's avatar
      doc: drop author/documentation sections from most pages · 48bb914e
      Jeff King authored
      The point of these sections is generally to:
        1. Give credit where it is due.
        2. Give the reader an idea of where to ask questions or
           file bug reports.
      But they don't do a good job of either case. For (1), they
      are out of date and incomplete. A much more accurate answer
      can be gotten through shortlog or blame.  For (2), the
      correct contact point is generally [email protected], and even if you
      wanted to cc the contact point, the out-of-date and
      incomplete fields mean you're likely sending to somebody
      So let's drop the fields entirely from all manpages except
      git(1) itself. We already point people to the mailing list
      for bug reports there, and we can update the Authors section
      to give credit to the major contributors and point to
      shortlog and blame for more information.
      Each page has a "This is part of git" footer, so people can
      follow that to the main git manpage.
  19. 20 Aug, 2010 1 commit
  20. 25 Jun, 2010 1 commit
  21. 13 Jun, 2010 2 commits
  22. 26 Feb, 2010 4 commits
  23. 19 Feb, 2010 1 commit
    • Mark Lodato's avatar
      Add an optional argument for --color options · 73e9da01
      Mark Lodato authored
      Make git-branch, git-show-branch, git-grep, and all the diff-based
      programs accept an optional argument <when> for --color.  The argument
      is a colorbool: "always", "never", or "auto".  If no argument is given,
      "always" is used;  --no-color is an alias for --color=never.  This makes
      the command-line interface consistent with other GNU tools, such as `ls'
      and `grep', and with the git-config color options.  Note that, without
      an argument, --color and --no-color work exactly as before.
      To implement this, two internal changes were made:
      1. Allow the first argument of git_config_colorbool() to be NULL,
         in which case it returns -1 if the argument isn't "always", "never",
         or "auto".
      2. Add OPT_COLOR_FLAG(), OPT__COLOR(), and parse_opt_color_flag_cb()
         to the option parsing library.  The callback uses
         git_config_colorbool(), so color.h is now a dependency
         of parse-options.c.
      Signed-off-by: Mark Lodato's avatarMark Lodato <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
  24. 17 Feb, 2010 1 commit
  25. 28 Jan, 2010 1 commit
  26. 10 Jan, 2010 1 commit
    • Thomas Rast's avatar
      Documentation: spell 'git cmd' without dash throughout · 0b444cdb
      Thomas Rast authored
      The documentation was quite inconsistent when spelling 'git cmd' if it
      only refers to the program, not to some specific invocation syntax:
      both 'git-cmd' and 'git cmd' spellings exist.
      The current trend goes towards dashless forms, and there is precedent
      in 647ac702 (git-svn.txt: stop using dash-form of commands.,
      2009-07-07) to actively eliminate the dashed variants.
      Replace 'git-cmd' with 'git cmd' throughout, except where git-shell,
      git-cvsserver, git-upload-pack, git-receive-pack, and
      git-upload-archive are concerned, because those really live in the
  27. 23 Jul, 2009 1 commit
    • Michał Kiedrowicz's avatar
      grep: Add --max-depth option. · a91f453f
      Michał Kiedrowicz authored
      It is useful to grep directories non-recursively, e.g. when one wants to
      look for all files in the toplevel directory, but not in any subdirectory,
      or in Documentation/, but not in Documentation/technical/.
      This patch adds support for --max-depth <depth> option to git-grep. If it is
      given, git-grep descends at most <depth> levels of directories below paths
      specified on the command line.
      Note that if path specified on command line contains wildcards, this option
      makes no sense, e.g.
          $ git grep -l --max-depth 0 GNU -- 'contrib/*'
      (note the quotes) will search all files in contrib/, even in
      subdirectories, because '*' matches all files.
      Documentation updates, bash-completion and simple test cases are also
      Signed-off-by: default avatarMichał Kiedrowicz <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
  28. 02 Jul, 2009 2 commits
  29. 07 Mar, 2009 1 commit
    • René Scharfe's avatar
      grep: color patterns in output · 7e8f59d5
      René Scharfe authored
      Coloring matches makes them easier to spot in the output.
      Add two options and two parameters: color.grep (to turn coloring on
      or off), color.grep.match (to set the color of matches), --color
      and --no-color (to turn coloring on or off, respectively).
      The output of external greps is not changed.
      This patch is based on earlier ones by Nguyễn Thái Ngọc Duy and
      Thiago Alves.
      Signed-off-by: default avatarRene Scharfe <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
  30. 01 Oct, 2008 1 commit
  31. 05 Jul, 2008 1 commit
  32. 02 Jul, 2008 2 commits
    • Jonathan Nieder's avatar
      Documentation formatting and cleanup · 483bc4f0
      Jonathan Nieder authored
      Following what appears to be the predominant style, format
      names of commands and commandlines both as `teletype text`.
      While we're at it, add articles ("a" and "the") in some
      places, italicize the name of the command in the manual page
      synopsis line, and add a comma or two where it seems appropriate.
      Signed-off-by: default avatarJonathan Nieder <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
    • Jonathan Nieder's avatar
      Documentation: be consistent about "git-" versus "git " · b1889c36
      Jonathan Nieder authored
      Since the git-* commands are not installed in $(bindir), using
      "git-command <parameters>" in examples in the documentation is
      not a good idea. On the other hand, it is nice to be able to
      refer to each command using one hyphenated word. (There is no
      escaping it, anyway: man page names cannot have spaces in them.)
      This patch retains the dash in naming an operation, command,
      program, process, or action. Complete command lines that can
      be entered at a shell (i.e., without options omitted) are
      made to use the dashless form.
      The changes consist only of replacing some spaces with hyphens
      and vice versa. After a "s/ /-/g", the unpatched and patched
      versions are identical.
      Signed-off-by: default avatarJonathan Nieder <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>