Signed-off-by: Yann Dirson <ydirson@altern.org>
---
Here is a small helper script implementing the display of current/named/all
stgit stacks (or standard branches) in gitk. As noted earlier, that does not
allow to see new refs by requesting an update from gitk, but it will still be
useful to me at least :)
contrib/stg-gitk | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 59 insertions(+), 0 deletions(-)
diff --git a/contrib/stg-gitk b/contrib/stg-gitk
new file mode 100755
index 0000000..8d4ae43
--- /dev/null
+++ b/contrib/stg-gitk
@@ -0,0 +1,59 @@
+#!/bin/sh
+set -e
+
+# stg-gitk - helper script to graphically display an StGIT stack
+
+# Allows quick synchronization of a cvs mirror branch (does not try to
+# reconstruct patchsets, creates "jumbo" commits), and commits stgit
+# patches to CVS.
+
+# LIMITATIONS:
+# - asking gitk to "update" won't detect any new ref
+# - no support for spaces in branch names
+
+# Copyright (c) 2007 Yann Dirson <ydirson@altern.org>
+# Subject to the GNU GPL, version 2.
+
+usage()
+{
+ echo "Usage: $(basename $0) [<branches>|--all]"
+ exit 1
+}
+
+allbranches=0
+case "$1" in
+--all) allbranches=1; shift ;;
+--*) usage ;;
+*) break ;;
+esac
+
+if [ $allbranches = 1 ] && [ "$#" -gt 0 ]; then
+ usage
+fi
+
+GIT_DIR=$(git-rev-parse --git-dir)
+GIT_DIR_SPKIPLEN=$(printf "$GIT_DIR/X" | wc -c)
+
+refdirs=''
+if [ $allbranches = 1 ]; then
+ refdirs="$GIT_DIR/refs"
+else
+ if [ "$#" = 0 ]; then
+ set -- "$(stg branch)"
+ fi
+
+ for b in "$@"; do
+ if [ -e "$GIT_DIR/refs/patches/$b" ]; then
+ # StGIT branch: show all patches
+ refdirs="$refdirs $GIT_DIR/refs/patches/$b"
+ elif [ -e "$GIT_DIR/refs/heads/$b" ]; then
+ # other GIT branch
+ refdirs="$refdirs $GIT_DIR/refs/heads/$b"
+ else
+ echo >&2 "ERROR: no such branch '$b'"
+ usage
+ fi
+ done
+fi
+
+gitk $(find $refdirs -type f -not -name '*.log' | cut -c${GIT_DIR_SPKIPLEN}- )
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
| Manu Abraham | PCIE |
| Jared Hulbert | [PATCH 00/10] AXFS: Advanced XIP filesystem |
| Pardo | Re: pthread_create() slow for many threads; also time to revisit 64b context switc... |
| Tomasz Chmielewski | Re: [PATCH] Intel IXP4xx network drivers v.2 - Ethernet and HSS |
git: | |
| Thomas Glanzmann | fatal: serious inflate inconsistency |
| Jeff Garzik | Re: Using GIT to store /etc (Or: How to make GIT store all file permission bits) |
| Andy Parkins | Re: git-fetch and unannotated tags |
| Yossi Leybovich | corrupt object on git-gc |
| Richard Stallman | Real men don't attack straw men |
| Bertram Scharpf | First install: Grub doesn't find partitions |
| Unix Fan | Chatting with developers? Is it soo 1996? |
| Joel Wiramu Pauling | Re: Suggested PF Setup when using BitTorrent? |
| Vegard Nossum | Re: [bug, netconsole, SLUB] BUG skbuff_head_cache: Poison overwritten |
| Jarek Poplawski | Re: NMI lockup, 2.6.26 release |
| Tomas Winkler | [PATCH] iwlwifi: RS small compile warnings without CONFIG_IWLWIFI_DEBUG |
| Simon Horman | Re: [PATCH] sendfile() and UDP socket |
