Multi-part branch names would be incorrectly split on the last slash and
not the first, causing these aliases to do the wrong thing. These need
the remote name which is the first element. Everything after the first
slash is the branch name, not the last slash.
Signed-off-by: Joe Groocock <me@frebib.net>
This broadly assumes that the "default" remote is called "origin", but
that's better than assuming that plus the default branch name.
Thanks to https://joshtronic.com/2020/08/09/how-to-get-the-default-git-branch/
Suggested-by: Chris Lane <chris@chrislane.com>
Signed-off-by: Joe Groocock <me@frebib.net>
In theory this should give a much cleaner commit log without all of the
noise from merge commits in poorly maintained repos.
Signed-off-by: Joe Groocock <me@frebib.net>
Most of these changes have no semantic bearing, but some of the warnings
specifically related to quoting fix some word-splitting and globbing
issues with certain scripts.
Signed-off-by: Joe Groocock <me@frebib.net>
This adds an optional argument to `cdt` to allow specifying the
temporary directory prefix instead of the default `tmp`. This also
shortens the random character string from 10 (GNU mktemp) to 8.
Signed-off-by: Joe Groocock <me@frebib.net>
I used to use these occasionally, but now I increasingly find myself
typing the commands out in full. They really don't save much time at
all.
Signed-off-by: Joe Groocock <me@frebib.net>
Sometimes SSH needs to be called without a pty as it breaks some
non-interactive workflows, such as `docker save | ssh .. docker load`.
Signed-off-by: Joe Groocock <me@frebib.net>
Recently I learnt that `docker rm -f` both stops and removes the
container in one go, without any races. It's much cleaner than the hack
from before so replace it outright.
Signed-off-by: Joe Groocock <me@frebib.net>
This prevents the sometimes lengthy waits whilst Docker spools months or
years of container logs into the shell scrollback, shortly to be
discarded. It's rare that more than the most 1000 recent lines will be
required, and those should probably use more specific cli invocations.
Signed-off-by: Joe Groocock <me@frebib.net>
After moving dotfiles around, these aliases became out of sync.
Dynamically detect the path of the 'aliases' file, and set 'dotfiles' to
use the XDG config directory.
Signed-off-by: Joe Groocock <me@frebib.net>
This is technically more of a restart than a reload, but it's the
closest thing without actually restarting the main pid.
Signed-off-by: Joe Groocock <me@frebib.net>