Skip to content

Feature: custom guitool commands can now have custom keyboard shortcuts - #220

Closed
harish2704 wants to merge 4 commits into
git:masterfrom
harish2704:master
Closed

Feature: custom guitool commands can now have custom keyboard shortcuts#220
harish2704 wants to merge 4 commits into
git:masterfrom
harish2704:master

Conversation

@harish2704

Copy link
Copy Markdown

eg: in ~/.gitconfig

[guitool "pull"]
  cmd = git pull
  accelerator = "<Control-Key-l>"
  accelerator-label = "Ctrl-l"

eg: in ~/.gitconfig
```
[guitool "pull"]
  cmd = git pull
  accelerator = "<Control-Key-l>"
  accelerator-label = "Ctrl-l"
```
@submitgit

Copy link
Copy Markdown
Member

@harish2704 sent this commit (90f7b16...7d2bbab) as a patch to the mailing list with submitGit - here on Gmane, MARC

@submitgit

Copy link
Copy Markdown
Member

@harish2704 sent this commit (90f7b16...7d2bbab) as a patch to the mailing list with submitGit - here on Gmane, MARC

* 'master' of github.com:git/git: (1411 commits)
  Fourth batch for 2.11
  Start preparing for 2.10.1
  Third batch for 2.11
  Second batch for 2.11
  t/perf/run: copy config.mak.autogen & friends to build area
  i18n: update-index: mark warnings for translation
  i18n: show-branch: mark plural strings for translation
  i18n: show-branch: mark error messages for translation
  i18n: receive-pack: mark messages for translation
  notes: spell first word of error messages in lowercase
  i18n: notes: mark error messages for translation
  i18n: merge-recursive: mark verbose message for translation
  i18n: merge-recursive: mark error messages for translation
  i18n: config: mark error message for translation
  i18n: branch: mark option description for translation
  i18n: blame: mark error messages for translation
  format-patch: show base info before email signature
  xdiff: fix merging of hunks with -W context and -u context
  vcs-svn/fast_export: fix timestamp fmt specifiers
  sha1_file: use llist_mergesort() for sorting packs
  ...
max630 pushed a commit to max630/git that referenced this pull request Jan 17, 2017
The stat() method should not be dependent on the core.symlinks config entry
@dscho

dscho commented Jun 18, 2019

Copy link
Copy Markdown
Member

@harish2704 seems that this patch has stalled in https://marc.info/?l=git&m=145949232928597&w=2...

@harish2704

Copy link
Copy Markdown
Author

@dscho : You are right. Do you have any suggestion to make this feature live ?

@dscho

dscho commented Jun 19, 2019

Copy link
Copy Markdown
Member

Do you have any suggestion to make this feature live ?

Well, David seemed to have a few good points:

  • this should be documented,
  • it should be designed in a way that is compatible (or at least not incompatible) with git-cola.

From looking at https://git-cola.readthedocs.io/en/latest/git-cola.html#configuration-variables, it does not appear to me that git-cola developed anything in that direction yet. And I am not necessarily certain that it would even be possible, given that you use Tk's built-in hotkey parsing and git-cola uses Qt for that (via Python), and they might very possibly have different naming conventions.

In any case, the naming convention of Git GUI's command names (the fullname in your patch) will probably not match how git-cola names things internally.

So I would recommend replying to David with considerations based on what I just wrote, to the extent that it is probably not possible to keep these configurable hotkeys in sync.

Other than that, I would try to make the diff a bit nicer to read, if only to make review easier.

In particular, I think I would rather try to use $path configure so that all of the added code could come after the tools_create_item call.

Also, my preference would be to use the convention guitool.<fullname>.hotkey and guitool.<fullname>.label, as the accelerator and accelerator-label names are not terribly self-explanatory to me.

And yes, it would definitely benefit from a description and at least one example in the documentation, although, admittedly, there seems not to be any good documentation for Git GUI (https://github.com/git/git/blob/v2.22.0/Documentation/git-gui.txt is really too short). But at least the commit message would benefit from such an example.

Speaking of commit message: it should start with a line that has the prefix guitool:, not Feature:. And it needs a good description what motivated the change (see other commits in git.git for inspiration, they are a lot more verbose, and focus a lot more on answering the "why?" than the "what?"). And it needs your sign off.

@dscho

dscho commented Jul 25, 2019

Copy link
Copy Markdown
Member

@harish2704 gentle ping?

@harish2704

Copy link
Copy Markdown
Author

@dscho I am sorry for the delayed response.
Yes. we can discuss. My email ID is [email protected].

@dscho

dscho commented Aug 5, 2019

Copy link
Copy Markdown
Member

@harish2704 I am not interested in private discussions about open source projects 😃 Let's keep this conversation in this here PR.

@harish2704

Copy link
Copy Markdown
Author

Sure. We can discuss here it self. I will put an eye on my github update emails

@dscho

dscho commented Aug 8, 2019

Copy link
Copy Markdown
Member

I will put an eye on my github update emails

Don't forget to look at the comments that are already there, in particular the comment I left on June 19th.

@dscho

dscho commented Sep 25, 2019

Copy link
Copy Markdown
Member

@harish2704 gentle ping?

* upstream/master: (8682 commits)
  Third batch
  gitk: rename zh_CN.po to zh_cn.po
  git-gui: add hotkey to toggle "Amend Last Commit"
  gitk: Do not mistake unchanged lines for submodule changes
  gitk: Use right colour for remote refs in the "Tags and heads" dialog
  gitk: Add Chinese (zh_CN) translation
  git-gui: add horizontal scrollbar to commit buffer
  git-gui: convert new/amend commit radiobutton to checkbutton
  git-gui: add hotkeys to set widget focus
  Second batch
  t3427: accelerate this test by using fast-export and fast-import
  am: reload .gitattributes after patching it
  gitk: Make web links clickable
  git-gui: allow undoing last revert
  path: add a function to check for path suffix
  git-gui: return early when patch fails to apply
  git-gui: allow reverting selected hunk
  git-gui: allow reverting selected lines
  transport: teach all vtables to allow fetch first
  transport-helper: skip ls-refs if unnecessary
  ...
@harish2704

Copy link
Copy Markdown
Author

@dscho : Hi,
I was following your suggestions . I renamed accelerator into hotkey and tried to document it.

Then , I noticed that, git-cola already has a guitool.<name>.shortcut config variable which serves the same purpose for git-cola tool.
But, there is a problem. the guitool.<name>.shortcut variable should follow the format specified by QKeySequence but, our new hotkey variable is using the format specified by tcl/tk 's bind command

For example, Control-comma in TCL/TK is equivalent to CTRL+, in QKeySequence code

In short, both will conflict.

git-cola is already using a config guitool.<name>.shortcut .
what should we do now? can we proceed with an alternate , non-conflicting config variable name like guitool.<name>.hotkey ?

Will it meet the code quality ? Let me know your thoughts

@dscho

dscho commented Sep 30, 2019

Copy link
Copy Markdown
Member

Will it meet the code quality ? Let me know your thoughts

I don't know whether it will meet the code quality, but you can ask the Git GUI maintainer (we now have an active one again! Yay!). How about mentioning your concern to the Git mailing list ([email protected]) Cc:ing Pratyush Yadav ([email protected])?

Maybe somebody on the list already has a cunning idea how to maybe reuse the QKeySequences and turn them into their Tcl/Tk equivalent programmatically. Then you could reuse the .shortcut name.

@harish2704

Copy link
Copy Markdown
Author

@dscho , Yes. will do that.

A quick summary of my proposal is given below

  1. I suggest to keep this additional config parameter as an independent config parameter ( which will not interfere with git-cola in any way ), because, both are different applications, and it may have different "built-in" shortcuts already assigned. So, sharing shortcut scheme between two apps is not a good idea.
  2. suggested name of new config parameter is guitool.<name>.gitgui_shortcut
  3. New parameter will expect shortcut combinations specified in TCL/TK 's format and we will not be doing any processing on it. Will keep it simple

-Will update you once I send the mail

@dscho

dscho commented Oct 1, 2019

Copy link
Copy Markdown
Member

@harish2704 looks sensible to me, perfect as a discussion starter.

@harish2704

harish2704 commented Oct 3, 2019

Copy link
Copy Markdown
Author

@dscho : I had sent a mail as you described , but even after 24 hours, I couldn't find that mail in any of the git mailing list archives. So I think it lost due to some reason.

Now I sent it again in plain text mode ( previous mail was sent in normal mode which is html mode )

Update: It became available in mailing list . Please see https://marc.info/?l=git&m=157011410330286&w=2

@harish2704

Copy link
Copy Markdown
Author

Closing this PR since , this has to split into two separate PRs.

  1. agains git-gui branch for updating git-gui, which is already made and in progress @ [guitool] feature to specify keyboard shortcuts for custom tools gitgitgadget/git#376 (review)
  2. Against main git repo for updating documentation of Documentation/config/guitool.txt which is not yet made.

@harish2704 harish2704 closed this Oct 6, 2019
derrickstolee pushed a commit to derrickstolee/git that referenced this pull request Dec 11, 2019
test-gvfs-prococol, t5799: tests for gvfs-helper
derrickstolee pushed a commit to derrickstolee/git that referenced this pull request Jan 17, 2020
test-gvfs-prococol, t5799: tests for gvfs-helper
derrickstolee pushed a commit to derrickstolee/git that referenced this pull request Mar 24, 2020
test-gvfs-prococol, t5799: tests for gvfs-helper
derrickstolee pushed a commit to derrickstolee/git that referenced this pull request Jun 2, 2020
Includes commits from these pull requests:

	git#191
	git#205
	git#206
	git#207
	git#208
	git#215
	git#220
	git#221

Signed-off-by: Derrick Stolee <[email protected]>
derrickstolee pushed a commit to derrickstolee/git that referenced this pull request Aug 3, 2020
Includes commits from these pull requests:

	git#191
	git#205
	git#206
	git#207
	git#208
	git#215
	git#220
	git#221

Signed-off-by: Derrick Stolee <[email protected]>
derrickstolee pushed a commit to derrickstolee/git that referenced this pull request Nov 3, 2020
Includes commits from these pull requests:

	git#191
	git#205
	git#206
	git#207
	git#208
	git#215
	git#220
	git#221

Signed-off-by: Derrick Stolee <[email protected]>
derrickstolee pushed a commit to derrickstolee/git that referenced this pull request May 22, 2022
Includes commits from these pull requests:

	git#191
	git#205
	git#206
	git#207
	git#208
	git#215
	git#220
	git#221

Signed-off-by: Derrick Stolee <[email protected]>
derrickstolee pushed a commit to derrickstolee/git that referenced this pull request Jun 23, 2022
Includes commits from these pull requests:

	git#191
	git#205
	git#206
	git#207
	git#208
	git#215
	git#220
	git#221

Signed-off-by: Derrick Stolee <[email protected]>
derrickstolee pushed a commit to derrickstolee/git that referenced this pull request Jun 27, 2022
Includes commits from these pull requests:

	git#191
	git#205
	git#206
	git#207
	git#208
	git#215
	git#220
	git#221

Signed-off-by: Derrick Stolee <[email protected]>
derrickstolee pushed a commit to derrickstolee/git that referenced this pull request Jul 14, 2022
Includes commits from these pull requests:

	git#191
	git#205
	git#206
	git#207
	git#208
	git#215
	git#220
	git#221

Signed-off-by: Derrick Stolee <[email protected]>
derrickstolee pushed a commit to derrickstolee/git that referenced this pull request Sep 30, 2022
Includes commits from these pull requests:

	git#191
	git#205
	git#206
	git#207
	git#208
	git#215
	git#220
	git#221

Signed-off-by: Derrick Stolee <[email protected]>
derrickstolee pushed a commit to derrickstolee/git that referenced this pull request Oct 4, 2022
Includes commits from these pull requests:

	git#191
	git#205
	git#206
	git#207
	git#208
	git#215
	git#220
	git#221

Signed-off-by: Derrick Stolee <[email protected]>
derrickstolee pushed a commit to derrickstolee/git that referenced this pull request Nov 8, 2022
Includes commits from these pull requests:

	git#191
	git#205
	git#206
	git#207
	git#208
	git#215
	git#220
	git#221

Signed-off-by: Derrick Stolee <[email protected]>
derrickstolee pushed a commit to derrickstolee/git that referenced this pull request Mar 15, 2023
Includes commits from these pull requests:

	git#191
	git#205
	git#206
	git#207
	git#208
	git#215
	git#220
	git#221

Signed-off-by: Derrick Stolee <[email protected]>
derrickstolee pushed a commit to derrickstolee/git that referenced this pull request Mar 15, 2023
Includes commits from these pull requests:

	git#191
	git#205
	git#206
	git#207
	git#208
	git#215
	git#220
	git#221

Signed-off-by: Derrick Stolee <[email protected]>
derrickstolee pushed a commit to derrickstolee/git that referenced this pull request May 11, 2023
Includes commits from these pull requests:

	git#191
	git#205
	git#206
	git#207
	git#208
	git#215
	git#220
	git#221

Signed-off-by: Derrick Stolee <[email protected]>
derrickstolee pushed a commit to derrickstolee/git that referenced this pull request Aug 23, 2023
Includes commits from these pull requests:

	git#191
	git#205
	git#206
	git#207
	git#208
	git#215
	git#220
	git#221

Signed-off-by: Derrick Stolee <[email protected]>
vdye pushed a commit to vdye/git that referenced this pull request Jan 9, 2024
Includes commits from these pull requests:

	git#191
	git#205
	git#206
	git#207
	git#208
	git#215
	git#220
	git#221

Signed-off-by: Derrick Stolee <[email protected]>
vdye pushed a commit to vdye/git that referenced this pull request Jan 9, 2024
Includes commits from these pull requests:

	git#191
	git#205
	git#206
	git#207
	git#208
	git#215
	git#220
	git#221

Signed-off-by: Derrick Stolee <[email protected]>
vdye pushed a commit to vdye/git that referenced this pull request Jan 9, 2024
test-gvfs-prococol, t5799: tests for gvfs-helper
vdye pushed a commit to vdye/git that referenced this pull request Jan 9, 2024
Includes commits from these pull requests:

	git#191
	git#205
	git#206
	git#207
	git#208
	git#215
	git#220
	git#221

Signed-off-by: Derrick Stolee <[email protected]>
vdye pushed a commit to vdye/git that referenced this pull request Jan 9, 2024
Includes commits from these pull requests:

	git#191
	git#205
	git#206
	git#207
	git#208
	git#215
	git#220
	git#221

Signed-off-by: Derrick Stolee <[email protected]>
vdye pushed a commit to vdye/git that referenced this pull request Jan 9, 2024
Includes commits from these pull requests:

	git#191
	git#205
	git#206
	git#207
	git#208
	git#215
	git#220
	git#221

Signed-off-by: Derrick Stolee <[email protected]>
derrickstolee pushed a commit to derrickstolee/git that referenced this pull request Apr 30, 2024
Includes commits from these pull requests:

	git#191
	git#205
	git#206
	git#207
	git#208
	git#215
	git#220
	git#221

Signed-off-by: Derrick Stolee <[email protected]>
derrickstolee pushed a commit to derrickstolee/git that referenced this pull request May 31, 2024
Includes commits from these pull requests:

	git#191
	git#205
	git#206
	git#207
	git#208
	git#215
	git#220
	git#221

Signed-off-by: Derrick Stolee <[email protected]>
derrickstolee pushed a commit to derrickstolee/git that referenced this pull request Jun 19, 2024
Includes commits from these pull requests:

	git#191
	git#205
	git#206
	git#207
	git#208
	git#215
	git#220
	git#221

Signed-off-by: Derrick Stolee <[email protected]>
derrickstolee pushed a commit to derrickstolee/git that referenced this pull request Jul 19, 2024
Includes commits from these pull requests:

	git#191
	git#205
	git#206
	git#207
	git#208
	git#215
	git#220
	git#221

Signed-off-by: Derrick Stolee <[email protected]>
derrickstolee pushed a commit to derrickstolee/git that referenced this pull request Aug 23, 2024
Includes commits from these pull requests:

	git#191
	git#205
	git#206
	git#207
	git#208
	git#215
	git#220
	git#221

Signed-off-by: Derrick Stolee <[email protected]>
derrickstolee pushed a commit to derrickstolee/git that referenced this pull request Sep 30, 2024
Includes commits from these pull requests:

	git#191
	git#205
	git#206
	git#207
	git#208
	git#215
	git#220
	git#221

Signed-off-by: Derrick Stolee <[email protected]>
derrickstolee pushed a commit to derrickstolee/git that referenced this pull request Oct 9, 2024
Includes commits from these pull requests:

	git#191
	git#205
	git#206
	git#207
	git#208
	git#215
	git#220
	git#221

Signed-off-by: Derrick Stolee <[email protected]>
dscho pushed a commit to derrickstolee/git that referenced this pull request Dec 10, 2024
Includes commits from these pull requests:

	git#191
	git#205
	git#206
	git#207
	git#208
	git#215
	git#220
	git#221

Signed-off-by: Derrick Stolee <[email protected]>
derrickstolee pushed a commit to derrickstolee/git that referenced this pull request Aug 5, 2025
Includes commits from these pull requests:

	git#191
	git#205
	git#206
	git#207
	git#208
	git#215
	git#220
	git#221

Signed-off-by: Derrick Stolee <[email protected]>
derrickstolee pushed a commit to derrickstolee/git that referenced this pull request Sep 2, 2025
Includes commits from these pull requests:

	git#191
	git#205
	git#206
	git#207
	git#208
	git#215
	git#220
	git#221

Signed-off-by: Derrick Stolee <[email protected]>
derrickstolee pushed a commit to derrickstolee/git that referenced this pull request Nov 7, 2025
Includes commits from these pull requests:

	git#191
	git#205
	git#206
	git#207
	git#208
	git#215
	git#220
	git#221

Signed-off-by: Derrick Stolee <[email protected]>
derrickstolee pushed a commit to derrickstolee/git that referenced this pull request Feb 3, 2026
Includes commits from these pull requests:

	git#191
	git#205
	git#206
	git#207
	git#208
	git#215
	git#220
	git#221

Signed-off-by: Derrick Stolee <[email protected]>
derrickstolee pushed a commit to derrickstolee/git that referenced this pull request Apr 22, 2026
Includes commits from these pull requests:

	git#191
	git#205
	git#206
	git#207
	git#208
	git#215
	git#220
	git#221

Signed-off-by: Derrick Stolee <[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.

4 participants