Commit graph

43 commits

Author SHA1 Message Date
2f69b955d2
git: Fix deprecated subsection config syntax
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
2024-01-11 17:41:11 +01:00
8aec761a20
git: Fix diff dark light setting automation 2023-12-12 16:35:55 +01:00
48ed4818f2
git: Fix branch switch alias
Fixed alias `gcb` to switch to a branch if it exists and if not create it.
2023-12-12 12:29:40 +01:00
b6687145bd
git: Make git diff termcolor aware
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.
2023-12-12 12:19:41 +01:00
62ec2799c8
git: Add side-by-side diff
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.
2023-12-12 12:17:19 +01:00
13c87f365d
git: Add difftastic syntax diffing
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.
2023-12-12 12:15:51 +01:00
0acfe2d5d0
git: Add word-wise diff as quick alias
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.
2023-10-05 18:09:48 +02:00
f8cd642555
git: Remove left-over dsf
Diff-so-fancy is replaced by delta.
2023-10-03 15:38:49 +02:00
893c177358
git: Replace dsf with git-delta
Diff-so-fancy is pretty good but delta just looks soo buttery smooth.
2023-10-02 20:19:00 +02:00
0fcac78b1f
git: Add date-enabled short log aliases
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.
2023-10-02 19:10:27 +02:00
9e43483fd8
git: Fix formatting alignments 2023-08-29 22:34:19 +02:00
e418e2508f
git: Add sendmail configuration
Added configuration to use git for direct patch contributions through
mail. Uses msmtp for mail agent.
2022-11-25 16:44:43 +01:00
892544df8e
git: Add fetchall alias
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.
2022-11-04 15:14:54 +01:00
b67ceb1330
git: Update commit signature key 2022-10-08 17:49:00 +02:00
792e0b930a
git: Development checkout also switched to Staging
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.
2022-01-28 10:14:20 +01:00
333e2580f0
git: Add personal git server substitutions
Added automatic aliasing for my own git server pushing and pulling.
2021-12-15 17:38:10 +01:00
23be9c64c9
git: Change gco to git checkout
It happens too often that you want to `gco` a specific commit or tag for
switch to always be useful in every scenario with the shortcut.
2021-12-04 11:23:03 +01:00
df0cf3d540
git: Use switch instead of checkout if available
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.
2021-11-23 10:42:45 +01:00
1d66b763cb
git: Fix shellcheck zsh static analysis detection 2021-07-08 12:11:23 +02:00
bb9030f885
bash: Fix git stash alias setting
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.
2021-07-07 10:24:04 +02:00
f4400da743
repo: Update linting for 4-spaced shell scripts 2021-04-04 20:52:52 +02:00
78e678fe1f
git: Add main branch methods, Fix pushall
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.)
2021-03-14 13:02:47 +01:00
98cb2ba48c
git: Add basic git rebase quick-alias
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.
2020-09-18 17:17:48 +02:00
df12199fdb
git: Add git pushall alias
`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.
2020-09-18 17:12:21 +02:00
4453e4d94e
git: Update to rotated gpg key 2020-09-12 17:35:21 +02:00
d3fbe7f4d6
git: Fix whitespace formatting 2020-07-23 12:25:46 +02:00
f542c418eb
[git] Add git last alias
Added git alias to show the contents of the last commit. Either use the
long form `git last`, or its alias `gll`.
2020-05-28 14:01:50 +02:00
d6a2ee7b8a
[git] Add diff-so-fancy as git diff
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.
2020-05-28 13:51:02 +02:00
17f8ca062d
[git] Clean up config formatting, color diffs
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.
2020-05-28 13:35:15 +02:00
e9feecc440
[git] Fix git stash alias,set default pull options
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.
2020-05-25 17:36:27 +02:00
1ae92cfc2a
[bash] Fix bash profile initialization
Removed automatic initializations of zsh functions.
Fixed not calling correct folders for bash aliases, environment
variables and profile settings.
2020-05-19 17:34:28 +02:00
7648d9c8d3
[git] Change to only ssh pushing, verbose diffs
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.
2020-03-03 09:43:36 +01:00
92a01d99ee
[git] Substitute git for https connections
When git is invoked with https for either github or gitlab then
automatically switch it out to git@server.com
2020-02-20 22:47:00 +01:00
c76b0d0223
Sign commits by default
By default use the gpg signing key to sign any commit made from this
machine, or with the help of these dotfiles.
2020-02-07 22:36:00 +01:00
8741bbac24 Add git module README 2020-02-06 15:09:22 +01:00
d411be708e Add gitignore usage information, fix empty api calls
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.
2020-02-06 15:07:55 +01:00
667595d2fb Fix static analysis 2020-02-04 15:27:44 +01:00
3668e11bbe Add git add interactive alias
Use gai to quickly reach interactive add mode.
2020-02-04 11:37:08 +01:00
2c374249d4 Move git aliases to git stow module 2020-02-04 10:06:33 +01:00
1684aaa50f Add gitignore function 2020-02-02 18:34:35 +01:00
87308cbce9 Add git merge merge request on sucess alias
Works for gitlab.com, will merge a MR when the pipeline has finished
running sucessfully.
2020-02-02 16:13:51 +01:00
6380affb6f Add basic XDG compliant sh architecture
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.
2020-02-02 15:08:40 +00:00
7ebcce8e82 Add global gitconfig, improve glog display
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.
2020-02-01 11:15:22 +01:00