GitHunt
AL

alblue/scripts

Useful scripts that I find handy to work with

@alblue's scripts

The scripts contained in this repository are mainly intended for use on macOS,
by providing utilities that are not otherwise available on an out-of-the-box
install. They either use Bash, Sh or Docker to achieve their goals.

These scripts are provided with no warranty, express or implied, and are
released under the MIT license.

If you clone this repository and add the scripts to your PATH, please be aware
that subsequent updates to this repository may cause (un)intentional changes.
You should review updates and use them at your own risk.

Docker scripts

  • dimages - List images in helpful drun format for easy execution
  • dkill - Kill the most recent docker container
  • drun - Run a docker image with sane defaults and supporting ssh; see also drun-README.md
  • dstop - Stop the most recent docker container

Scripts utilising Docker

These scripts use Docker to run an equivalent Ubuntu command, and so will
require that Docker is installed and running in order to use them. Errors will
be reported otherwise.

The associated command-Dockerfile contains the definition for building the
docker image locally; these will be used to automatically populate the docker
images on first use.

  • ctags - Generate ctags automatically when switching branches
  • jq - Command-line JSON processor
  • perf - Allows perf commands to be run under a Docker image
  • shellcheck - Provides a wrapper around Ubuntu's shellcheck
  • vfind - Find a file and open it for editing in vi (or other editor)

Git commands

Since you can use git foo to run a command git-foo, any shell script that
begins with git- can extend the functionality of your git environment.

  • git-all - Executes the following git command on each subfolder
  • git-browse - Open up the commit in a web browser
  • git-change - Changes all copies of a pattern with a string
  • git-fixup - Fixes up a previous commit
  • git-foreach - Executes command over submodules without stopping
  • git-forget - Forgets local changes to a file for testing
  • git-push-ready - Pushes a Gerrit change as ready for review
  • git-push-wip - Pushes a Gerrit change as a work-in-progress
  • git-undo - Undoes local changes to a file

Git hooks

These hooks can be integrated into a git workflow for various operations. They
can be symlinked (or copied) from the .git/hooks directory with the appropriate
name.

Other utilities

These scripts provide useful functionality but don't fall into one of the categories above.

Languages

Shell90.9%Awk9.1%

Contributors

MIT License
Created February 15, 2020
Updated February 10, 2026