From 90288ea65a70a18bb1cece44b17441f90c7b0ae6 Mon Sep 17 00:00:00 2001 From: Practicalli Engineering Date: Thu, 28 Dec 2023 23:50:03 +0000 Subject: [PATCH] git: consistency in formating and minimise duplication --- git/commit-message-griffin | 7 +++ ...mmit-jira.template => commit-message-jira} | 0 git/config | 22 +++++---- git/config-company-linux | 10 ++-- git/config-company-macosx | 10 ++-- git/config-johnny | 10 ++-- git/config-practicalli | 47 +++++++++---------- 7 files changed, 57 insertions(+), 49 deletions(-) create mode 100644 git/commit-message-griffin rename git/{git-commit-jira.template => commit-message-jira} (100%) diff --git a/git/commit-message-griffin b/git/commit-message-griffin new file mode 100644 index 0000000..bbb6e8e --- /dev/null +++ b/git/commit-message-griffin @@ -0,0 +1,7 @@ +LINEARCODE Summary + +# Elaboration + +# Issue Status: +# Resolve: # +# Related: # diff --git a/git/git-commit-jira.template b/git/commit-message-jira similarity index 100% rename from git/git-commit-jira.template rename to git/commit-message-jira diff --git a/git/config b/git/config index 018e02d..7df4f70 100644 --- a/git/config +++ b/git/config @@ -1,6 +1,6 @@ -## Practicalli Git Configuration -## -## Adjust paths if not saved in `~/.config/git/` +# Practicalli dotfiles Git Configuration +# +# Adjust paths if not saved in `~/.config/git/` # --- Conditional Configuration # Uses relative file path to this configuration file @@ -21,7 +21,7 @@ path = config-griffin -## -- Common Git Behaviour +# --- Common Git Behaviour [init] # scripts and hooks to add when creating a new local Git repository @@ -37,7 +37,7 @@ editor = astronvim # file and directory patterns to ignore across all projects - # excludesfile = ~/.config/git/ignore + excludesfile = ~/.config/git/ignore # Tool to page through long output (e.g. git log). `less` is default # pager = less @@ -49,13 +49,15 @@ # Remove deleted remote branches from local repository prune = true -[log] - abbrevCommit = true - [push] # Set local brach to track new remote branch automatically, Git 2.37.0 onward autoSetupRemote = true +[log] + abbrevCommit = true + +# --- Diff & Merge + [diff] tool = nvimdiff @@ -64,7 +66,7 @@ conflictstyle = diff3 -## --- Git commands +# --- Git commands # command line shot cuts [alias] @@ -92,7 +94,7 @@ # autocorrect = 50 -## -- Git CLI +# --- Git CLI [credential "https://github.com"] helper = !/usr/bin/gh auth git-credential diff --git a/git/config-company-linux b/git/config-company-linux index dc3eb85..405cc40 100644 --- a/git/config-company-linux +++ b/git/config-company-linux @@ -1,4 +1,8 @@ -## ------ Identity ------ ## +# Company Linux Git Configuration +# +# Adjust paths if files not saved in `~/.config/git/` + +# --- Identity # Add details for specific company identity # Assumes use of Linux for ~ expansion @@ -17,7 +21,7 @@ [github] user = practicalli-johnny -## ------ Git Behaviour ------ ## +# --- Git Behaviour [init] # scripts and hooks to add when creating a new local Git repository @@ -55,7 +59,7 @@ # Remove deleted remote branches from local repository prune = true -## ------ Security ------ ## +# --- Security # Use SSH key passphrase stored in MacOSX Keychain with ssh-add command # ssh-add --apple-use-keychain $HOME/.ssh/id_ed25519 diff --git a/git/config-company-macosx b/git/config-company-macosx index 38a5591..2d59bde 100644 --- a/git/config-company-macosx +++ b/git/config-company-macosx @@ -1,9 +1,9 @@ -# Company specific Git configuration +# Company MacOSX Git configuration # # Assumes use of MacOSX and ~ expansion not working for paths # Replace /Users/practicalli/ path with your own $HOME location -## -- Identity +# --- Identity # Add identity to all commits [user] name = Johnny Stevenson @@ -19,7 +19,7 @@ [github] user = practicalli-johnny -## -- Git Behaviour +# --- Git Behaviour [init] # scripts and hooks to add when creating a new local Git repository @@ -57,7 +57,7 @@ # Remove deleted remote branches from local repository prune = true -## -- Security +# --- Security # Use SSH key passphrase stored in MacOSX Keychain with ssh-add command # ssh-add --apple-use-keychain $HOME/.ssh/id_ed25519 @@ -73,7 +73,7 @@ allowedSignersFile = /Users/practicalli/.config/git/allowed-signatures-company -## -- Diff & Merge +# --- Diff & Merge # TODO: test configuration for p4merg tool on MacOSX diff --git a/git/config-johnny b/git/config-johnny index 876f4d3..5d7e8a4 100644 --- a/git/config-johnny +++ b/git/config-johnny @@ -1,4 +1,6 @@ -## -- Identity +# Personal Git configuration + +# --- Identity # Add identity to all commits [user] @@ -11,9 +13,3 @@ [github] user = practicalli-johnny - -## -- Git Behaviour - -[commit] - # Default commit message - useful if team has a commit message policy - template = ~/.config/git/commit-message-practicalli diff --git a/git/config-practicalli b/git/config-practicalli index 38eaffb..2b2e46d 100644 --- a/git/config-practicalli +++ b/git/config-practicalli @@ -1,32 +1,34 @@ -## ------ Identity ------ ## +# Practicalli Git Configuration +# +# for projects maintained by Practicalli +# all commits & tags are signed + +# --- Identity -# Add identity to all commits [user] + # Add identity to all commits name = Practicalli Engineering - - # Use GitHub no-reply email address to keep real address private email = "engineering@practical.li" - # SSH Key signing (commits & tags( + # SSH Key for signing signingkey = ~/.ssh/id_ed25519.pub -## Identity for using GitHub API [github] + # Identity for using GitHub API user = practicalli-johnny +# --- Security -## ------ Security ------ ## - -# Use SSH key to sign commits and tags [gpg] + # Use SSH key to sign commits and tags format = ssh -# Self-define SSH keys that should be considered authentic locally [gpg "ssh"] + # Self-define SSH keys that should be considered authentic locally allowedSignersFile = ~/.config/git/allowed-signatures -## ------ Git Behaviour ------ ## +# --- Git Behaviour [init] # scripts and hooks to add when creating a new local Git repository @@ -60,18 +62,24 @@ # Automatically sign every tag gpgsign = true -[fetch] - # Remove deleted remote branches from local repository - prune = true + +# --- Diff & Merge [diff] + # Neovim diff tool tool = nvimdiff +[difftool "nvimdiff"] + prompt = false + + +# [difftool "meld"] +# prompt = false + # [difftool "meld"] # cmd = meld \"$LOCAL\" \"$REMOTE\" # path = - [merge] # Include common parent when merge conflicts arise conflictstyle = diff3 @@ -80,12 +88,3 @@ # cmd = meld \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\" # trustExitCode = true - -[log] - abbrevCommit = true - -[push] - # Set local brach to track new remote branch automatically - # Requires Git 2.37.0 - autoSetupRemote = true -