Skip to content

Commit

Permalink
Configure Git signing separately on macOS.
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMcQuaid committed Jan 23, 2025
1 parent c93ef63 commit b873c4d
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 32 deletions.
12 changes: 2 additions & 10 deletions gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
name = Mike McQuaid
# Email used in commit messages.
email = mike@mikemcquaid.com
# Sign Git commits with SSH key when possible.
signingkey = ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID3dbEVCqBzPGwz7v6vWfn4uM/of0Hpo8Ql9by+6q3nO
[include]
path = ~/.gitconfig.local
[github]
# GitHub username for command-line tools.
user = MikeMcQuaid
Expand Down Expand Up @@ -205,14 +205,6 @@
[commit]
# Show the diff as a comment in the commit message template.
verbose = true
# Sign commits with GPG
gpgsign = true
[gpg]
# Do GPG signing with SSH keys
format = ssh
[gpg "ssh"]
# Let 1Password act as GPG agent
program = "/Applications/1Password.app/Contents/MacOS/op-ssh-sign"
[tag]
# Sort tags by newest first
sort = -version:refname
Expand Down
11 changes: 11 additions & 0 deletions gitconfig.local.macos
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[user]
signingkey = ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID3dbEVCqBzPGwz7v6vWfn4uM/of0Hpo8Ql9by+6q3nO
[commit]
# Sign commits with GPG
gpgsign = true
[gpg]
# Do GPG signing with SSH keys
format = ssh
[gpg "ssh"]
# Let 1Password act as GPG agent
program = "/Applications/1Password.app/Contents/MacOS/op-ssh-sign"
4 changes: 0 additions & 4 deletions gnupg/gpg.conf

This file was deleted.

13 changes: 0 additions & 13 deletions gnupg/mike@mikemcquaid.com.public.gpg-key

This file was deleted.

16 changes: 11 additions & 5 deletions script/setup
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ DOTFILESDIRREL=$(dirname "$SCRIPTSETUP")
cd "$DOTFILESDIRREL"/.. || exit
DOTFILESDIR=$(pwd -P)

[ $(uname -s) = "Darwin" ] && export MACOS=1 && export UNIX=1
[ $(uname -s) = "Linux" ] && export LINUX=1 && export UNIX=1
[ "$(uname -s)" = "Darwin" ] && export MACOS=1 && export UNIX=1
[ "$(uname -s)" = "Linux" ] && export LINUX=1 && export UNIX=1
uname -s | grep -q "_NT-" && export WINDOWS=1

if [ "$MACOS" ]; then
Expand All @@ -31,13 +31,19 @@ for DOTFILE in *; do
[ -d "$DOTFILE" ] && DOTFILE="$DOTFILE/"
DIRFILE="$DOTFILESDIR/$DOTFILE"

# Don't mess with Codespaces' default GPG/SSH setup.
# Don't mess with Codespaces' default SSH setup.
if [ -n "$CODESPACES" ]; then
echo "$DOTFILE" | egrep -q '^(gnupg|ssh)/' && continue
echo "$DOTFILE" | grep -E -q '^ssh/' && continue
fi

# Don't try to install documentation/script files
echo "$DOTFILE" | egrep -q '(^script/$|\.txt$|\.md$)' && continue
echo "$DOTFILE" | grep -E -q '(^script/$|\.txt$|\.md$)' && continue

# Only install gitconfig.local.macos on macOS
if echo "$DOTFILE" | grep -q 'gitconfig.local.macos'; then
[ -z "$MACOS" ] && continue
HOMEFILE="$HOME/.gitconfig.local"
fi

# Fixup VSCode settings path
echo "$DOTFILE" | grep -q 'vscode-settings' &&
Expand Down

0 comments on commit b873c4d

Please sign in to comment.