From 2aef0bff3e1eb1f50f419403a62cc5bcc97f136c Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Thu, 19 Feb 2009 02:35:46 +0100 Subject: [PATCH] zit with command The syntax: $ zit with somefile foo bar is equivalent to launching 'foo bar' with GIT_DIR and GIT_WORK_TREE set up to somefile's zit/git context. --- zit | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/zit b/zit index 51f6fa6..44caeb5 100755 --- a/zit +++ b/zit @@ -35,6 +35,10 @@ zit_help() { echo "usage: zit view FILE" echo "Browse FILE's history with gitk" ;; + with) + echo "usage: zit with FILE COMMAND..." + echo "Run COMMAND after setting up the git environment for FILE." + ;; *) echo $USAGE echo "" @@ -48,6 +52,7 @@ zit_help() { echo " track Start tracking changes to FILE" echo " tracked List tracked files in current directory" echo " view Browse FILE's history with gitk" + echo " with Run a command in FILE's context" echo "" echo "See 'zit help git' or 'git help' for git commands." ;; @@ -168,6 +173,11 @@ case $cmd in shift gitk "$@" ;; + with) + zit_setup $1 + shift + "$@" + ;; # Most commands will work with the generic catch-all mechanism used # below, but some of them require a more thorough analysis of the # parameters to decide whether $ZIT_FILE should be put back into the -- 2.32.0.93.g670b81a890