dotfiles

<-- duh.
Log | Files | Refs | LICENSE

commit 76e2644f0f719adcb50de203fb95baaca128b27e
parent f4c38ce15516c967ea7e65d1f91d4fd07e4de443
Author: hhvn <dev@haydenvh.com>
Date:   Sat,  6 Mar 2021 01:37:14 +0000

.config/git/add-commit .config/git/config: automatic add+commit

Diffstat:
A.config/git/add-commit | 23+++++++++++++++++++++++
M.config/git/config | 8++++++--
2 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/.config/git/add-commit b/.config/git/add-commit @@ -0,0 +1,23 @@ +#!/bin/sh +# - recognize file names from inside commit message +# example: git ac -m "LICENSE project.c: new email addr" +# output: git add LICENSE project.c; git commit -m "LICENSE project.c: new email addr" + +die(){ + echo "error: no filenames extracted from (non-existant)* commit message" + exit 1 +} + +# [][][^][]*[][] is one of the ugliest regexes I've ever constructed +# It is meant to get rid of the [NEW] from "thing.1[NEW]: add manpage" + +echo "$@" | grep ".*-m *[^:]*:" >/dev/null || die +files=$(echo "$@" | sed 's/[][][^][]*[][]//g' | sed -E 's/.*-m *([^:]*):.*/\1/') + +git add $files + +while [ $# != 0 ] +do + printf '%s\0' "$1" + shift +done | xargs -0 git commit diff --git a/.config/git/config b/.config/git/config @@ -10,6 +10,10 @@ hist = !sh ~/.config/git/hist mrg = merge --no-ff fm = !sh ~/.config/git/format-patch + ch = checkout + co = commit + pu = push + ac = !sh ~/.config/git/add-commit [init] defaultBranch = master @@ -18,8 +22,8 @@ headers = "Organization: haydenvh.com" [sendemail] - smtpDomain = port.haydenvh.com - smtpServer = haydenvh.com + smtpDomain = port.hhvn.uk + smtpServer = hhvn.uk smtpEncryption = tls smtpServerPort = 587 cc = ""