.
This commit is contained in:
parent
db8f40ca30
commit
abccdcb27e
2 changed files with 15 additions and 11 deletions
|
@ -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.
|
||||||
|
|
2
home.nix
2
home.nix
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue