From 3b76150149757f9af0c04bef9131242ea0e920eb Mon Sep 17 00:00:00 2001 From: Jan Pokorný Date: Mon, 2 Dec 2013 19:25:10 +0100 Subject: Git config: add "ci" alias/modified checkout-index MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ý --- .gitconfig | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- cgit