git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] more meaningful error message in gitk when git binary is not available

From
Joachim Schmitz <jojo@schmitz-digital.de>
Date
Oct 1, 2012, 13:39 UTC
Message-ID
<k4c6en$qq$1@ger.gmane.org>
In-Reply-To
<50694380.4090108@josefassad.com>
Josef Assad wrote:
Show 29 quoted lines
> Hi. I ran across what is a decidedly trivial little issue in gitk. The
> TCL/Tk looked simple enough so I am giving you a patch anyhow in case
> you want to fix it.
> 
> When for whatever reason the git binary is unavailable, gitk would
> complain about missing git repository instead, so this patch adds a
> check for git binary availability.
> 
> In case anyone is curious, I found this issue here:
> 
> http://stackoverflow.com/q/11967110/53936
> 
> 
> 
> Signed-off-by: Josef Assad <josef@josefassad.com>
> ---
> gitk-git/gitk |    6 ++++++
> 1 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/gitk-git/gitk b/gitk-git/gitk
> index d93bd99..7e2e0a7 100755
> --- a/gitk-git/gitk
> +++ b/gitk-git/gitk
> @@ -11680,6 +11680,12 @@ setui $uicolor
> 
> setoptions
> 
> +# check that the git executables are available for use
> +if [catch {set gitexists [exec which git]}] {
I believe 'which' is not portable, you could use 'type' instead.
Show 7 quoted lines
> +    show_error {} . [mc "Cannot find a suitable git executable."]
> +    exit 1
> +}
> +
> # check that we can find a .git directory somewhere...
> if {[catch {set gitdir [exec git rev-parse --git-dir]}]} {
>     show_error {} . [mc "Cannot find a git repository here."]
Previous: Josef AssadNext: Junio C Hamano
Message 2 of 4 in “more meaningful error message in gitk when git binary is not available”
  1. more meaningful error message in gitk when git binary is not availableJosef Assad, Oct 1, 2012
  2. Joachim SchmitzOct 1, 2012
  3. Junio C HamanoOct 1, 2012
  4. Josef AssadOct 1, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.