git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH/TOY] Shortcuts to quickly refer to a commit name with keyboard

From
Jacob Keller <jacob.keller@gmail.com>
Date
Jan 20, 2017, 19:16 UTC
Message-ID
<CA+P7+xoMTX5n_h+5MytZwVqKjqa0wdNKCeDtH29A_+WSfr6gTQ@mail.gmail.com>
In-Reply-To
<20170120160942.srqf4y5w5r6feidw@sigill.intra.peff.net>
On Fri, Jan 20, 2017 at 8:09 AM, Jeff King <peff@peff.net> wrote:
Show 40 quoted lines
> On Fri, Jan 20, 2017 at 05:22:49PM +0700, Nguyễn Thái Ngọc Duy wrote:
>
>> OK This patch is horrible. Though the idea is cool and I've found it
>> very useful. So here it is. Perhaps the idea may be revised a bit
>> that's more suitable for more than one user.
>>
>> The problem is old, SHA-1 name is not keyboard-friendly, even in
>> abbreviated form. And recent change has made abbrev form longer,
>> harder to type. Most of the time I just go with copy/paste with the
>> mouse, which I don't like. name-rev helps a bit, but it's still long
>> to type (especially with all the ^ and ~ that requires holding shift
>> down).
>
> Not really a comment on your patch itself, but I think a lot of people
> solve this at a higher level, either in their terminal or via a tool
> like tmux.
>
> I recently taught urxvt to recognize sha1s and grab them via keyboard
> hints, and I'm finding it quite useful. Here's what it looks like if
> you're interested:
>
>   http://peff.net/git-hints.gif
>
> The hints technique is taken from pentadactyl (which I also use), but
> the urxvt port is mine. I'm happy to share the code.
>
> Which isn't to say solving it inside Git is wrong, but I've found it
> really convenient for two reasons:
>
>   1. It works whenever you see a sha1, not just in git commands (so
>      emails, inside commit messages, etc).
>
>   2. It doesn't take any screen space until you're ready to select.
>
> The big downside is that it's scraping the screen, so you're guessing at
> what is a sha1. False positives are a little annoying, but usually not
> that big a deal because you're already looking at what you want to
> select, and the hint pops up right there.
>
> -Peff

I would be interested in the code for this.. I'm curious if I can adapt it to my use of tmux.

Thanks, Jake

Previous: Junio C HamanoNext: Jeff King
Message 7 of 12 in “Shortcuts to quickly refer to a commit name with keyboard”
  1. Shortcuts to quickly refer to a commit name with keyboardNguyễn Thái Ngọc Duy, Jan 20, 2017
  2. Johannes SchindelinJan 20, 2017
  3. Duy NguyenJan 20, 2017
  4. Johannes SchindelinJan 20, 2017
  5. Jeff KingJan 20, 2017
  6. Junio C HamanoJan 20, 2017
  7. Jacob KellerJan 20, 2017
  8. Jeff KingJan 20, 2017
  9. Duy NguyenJan 21, 2017
  10. Jeff KingJan 21, 2017
  11. Duy NguyenFeb 5, 2017
  12. Jacob KellerFeb 5, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.