{"thread":{"id":"35017","subject":"[PATCH] git-grep.txt: add \"git ack\" alias to Examples section","startedAt":"2013-09-25T13:49:16Z","lastAt":"2013-09-25T13:49:16Z","messageCount":1,"participants":["Nguyễn Thái Ngọc Duy"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"228205","messageId":"1380116956-12091-1-git-send-email-pclouds@gmail.com","threadId":"35017","inReplyTo":null,"subject":"[PATCH] git-grep.txt: add \"git ack\" alias to Examples section","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2013-09-25T13:49:16Z","receivedAt":"2013-09-25T13:49:16Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"The alias was from René Scharfe's Google+ post [1]. For reference when\nthe Internet (or Google) is down:\n\n    While grep is an indispensable tool if you're working with text\n    files, some aspects of it could be improved. ack (or ack-grep, as\n    it's called on Debian) has a few nice ideas in this regard. I\n    especially like its presentation of search results from multiple\n    files, which leaves more space for the actual file contents.\n\n    And with the upcoming release 1.7.7 of git, its built-in grep\n    command can dress up like ack and show search results in that\n    nicer way, too. Run this (single line) command to add an alias\n    that you can call as \"git ack\" ...\n\n[1] https://plus.google.com/104164106444631459594/posts\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n One of the few things I like about Clearcase is the examples section\n in their man pages, which contain very practical and often used\n commands. So I'd like to do the same way to git: start adding\n examples that are useful, not just ones that demonstrate difficult\n concepts or use cases.\n \n Those often used commands are likely popular aliases on the Internet.\n The next one that comes to mind after \"git ack\" is \"git lol\". We\n probably won't add them all. Certain concensus is needed to keep\n examples from becoming a encyclopedia.\n\n Good or bad move?\n\n Documentation/git-grep.txt | 6 ++++++\n 1 file changed, 6 insertions(+)\n\ndiff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt\nindex 8497aa4..a4881e5 100644\n--- a/Documentation/git-grep.txt\n+++ b/Documentation/git-grep.txt\n@@ -269,6 +269,12 @@ Examples\n \tLooks for a line that has `NODE` or `Unexpected` in\n \tfiles that have lines that match both.\n \n+`git -c color.grep.filename='bold green' -c color.grep.match='black yellow' grep --break --heading -n pattern`::\n+\tSearches for `pattern` and produces output similar to ack(1).\n+\tAlternatively you could add an alias for frequent use:\n++\n+`git config --global --add alias.ack \"-c color.grep.filename='bold green' -c color.grep.match='black yellow' grep --break --heading -n\"`\n+\n GIT\n ---\n Part of the linkgit:git[1] suite\n-- \n1.8.2.83.gc99314b\n"}]}