{"thread":{"id":"55629","subject":"[PATCH] gitk: automatically cd to $GIT_PREFIX","startedAt":"2021-05-05T21:18:50Z","lastAt":"2021-05-05T21:18:50Z","messageCount":1,"participants":["Felipe Contreras"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"423720","messageId":"20210505211846.1842824-1-felipe.contreras@gmail.com","threadId":"55629","inReplyTo":null,"subject":"[PATCH] gitk: automatically cd to $GIT_PREFIX","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2021-05-05T21:18:46Z","receivedAt":"2021-05-05T21:18:50Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"If gitk is ran as a shell alias it cannot find specified files in the\ncommand line if ran in a subdir (because it's ran in the top-level\ndirectory).\n\n  cd Documentation/\n  git -c 'alias.test=!gitk' test -- config.txt\n\nThe simplest way to fix this is to automatically cd to the specified\n$GIT_PREFIX in the environment.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n gitk | 4 ++++\n 1 file changed, 4 insertions(+)\n\ndiff --git a/gitk b/gitk\nindex 23d9dd1..c7c6989 100755\n--- a/gitk\n+++ b/gitk\n@@ -12505,6 +12505,10 @@ if {[catch {set gitdir [exec git rev-parse --git-dir]}]} {\n     exit 1\n }\n \n+if {[info exists env(GIT_PREFIX)] && $env(GIT_PREFIX) ne \"\"} {\n+    cd $env(GIT_PREFIX)\n+}\n+\n set selecthead {}\n set selectheadid {}\n \n-- \n2.31.0\n\n"}]}