Apparently marking subsections like `[section.subsection]` (toml-like)
is deprecated in the configuration. This commit fixes this by using the
recommended `[section "subsection"]` syntax.
See: https://git-scm.com/docs/git-config#_syntax
Added simple light/dark distinction for git diffs using delta.
Will use the TERM_DARK env variable which is set in the base
module functionality on opening a new term.
This means unfortunately git diffs will have the wrong color
when terms recently changed between light-dark but on opening
a new one the error is gone and it automatically adapts again
to the terminal background color.
Added a simple alteration of diff viewing to also be feasible side-by-side in
addition to the default (delta) diff viewing mode.
Use aliases `gdd` (and `gdds` for staged) to enable.
If difft command is installed we can git diff on syntactic changes only
using `gdy` (or `gdys` for staged) which will spit out a (treesitter)
syntax-aware side by side comparison.
Really nice for refactoring diffs.
Since I often use git for prose and textual writing, wordwise
diffs make a lot of sense to have quick access to. This commit
sets up a git-internal alias `git diffword` as well as an
even shorter `gdd` (diff) and `gdds` (diff staged) which
mimic the other diff aliases `gd`/`gds` already existing.
In addition to the existing `glg` and `glga` aliases for showing
one-line git logs for current or all branches, this commit adds
`glgd` and `glgad` for showing one-line git logs for current or
all branches *with date information*.
The date info comes from authoring date not committing date.
Added `git fetchall` (or `gfa`) alias which allows fetching the current
branch from all connected remotes simultaneously. May have some
unintended side effects when branches diverge, this is untested.
Using the `gcd` alias to checkout the development branch switches to, if
no `development` branch is found, the `staging` branch of a repository
automatically instead.
For git versions that support it, the aliases will use the newer
`switch` instruction instead of `checkout` for its use cases.
Creating a new branch through `gcb` is for example done by
`git switch -c` instead of the older `git checkout -b`.
Additionally streamlined git version checking to be a little faster and
to unify its approach on posix sh, bash and zsh instead of utilizing
individual checking functions.
Fixed bash alias loading for additional modules by loading both general
sh aliases as well as individual bash aliases.
Moved git stash push/save aliasing to split between bash/zsh shell since
zsh can check for the correct version of git to invoke push command
(only part of git since 2.13) and bash simply falls back to save.
Fixed 'pushall' option xargs error.
Added dealing with 'main' branch instead of 'master' branch in checkout
and rebase aliases, so that when invoking the commands it will default
to a master branch and fall back to a main branch before complaining
that no corresponding branch exists.
Should (silently) fix git repositories which switched to main in the
last few months, and simultaneously allows me to switch this repository
to main branch (already done.)
Every so often, when doing rebases, you need quick access to the git
rebase command to do something like '--edit-todo' or similar.
Every time, I tried to do `grb` since I already use these quick
shortcuts for `grbm` rebasing onto master, and `grbi`, `grbc` to rebase
interactively or continue one in progress. The base version is thus a
natural extension of the more detailed implementations of rebasing.
`git pushall` (aliased to gpa) will push the current branch to each
connected remote of the repository.
So, if you have gitlab, github and keybase connected as remotes, it will
push to each one in return. As with the normal push command, you can
specify which branch to push ('master', 'develop', ..) after the
command, or use `--all` to push all branches at once.
Added package diff-so-fancy and make diff use it by default for its
diffs by setting it as its diff-pager.
Added sanity function dsf which invokes diff-so-fancy if it exists or
degrades gracefully if it does not. Use this function for all git diff
needs.
Pre-fill the pager search term in git to enable jumping between changed
files with n/N.
Made git aliasing exit if no git executable is found (which should not
happen, but still) instead of putting all aliases into the conditional.
Added unified colors to git diffs.
Cleaned up formatting of the files.
Fixed git stash alias (gsta) not correctly detecting zsh shell for git
version guessing.
Set default options to automatically rebase on pull, automatically prune
on fetch, and automatically stash and squash on rebasing.
Also made git diff highlight moved code.
Changed url substitution to only work on pushing, so that we can always
make use of ssh keys but things like pulling through rust's cargo still
work.
Default to verbose diffs, even though we also set it in the alias.
Added general usage information. Made sure gitignore api is never called
without any arguments.
Made script fzf aware -- if it finds fzf it can be invoked without
arguments, if it does not it will display usage information instead.
The only file left in $HOME is .zshenv, which sets up zsh to source everything from XDG_CONFIG_HOME/zsh.
Shell files are split into sh and zsh directories, for global assignments (which should be posix compliant, work on any posix shell) like environemnt variables, xdg vars, and global aliases. zsh contains zsh specific customization (prompt customization, plugin loading, zsh completions).
Zsh initialization will pull from sh directory first, loading the respective mirror to its startup file (`.zprofile` loads `sh/profile` and `profile.d/*`, `.zshenv` loads `sh/env` and `sh/env.d/*` and `zsh/env.d/*`, `.zshrc` loads `sh/alias`, `sh/alias.d/*` and `zsh/alias.d/*`)
Once all is done, it will have loaded both global variables, aliases and settings, and zsh-only specifications. Other stow modules, if they want to add shell functionality, can include their aliases and functions in one of the above directories to automatically be picked up by zsh.
Added global git config file, following XDG specifications (putting it
under `XDG_CONFIG_HOME/git/config`).
Adding a small improvement to default dot session for tmux, so that its
log watcher now shows all refs and remote refs.