{"thread":{"id":"9297","subject":"[PATCH] Show an error and exit if started in a directory where no .git could be found","startedAt":"2007-07-29T20:29:45Z","lastAt":"2007-07-29T20:29:45Z","messageCount":1,"participants":["Alex Riesen"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"49009","messageId":"20070729202945.GB9362@steel.home","threadId":"9297","inReplyTo":null,"subject":"[PATCH] Show an error and exit if started in a directory where no .git could be found","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-07-29T20:29:45Z","receivedAt":"2007-07-29T20:29:45Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"This is to help people starting gitk from graphical file managers where\nthe stderr output is hidden.\n\nSigned-off-by: Alex Riesen <raa.lkml@gmail.com>\n---\n gitk |    5 ++++-\n 1 files changed, 4 insertions(+), 1 deletions(-)\n\ndiff --git a/gitk b/gitk\nindex fc7cc8c..f5949a2 100755\n--- a/gitk\n+++ b/gitk\n@@ -7575,7 +7575,10 @@ catch {source ~/.gitk}\n font create optionfont -family sans-serif -size -12\n \n # check that we can find a .git directory somewhere...\n-set gitdir [gitdir]\n+if {[ catch { set gitdir [gitdir] } ]} {\n+    show_error {} . \"Cannot find a git repository here.\"\n+    exit 1\n+}\n if {![file isdirectory $gitdir]} {\n     show_error {} . \"Cannot find the git directory \\\"$gitdir\\\".\"\n     exit 1\n-- \n1.5.3.rc3.48.g5b618\n"}]}