{"thread":{"id":"8420","subject":"[StGIT PATCH not for master] Use gitk --argscmd in contrib/stg-gitk.","startedAt":"2007-06-03T22:52:06Z","lastAt":"2007-06-03T22:52:06Z","messageCount":1,"participants":["Yann Dirson"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"43921","messageId":"20070603225017.30044.16832.stgit@gandelf.nowhere.earth","threadId":"8420","inReplyTo":null,"subject":"[StGIT PATCH not for master] Use gitk --argscmd in contrib/stg-gitk.","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2007-06-03T22:52:06Z","receivedAt":"2007-06-03T22:52:06Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"\nThis allows to ask gitk to recompute the list of patches to show at\nevery refresh.  Before this, we had problems with 'stg-gitk --all':\n\n - deleting a patch that was existing at startup time would trigger an\n \"unknown ref\" error from gitk and force to quit/restart manually;\n - patches created since startup were only visible when applied, or\n when below one of the startup patches.\n\nSigned-off-by: Yann Dirson <ydirson@altern.org>\n---\n\nNote that this flag is added by the gitk patch I just posted, so it\nshould not be applied to StGIT master right now - we want that git\ngets released with the necessary support before we do that.\n\n contrib/stg-gitk |   26 ++++++++++++++++++++------\n 1 files changed, 20 insertions(+), 6 deletions(-)\n\ndiff --git a/contrib/stg-gitk b/contrib/stg-gitk\nindex dd01ef0..f2fca84 100755\n--- a/contrib/stg-gitk\n+++ b/contrib/stg-gitk\n@@ -20,11 +20,16 @@ usage()\n }\n \n allbranches=0\n-case \"$1\" in\n---all) allbranches=1; shift ;;\n---*) usage ;;\n-*) break ;;\n-esac\n+refsonly=0\n+while [ \"$#\" -gt 0 ]; do\n+    case \"$1\" in\n+\t--refs) refsonly=1 ;;\n+\t--all) allbranches=1 ;;\n+\t--*) usage ;;\n+\t*) break ;;\n+    esac\n+    shift\n+done\n \n if [ $allbranches = 1 ] && [ \"$#\" -gt 0 ]; then\n     usage\n@@ -58,4 +63,13 @@ else\n     done\n fi\n \n-gitk $(find $refdirs -type f -not -name '*.log' | cut -c${GIT_DIR_SPKIPLEN}- )\n+printrefs()\n+{\n+    find $refdirs -type f -not -name '*.log' | cut -c${GIT_DIR_SPKIPLEN}-\n+}\n+\n+if [ $refsonly = 1 ]; then\n+    printrefs\n+else\n+    gitk --argscmd=\"$0 --refs $@\"\n+fi\n"}]}