git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Pratyush Yadav <me@yadavpratyush.com>
To: "Zoli Szabó via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, "Zoli Szabó" <zoli.szabo@gmail.com>
Subject: Re: [PATCH v3 1/1] git-gui: allow opening currently selected file in default app
Date: Tue, 31 Dec 2019 01:11:29 +0530	[thread overview]
Message-ID: <20191230194129.kjmp6r5xuwmq4wum@yadavpratyush.com> (raw)
In-Reply-To: <1b2363be726c6d70746aec9fae62edaf857cd665.1577721419.git.gitgitgadget@gmail.com>

Hi Zoli,

On 30/12/19 03:56PM, Zoli Szabó via GitGitGadget wrote:
> From: =?UTF-8?q?Zoli=20Szab=C3=B3?= <zoli.szabo@gmail.com>
> 
> Many times there's the need to quickly open a source file (the one you're
> looking at in Git GUI) in the predefined text editor / IDE. Of course,
> the file can be searched for in your preferred file manager or directly
> in the text editor, but having the option to directly open the current
> file from Git GUI would be just faster. This change enables just that by:
>  - clicking the diff header path (which is now highlighted as a hyperlink)
>  - or diff header path context menu -> Open;

Semi-colon left in by mistake?

> 
> Note: executable files will be run and not opened for editing.
> 
> Signed-off-by: Zoli Szabó <zoli.szabo@gmail.com>
> ---
>  git-gui.sh | 29 ++++++++++++++++++++++++-----
>  1 file changed, 24 insertions(+), 5 deletions(-)
> 
> diff --git a/git-gui.sh b/git-gui.sh
> index c1be733e3e..8920e4ddb0 100755
> --- a/git-gui.sh
> +++ b/git-gui.sh
> @@ -2259,9 +2258,23 @@ proc do_explore {} {
> +# Open file relative to the working tree by the default associated 
> app.
> +proc do_file_open {file} {
> +	global _gitworktree
> +	set explorer [get_explorer]
> +	set full_file_path [file join $_gitworktree $file]
> +	eval exec $explorer [list [file nativename $full_file_path]] &

IIUC, this line can be simplified to:

  exec $explorer [file nativename $full_file_path] &

It works fine for me including on files with spaces in their names, but 
a test on Windows would be appreciated just to rule out any hidden 
surprises.

No need to send a re-roll just for these two small things. I have 
updated the commit locally before pushing the new version out [0]. The 
rest of the patch looks good. Will merge. Thanks.

> +}
> +
>  set is_quitting 0
>  set ret_code    1
>  

[0] https://github.com/prati0100/git-gui/tree/zs/open-current-file

-- 
Regards,
Pratyush Yadav

  reply	other threads:[~2019-12-30 19:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-26 19:01 [PATCH 0/1] git-gui: add possibility to open currently selected file Zoli Szabó via GitGitGadget
2019-12-26 19:01 ` [PATCH 1/1] " Zoli Szabó via GitGitGadget
2019-12-27 19:34   ` Pratyush Yadav
2019-12-27 22:32     ` Junio C Hamano
2019-12-29 20:15       ` Zoli Szabó
2019-12-29 23:14         ` Junio C Hamano
2019-12-30 16:13           ` Zoli Szabó
2019-12-29 13:23     ` Zoli Szabó
2019-12-29 19:32 ` [PATCH v2 0/1] git-gui: allow opening " Zoli Szabó via GitGitGadget
2019-12-29 19:32   ` [PATCH v2 1/1] " Zoli Szabó via GitGitGadget
2019-12-30 15:56   ` [PATCH v3 0/1] " Zoli Szabó via GitGitGadget
2019-12-30 15:56     ` [PATCH v3 1/1] git-gui: allow opening currently selected file in default app Zoli Szabó via GitGitGadget
2019-12-30 19:41       ` Pratyush Yadav [this message]
2019-12-30 20:31         ` Zoli Szabó

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=20191230194129.kjmp6r5xuwmq4wum@yadavpratyush.com \
    --to=me@yadavpratyush.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=zoli.szabo@gmail.com \
    /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).