* [PATCH] git-grep.txt: add "git ack" alias to Examples section
@ 2013-09-25 13:49 Nguyễn Thái Ngọc Duy
0 siblings, 0 replies; only message in thread
From: Nguyễn Thái Ngọc Duy @ 2013-09-25 13:49 UTC (permalink / raw)
To: git; +Cc: René Scharfe, Nguyễn Thái Ngọc Duy
The alias was from René Scharfe's Google+ post [1]. For reference when
the Internet (or Google) is down:
While grep is an indispensable tool if you're working with text
files, some aspects of it could be improved. ack (or ack-grep, as
it's called on Debian) has a few nice ideas in this regard. I
especially like its presentation of search results from multiple
files, which leaves more space for the actual file contents.
And with the upcoming release 1.7.7 of git, its built-in grep
command can dress up like ack and show search results in that
nicer way, too. Run this (single line) command to add an alias
that you can call as "git ack" ...
[1] https://plus.google.com/104164106444631459594/posts
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
One of the few things I like about Clearcase is the examples section
in their man pages, which contain very practical and often used
commands. So I'd like to do the same way to git: start adding
examples that are useful, not just ones that demonstrate difficult
concepts or use cases.
Those often used commands are likely popular aliases on the Internet.
The next one that comes to mind after "git ack" is "git lol". We
probably won't add them all. Certain concensus is needed to keep
examples from becoming a encyclopedia.
Good or bad move?
Documentation/git-grep.txt | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt
index 8497aa4..a4881e5 100644
--- a/Documentation/git-grep.txt
+++ b/Documentation/git-grep.txt
@@ -269,6 +269,12 @@ Examples
Looks for a line that has `NODE` or `Unexpected` in
files that have lines that match both.
+`git -c color.grep.filename='bold green' -c color.grep.match='black yellow' grep --break --heading -n pattern`::
+ Searches for `pattern` and produces output similar to ack(1).
+ Alternatively you could add an alias for frequent use:
++
+`git config --global --add alias.ack "-c color.grep.filename='bold green' -c color.grep.match='black yellow' grep --break --heading -n"`
+
GIT
---
Part of the linkgit:git[1] suite
--
1.8.2.83.gc99314b
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-09-25 13:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-25 13:49 [PATCH] git-grep.txt: add "git ack" alias to Examples section Nguyễn Thái Ngọc Duy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).