Skip to content

Instantly share code, notes, and snippets.

@jorgsk
jorgsk / git xargs.md
Last active November 25, 2022 09:26 — forked from pesterhazy/git xargs.md
git xargs: execute utility on files under source control

git xargs: execute utility on files in repository

Provides a new git command, git xargs, that runs an arbitrary shell command on all files under source control. Optionally you can specify a pathspec (such as a subpath or a glob expression), restricting the operation to a subset of the repository files.

As git xargs delegates the work to xargs(1), it supports all options provided by the version of xargs installed on your system.

Installation

"""
This script is a wrapper around veracrypt and zim that makes it easy to work
with notebooks that reside inside a veracrypt container.
The script does three things:
1) Mounts a veracrypt container to a target location.
2) Runs a zim notebook, intended to be located in the mounted partition.
3) Unmounts the partition when either Zim or this script exits.
Note: sudo session from mount might have expired. Be prepared to re-insert
sudo password.