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

[PATCH 0/3] Add a Hook To git commit --message Bash Completion

From
Mikko Johannes Koivunalho <mikko.koivunalho@iki.fi>
Date
Jun 30, 2024, 21:33 UTC
Message-ID
<20240630213336.2212166-1-mikko.koivunalho@iki.fi>

I want to create part or all of the `git commit -m *` command's message with a script. I work for one Jira ticket at a time and I need to create many commits which all start with "TKT-123: " (any Jira ticket number/identifier). To make the commits faster, I run `git commit --message="TKT-123: add new file"` on the command line.

I want the Bash completion mechanism to propose the message for me. I would fetch the newest ticket number and place it on the command line when I type `git commit --message=<TAB>`.

Example: # Doing commit: git commit --message=<TAB> # you would get (also without the closing double quote): git commit --message="ABC-1234

Mikko Johannes Koivunalho (3):
  completion: Add hook in Bash completion for commit message
  completion: Add hook in Bash completion for commit message; docs
  completion: Add hook in Bash completion for commit message; tests
 Documentation/config/completion.txt    | 11 +++++
 contrib/completion/git-completion.bash | 40 +++++++++++++++
 t/t9902-completion.sh                  | 68 ++++++++++++++++++++++++++
 3 files changed, 119 insertions(+)
base-commit: 790a17fb19d6eadd16c52e5d284a5c6921744766
-- 
2.30.2
Next: Mikko Johannes Koivunalho
Message 1 of 6 in “Add a Hook To git commit --message Bash Completion”
  1. 0/3 Add a Hook To git commit --message Bash CompletionMikko Johannes Koivunalho, Jun 30, 2024
  2. 2/3 completion: Add hook in Bash completion for commit message; docsMikko Johannes Koivunalho, Jun 30, 2024
  3. 3/3 completion: Add hook in Bash completion for commit message; testsMikko Johannes Koivunalho, Jun 30, 2024
  4. 1/3 completion: Add hook in Bash completion for commit messageMikko Johannes Koivunalho, Jun 30, 2024
  5. brian m. carlsonJun 30, 2024
  6. Mikko Johannes KoivunalhoJun 30, 2024

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.