From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-2.8 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MALFORMED_FREEMAIL, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_NONE shortcircuit=no autolearn=no autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id ACDCE1F4BE for ; Sun, 6 Oct 2019 09:50:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726322AbfJFJuO (ORCPT ); Sun, 6 Oct 2019 05:50:14 -0400 Received: from mout.gmx.net ([212.227.15.19]:48561 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726185AbfJFJuO (ORCPT ); Sun, 6 Oct 2019 05:50:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1570355411; bh=Cny+rWs47Pc7WqWpe3vMbPtCXx6lH29gFMG5vGBAv+Q=; h=X-UI-Sender-Class:Date:From:To:cc:Subject:In-Reply-To:References; b=hhSeMt/jv49Y6zsYTNyxqdsS9Rru+Awkcz2uRqJqf7nd63H4lwt/xyzyOoKAuh0fY E7Z+V734Fdm0SJWK/b1bTzswNl1osAQon5HibaZIWlNl3yJBi7OxIyUyESxxfVgXhZ Mpe5t7ozSc7TIzo9tUBIOjxFUvgExqrphnrlX0bk= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.0.213] ([37.201.195.166]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N6bfw-1i3B643hYk-0181DT; Sun, 06 Oct 2019 11:50:11 +0200 Date: Sun, 6 Oct 2019 11:49:55 +0200 (CEST) From: Johannes Schindelin X-X-Sender: virtualbox@gitforwindows.org To: Pratyush Yadav cc: Harish Karumuthil , git@vger.kernel.org, David Aguilar Subject: Re: [PATCH] Feature: custom guitool commands can now have custom keyboard shortcuts In-Reply-To: <20191005210127.uinrgazj5ezyqftj@yadavpratyush.com> Message-ID: References: <01020153c22ab06b-e195b148-37cc-4f89-92f3-f4bed1915eb9-000000@eu-west-1.amazonses.com> <20160331164137.GA11150@gmail.com> <20191003214422.d4nocrxadxt47smg@yadavpratyush.com> <20191004120107.kpskplwhflnsamwu@yadavpratyush.com> <149a83fd40b71896b134b16c2b499ff472c6234e.camel@gmail.com> <20191005210127.uinrgazj5ezyqftj@yadavpratyush.com> User-Agent: Alpine 2.21.1 (DEB 209 2017-03-23) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Provags-ID: V03:K1:b8Kx8QbHLmsFaGUkp4vdtYC7EBOlQSLUNPoeAfIqCEDdx0SW6qj WbNeiYHeUJbu6XPWBQz2s4KsuRMToSLkPvE7drfAYP6KwkChEzMyvNno4LkETUUSIKif5HG UImXb9R1/EV2OrmoNRH3hoe9dVVRgKlegDTMx/bFVvNMaOaTXz1kcsBOVjIxS+M8qXgH/DC oNIVWFeIXwalnxFQZLUHA== X-UI-Out-Filterresults: notjunk:1;V03:K0:6ok19sZYyoQ=:uVZgMvPYG8/FGIrtVCXpnl g0O4Qp5B9UOx5pN6WfPZBsXMVfIoST2nJ2XxVM2k7o+6cqsjoQsnndxGbdqNuoqsCImnBZvub Srb2pLP52/57SDKjbdgVVCCl3ejm+C0vbSo0/xconmDsRfl1h2AgTHMMbOzlP5VozngZSFq9r u6wcuVM3dPHUw5JEKWrclnxgz7zY6NzVWtvyAMzdaMReuCzvO666ESWpHWCIuWBsMAfanHEB1 lVDoQPwrW7tARuqXr3gL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-printable Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Hi Pratyush, On Sun, 6 Oct 2019, Pratyush Yadav wrote: > On 06/10/19 01:46AM, Harish Karumuthil wrote: > > > > From https://www.kernel.org/doc/html/v4.10/process/email-clients.html,= I > > understood that, my current email client ( that is gmail web ) is not = good > > for submitting patches. So I was tying to setup a mail client which is > > compatible with `git send-mail`. But I was not able to get a satisfact= ory > > result in that. > > You don't need to "set up" an email client with git-send-email. > git-send-email is an email client itself. Well, one which can only send > emails. It also cannot reply to mails on the mailing list. It cannot even notify you when anybody replied to your patch. Two rather problematic aspects when it comes to patch contributions: how are you supposed to work with the reviewers when you lack all the tools to _interact_ with them? All `git send-email` provides is a "fire and forget" way to send patches, i.e. it encourages a monologue, when you want to start a dialogue instead. > So what you should do is run `git format-patch -o feature master..HEAD`, > assuming your feature branch is checked out. This will give you a set of > '.patch' files depending on how many commits you made in your branch in > the folder feature/. Then, you can run > > git send-email --to=3D'Pratyush Yadav ' --cc=3D'= ' feature/*.patch > > This will send all your patch files via email to me with the git list in > Cc. You can add multiple '--to' and '--cc' options to send it to > multiple people. > > Try sending the patches to yourself to experiment around with it. > > A pretty good tutorial to configuring and using git-send-email can be > found at [0]. And of course, read the man page. > > These instructions are for Linux, but you can probably do something > similar in Windows too (if you're using Windows that is). Last I checked, `git send-email` worked in Git for Windows. But of course, it does not only not address the problem it tries to solve fully (to provide a way to interact with a mailing list when submitting patches for review), not even close, to add insult to injury, it now adds an additional burden to contributors (who might already have struggled to learn themselves enough Tcl/Tk to fix the problem) to configure `git send-email` correctly. > > For now, I followed the instruction of Johannes Schindelin and submitt= ed a > > pull request . Please see https://github.com/gitgitgadget/git/pull/376 > > You haven't sent '/submit' over there, so those emails aren't in the > list (and my inbox) yet. You need to comment with '/submit' (without the > quotes) to tell GitGitGadget to send your PR as email. They probably did not hit `/submit` because the initial hurdle is to be `/allow`ed (a very, very simplistic attempt at trying to prevent spamming the mailing list by jokesters, of which there are unfortunately quite a number). This `/allow` command, BTW, can be issued by anybody who has been `/allow`ed before, it does not always have to be me. FWIW you should probably be in that list of `/allow`ed people so that you can `/allow` new contributors to use GitGitGadget, too. > [...] > > > Since #1 is a serious issue, I tried to find out the function which do= es the > > keycode validation, but I haven't succeded till now. ( I found the C f= unction > > name which is "TkStringToKeysym" from TK source, but I couldn't find = its TCL > > binding ). It will be helpful if any one can help me on this. > > I really think you shouldn't dive around in the C parts of Tcl. I > haven't looked too deeply into this, but you can probably wrap your bind > calls in `catch` [2] and handle errors from there. Again, I haven't > tried actually doing this, so you do need to check first. > > You can find examples of how to use `catch` in our codebase. Just search > for it. FWIW in addition to the `catch` method, I would also recommend looking into a minimal (not even necessarily complete) way to translate the Qt way to specify the keyboard shortcuts (as used by `git-cola`) to Tk ones. As indicated in https://github.com/git/git/pull/220#issuecomment-536045075, the Qt style `CTRL+,` should be translated to `Control-comma`, for example. In particular, keystrokes specified in the format indicated at https://doc.qt.io/archives/qt-4.8/qkeysequence.html#QKeySequence-2 to the format indicated at https://www.tcl.tk/man/tcl8.4/TkCmd/keysyms.htm. However, it might not even need to put in _such_ a lot of work: in my tests, `Control-,` worked just as well as `Control-comma`. To test this for yourself, use this snippet (that is slightly modified from the example at the bottom of https://www.tcl.tk/man/tcl/TkCmd/bind.htm so that it reacts _only_ to Control+comma instead of all keys): =2D- snip -- set keysym "Press any key" pack [label .l -textvariable keysym -padx 2m -pady 1m] #bind . { bind . { set keysym "You pressed %K" } =2D- snap -- So I could imagine that something like this could serve as an initial draft for a function that you can turn into a "good enough" version: =2D- snip -- proc QKeySequence2keysym {keystroke} { regsub -all {(?i)Ctrl\+} $keystroke "Control-" keystroke regsub -all {(?i)Alt\+} $keystroke "Alt-" keystroke regsub -all {(?i)Shift\+} $keystroke "Shift-" keystroke return $keystroke } =2D- snap -- That way, you don't have to introduce settings separate from `git-cola`'s, and you can reuse the short-and-sweet variable name. Ciao, Johannes