summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2014-08-20 21:35:44 +0200
committerJan Pokorný <jpokorny@redhat.com>2014-08-20 21:35:44 +0200
commit72f962e08f73f1f8467f2ea62358bd5b89981dc2 (patch)
tree9b2d06cab0e513724e2acffeb35d2feb55dca731
parentadc61a8e1814f73ae61bd79eb2ddd0c821f7de1c (diff)
downloaddotfiles-72f962e08f73f1f8467f2ea62358bd5b89981dc2.tar.gz
dotfiles-72f962e08f73f1f8467f2ea62358bd5b89981dc2.tar.xz
dotfiles-72f962e08f73f1f8467f2ea62358bd5b89981dc2.zip
Git config: ack alias = "grep" tracked files first
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
-rw-r--r--.bashrc2
-rw-r--r--.gitconfig6
2 files changed, 7 insertions, 1 deletions
diff --git a/.bashrc b/.bashrc
index 4ef95e0..1bddb89 100644
--- a/.bashrc
+++ b/.bashrc
@@ -83,7 +83,7 @@ PS1='\[\033[01;34m\]\u@\h\[\033[00m\]:\[\033[01;36m\]\w\[\033[00m\]\[\033[$(
printf "${_ps_lpar}${_ps_head}%0.2x${_ps_rpar}" "${_ps_ret}"; }
)$\[\033[00m\] '
-ACK=ack
+export ACK=ack
test "$(ack --version | head -n1 | sed 's|^ack\s\([0-9]\+\).*|\1|')" -ge 2 \
|| ACK+=" -a"
diff --git a/.gitconfig b/.gitconfig
index fc32066..96c4a5a 100644
--- a/.gitconfig
+++ b/.gitconfig
@@ -56,6 +56,12 @@
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' \
--abbrev-commit --date=relative
+ ack = "!git_ack() {\
+ git ls-files 2>/dev/null\
+ | ${ACK:-ack} --files-from - \"$@\" 2>/dev/null\
+ || ${ACK:-ack} \"$@\";\
+ }; git_ack"
+
[core]
editor = vim