Skip to content

[guitool] feature to specify keyboard shortcuts for custom tools #376

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: git-gui/master
Choose a base branch
from

Conversation

harish2704
Copy link

@harish2704 harish2704 commented Oct 5, 2019

This feature will add following introduce following optional
configuration key into gitconfig

guitool..gitgui-shortcut
Specifies a keyboard shortcut for the custom tool in the git-gui application. The value must be a valid string ( without "<" , ">" wrapper ) understood by the TCL/TK 's bind command. See https://www.tcl.tk/man/tcl8.4/TkCmd/bind.htm for more details about the supported values. Avoid creating shortcuts that conflict with existing built-in `git gui` shortcuts.

Example:

[guitool "Terminal"]
	cmd = gnome-terminal -e zsh
	noconsole = yes
	gitgui-shortcut = "Control-y"
[guitool "Sync"]
	cmd = "git pull; git push"
	gitgui-shortcut = "Alt-s"

@gitgitgadget
Copy link

gitgitgadget bot commented Oct 5, 2019

Welcome to GitGitGadget

Hi @harish2704, and welcome to GitGitGadget, the GitHub App to send patch series to the Git mailing list from GitHub Pull Requests.

Please make sure that this Pull Request has a good description, as it will be used as cover letter.

Also, it is a good idea to review the commit messages one last time, as the Git project expects them in a quite specific form:

  • the lines should not exceed 76 columns,
  • the first line should be like a header and typically start with a prefix like "tests:" or "commit:", and
  • the commit messages' body should be describing the "why?" of the change.
  • Finally, the commit messages should end in a Signed-off-by: line matching the commits' author.

It is in general a good idea to await the automated test ("Checks") in this Pull Request before contributing the patches, e.g. to avoid trivial issues such as unportable code.

Contributing the patches

Before you can contribute the patches, your GitHub username needs to be added to the list of permitted users. Any already-permitted user can do that, by adding a PR comment of the form /allow <username>.

Once on the list of permitted usernames, you can contribute the patches to the Git mailing list by adding a PR comment /submit.

After you submit, GitGitGadget will respond with another comment that contains the link to the cover letter mail in the Git mailing list archive. Please make sure to monitor the discussion in that thread and to address comments and suggestions.

If you do not want to subscribe to the Git mailing list just to be able to respond to a mail, you can download the mbox ("raw") file corresponding to the mail you want to reply to from the Git mailing list. If you use GMail, you can upload that raw mbox file via:

curl -g --user "<EMailAddress>:<Password>" --url "imaps://imap.gmail.com/INBOX" -T /path/to/raw.txt

@dscho
Copy link
Member

dscho commented Oct 5, 2019

@harish2704 I allowed myself to edit the PR description that did not show up well (and that would have rendered totally crappily in the cover letter) and that still included the warning that you should not open a PR at https://github.com/git/git.

Hope you don't mind!

@dscho
Copy link
Member

dscho commented Oct 5, 2019

/allow

@gitgitgadget
Copy link

gitgitgadget bot commented Oct 5, 2019

User harish2704 is now allowed to use GitGitGadget.

lib/tools.tcl Outdated
@@ -61,9 +61,18 @@ proc tools_populate_one {fullname} {
}
}

tools_create_item $parent command \
if {[info exists repo_config(guitool.$fullname.gitgui-shortcut)]} {
set gitgui_shortcut $repo_config(guitool.$fullname.gitgui-shortcut)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the variable really have to have the prefix gitgui_? This is Git GUI's source code after all, so it is kinda redundant?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That make sense.
So, What should I do now? Can I simply edit it in a new commit ? ( it know that it will work for PR based work flow, but I don't how it will work for mailing list based work flow )

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Git (and as a consequence, Git GUI), introducing a bug in one patch, only to fix it immediately in a following patch, is highly frowned upon.

Therefore I would strongly suggest to amend and force-push.

@dscho
Copy link
Member

dscho commented Oct 6, 2019

BTW as this is a continuation of git#220, how about closing that PR?

@@ -61,9 +61,18 @@ proc tools_populate_one {fullname} {
}
}

tools_create_item $parent command \
if {[info exists repo_config(guitool.$fullname.gitgui-shortcut)]} {
set accel_key $repo_config(guitool.$fullname.gitgui-shortcut)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dscho : I fixed the variable naming you suggested.

@harish2704
Copy link
Author

@dscho : Done git#220 (comment)

@dscho
Copy link
Member

dscho commented Oct 6, 2019

/allow prati0100

@gitgitgadget
Copy link

gitgitgadget bot commented Oct 6, 2019

User prati0100 is now allowed to use GitGitGadget.

@dscho
Copy link
Member

dscho commented Oct 6, 2019

User prati0100 is now allowed to use GitGitGadget.

@prati0100 there you go.

@prati0100
Copy link

Thanks @dscho

This feature will add following introduce following optional
configuration key into gitconfig

guitool.<name>.gitgui-shortcut
	Specifies a keyboard shortcut for the custom tool in the git-gui
	application. The value must be a valid string ( without "<" , ">" wrapper )
	understood by the TCL/TK 's bind command.See https://www.tcl.tk/man/tcl8.4/TkCmd/bind.htm
	for more details about the supported values. Avoid creating shortcuts that
	conflict with existing built-in `git gui` shortcuts.
	Example:
		[guitool "Terminal"]
			cmd = gnome-terminal -e zsh
			noconsole = yes
			gitgui-shortcut = "Control-y"
		[guitool "Sync"]
			cmd = "git pull; git push"
			gitgui-shortcut = "Alt-s"


Signed-off-by: Harish.K <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants