From 59f77488e57435243f935ad098823e7959d2729a Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Fri, 13 Feb 2009 18:08:36 +0100 Subject: [PATCH] tigrc(5): suggest git aliases for external commands requiring shell ops --- NEWS | 2 +- tigrc.5.txt | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 7bd2889..e374662 100644 --- a/NEWS +++ b/NEWS @@ -71,7 +71,7 @@ Incompatibilities: - Commands from the environment (e.g. TIG_MAIN_CMD) will no longer have access to shell features, such as subshells and variable expansion. The easiest way to upgrade your configuration is to put such commands - in a script file. + in a script file or as a git alias. Improvements: diff --git a/tigrc.5.txt b/tigrc.5.txt index 59149ac..a633e83 100644 --- a/tigrc.5.txt +++ b/tigrc.5.txt @@ -221,7 +221,20 @@ Browsing state variables ------------------------------------------------------------------------------ As an example, the following external command will save the current commit as -a patch file: "!git format-patch -1 %(commit)". +a patch file: "!git format-patch -1 %(commit)". If your external command +require use of dynamic features, such as subshells, expansion of environment +variables and process control, this can be achieved by using a combination of +git aliases and tig external commands. The following example entries can be +put in either the .gitconfig or .git/config file: + +-------------------------------------------------------------------------- +[alias] + gitk-bg = !"gitk HEAD --not $(git rev-parse --remotes) &" + publish = !"for i in origin public; do git push $i; done" +[tig "bind"] + generic = V !git gitk-bg + generic = > !git publish +-------------------------------------------------------------------------- ifdef::backend-xhtml11[] [frame="none"] -- 2.30.2