git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Joachim Schmitz" <jojo@schmitz-digital.de>
To: git@vger.kernel.org
Subject: Re: [PATCH] more meaningful error message in gitk when git binary is not available
Date: Mon, 1 Oct 2012 15:39:28 +0200	[thread overview]
Message-ID: <k4c6en$qq$1@ger.gmane.org> (raw)
In-Reply-To: 50694380.4090108@josefassad.com

Josef Assad wrote:
> 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_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."]

  reply	other threads:[~2012-10-01 13:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-01  7:17 [PATCH] more meaningful error message in gitk when git binary is not available Josef Assad
2012-10-01 13:39 ` Joachim Schmitz [this message]
2012-10-01 17:11 ` Junio C Hamano
     [not found]   ` <5069D0FE.4000609@josefassad.com>
2012-10-01 17:24     ` Josef Assad

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='k4c6en$qq$1@ger.gmane.org' \
    --to=jojo@schmitz-digital.de \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).