summaryrefslogtreecommitdiff
path: root/.config/git
diff options
context:
space:
mode:
Diffstat (limited to '.config/git')
-rw-r--r--.config/git/config44
1 files changed, 44 insertions, 0 deletions
diff --git a/.config/git/config b/.config/git/config
new file mode 100644
index 0000000..b7066e1
--- /dev/null
+++ b/.config/git/config
@@ -0,0 +1,44 @@
+[alias]
+ # Note on completion: contrib/completion/git-completion.bash
+ # understands the "function idiom"…
+ # ALIAS = "!f() { git CMD … ; } && f"
+ # … and will complete 'git ALIAS' like it completes 'git CMD'.
+ # For more complex functions that do not start with a 'git'
+ # command, aliases can request a completion strategy using an
+ # empty ':' statement:
+ # ALIAS = !f() { : git CMD ; … ; } && f
+
+ # Compare upstream...HEAD with upstream...push. Useful to
+ # answer questions like:
+ #
+ # * Will this rebase drop approvals?
+ #
+ # * What is up with that old worktree? HEAD is more recent
+ # than @{push}, but commits look similar; are they? If they
+ # are, HEAD is a simple rebase of @{push}; if not, HEAD has
+ # unpushed changes which need inspection.
+ cmp-push = "!f () { git diff-id @{u}... ; git diff-id @{u}...@{push} ; } && f"
+
+ # Get a patch-id for arbitrary diffs.
+ diff-id = "!f() { git diff \"$@\" | git patch-id ; } && f"
+
+[init]
+ # Whence branches grow.
+ defaultBranch = trunk
+
+[push]
+ # I do not often run unqualified 'git push', but I sometimes
+ # want to review @{push}, meaning "the public state of my
+ # feature branch, as visible on the push-remote, that I am
+ # about to clobber with -f"; e.g. to compare patch-id's.
+ #
+ # With 'push.default = simple' (the default), @{push} is
+ # unusable on feature branches:
+ # > cannot resolve 'simple' push to a single destination
+ #
+ # AFAIU, 'current' DWIM.
+ default = current
+
+# Set identity elsewhere, in places that more applications care about:
+# * user.email: EMAIL environment variable.
+# * user.name: /etc/passwd.