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

Re: [PATCH v2] gitk: Add a "Copy commit summary" command

From
Paul Mackerras <paulus@samba.org>
Date
Jul 17, 2015, 09:22 UTC
Message-ID
<20150717092251.GB5916@iris.ozlabs.ibm.com>
In-Reply-To
<1437060565-4716-1-git-send-email-dev+git@drbeat.li>
On Thu, Jul 16, 2015 at 05:29:25PM +0200, Beat Bolli wrote:
Show 8 quoted lines
> When referring to earlier commits in commit messages or other text, one
> of the established formats is
> 
>     <abbrev-sha> ("<summary>", <author-date>)
> 
> Add a "Copy commit summary" command to the context menu that puts this
> text for the currently selected commit on the clipboard. This makes it
> easy for our users to create well-formatted commit references.

I really like this idea, but as others have noted, 8 characters may not be the right choice for the SHA1 length in all cases.

We have an item in the preferences menu to control the SHA1 length that is automatically selected when going to a new commit. It's stored in the variable $autosellen. That seems like it would be a reasonable choice for the SHA1 length to use here. The only possible problem is that it defaults to 40 and so might give an overly long result for some users. Maybe you could use $autosellen but limit it to at most 12 or 16 or something like that.

Paul.
Previous: Johannes SixtNext: Junio C Hamano
Message 6 of 9 in “gitk: Add a "Copy commit summary" command”
  1. gitk: Add a "Copy commit summary" commandBeat Bolli, Jul 16, 2015
  2. Junio C HamanoJul 16, 2015
  3. Stefan HallerJul 17, 2015
  4. Beat BolliJul 17, 2015
  5. Johannes SixtJul 16, 2015
  6. Paul MackerrasJul 17, 2015
  7. Junio C HamanoJul 17, 2015
  8. Paul MackerrasJul 18, 2015
  9. Beat BolliJul 18, 2015

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.