summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2013-12-02 19:25:10 +0100
committerJan Pokorný <jpokorny@redhat.com>2013-12-02 19:28:48 +0100
commit3b76150149757f9af0c04bef9131242ea0e920eb (patch)
treeb1d563659ac16761a0b195adbacba893f94d7211
parentfd3fe39fd09e24dfe0dfb8cc097f7d76f01ad1d8 (diff)
downloaddotfiles-3b76150149757f9af0c04bef9131242ea0e920eb.tar.gz
dotfiles-3b76150149757f9af0c04bef9131242ea0e920eb.tar.xz
dotfiles-3b76150149757f9af0c04bef9131242ea0e920eb.zip
Git config: add "ci" alias/modified checkout-indexf18
Superhandy in case on convoluted patchset regarding the same file, which is being reversed-engineered from a bulk change and one wants to retest each isolated changeset for not breaking expectations... (at least in the case that such properties can be investigated solely on this file, without the context that may refer to it, otherwise the whole tree has to be somehow exported elsewhere) Note the "${@/#/$GIT_PREFIX}" trick that should probably be applied for all bang-aliases. Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
-rw-r--r--.gitconfig6
1 files changed, 6 insertions, 0 deletions
diff --git a/.gitconfig b/.gitconfig
index 6d107db..dcff481 100644
--- a/.gitconfig
+++ b/.gitconfig
@@ -5,6 +5,12 @@
[alias]
ai = add -ip
c = commit -s
+ ci = "!git_ci() {\
+ git checkout-index --temp -- \"${@/#/$GIT_PREFIX}\"\
+ | xargs -I {} sh -c '_do() {\
+ mv \"$1\" \"${GIT_PREFIX}.checkout-$(basename \"$2\")\";\
+ }; _do {}';\
+ }; git_ci"
g = log --grep
gg = log -p --grep
dh = diff HEAD