This commit is contained in:
Daniel Ziltener 2024-08-30 11:27:10 +02:00
parent db8f40ca30
commit abccdcb27e
Signed by: zilti
GPG Key ID: B38976E82C9DAE42
2 changed files with 15 additions and 11 deletions

View File

@ -757,17 +757,19 @@ Point must be at the beginning of balanced expression (sexp)."
;; The following snippet is a convenience function for git-commit to add the ticket number, if found ;; The following snippet is a convenience function for git-commit to add the ticket number, if found
;; in the branch name, to the commit message. ;; in the branch name, to the commit message.
(use-package git-commit (defun add-git-commit-ticket-id-from-branch ()
:hook "A git-commit-mode-hook which inserts the first consecutive
(git-commit-mode sequence of at least 3 digits in the current branch name at
. the beginning of the commit message buffer (in square
(lambda () brackets)."
(when-let ((branch (magit-get-current-branch))) (when-let ((branch (magit-get-current-branch)))
(when (string-match "\\(ticket\\|feature\\)-\\([[:digit]]\\{3,\\}\\)" branch) (when (string-match "\\([[:digit:]]\\{3,\\}\\)" branch)
(let ((prefix (format "[T-%s] \n" (match-string 2 branch)))) (let ((prefix (format "[T-%s] \n" (match-string 1 branch))))
(goto-char (point-min)) (goto-char (point-min))
(insert prefix) (insert prefix)
(forward-char -1))))))) (forward-char -1)))))
(add-hook 'git-commit-mode-hook 'add-git-commit-ticket-id-from-branch)
;; Magit requires 'transient' >= 0.5.0, but due to bad defaults, Emacs' package manager refuses to ;; Magit requires 'transient' >= 0.5.0, but due to bad defaults, Emacs' package manager refuses to
;; upgrade this and other built-in packages to higher releases from GNU Elpa. ;; upgrade this and other built-in packages to higher releases from GNU Elpa.

View File

@ -21,6 +21,7 @@ args@{ config, pkgs, split-monitor-workspaces, flatpaks, ... }:
freetype freetype
gcc gcc
ghostscript ghostscript
gimp-with-plugins
git-cola git-cola
git-doc git-doc
git-filter-repo git-filter-repo
@ -31,6 +32,7 @@ args@{ config, pkgs, split-monitor-workspaces, flatpaks, ... }:
iconv iconv
kteatime kteatime
lagrange lagrange
libreoffice-qt6-fresh
liquidprompt liquidprompt
kdePackages.dolphin kdePackages.dolphin
kdePackages.ksshaskpass kdePackages.ksshaskpass