Skip to content

Instantly share code, notes, and snippets.

@okhlybov
Created August 26, 2019 15:22
Show Gist options
  • Save okhlybov/78899b6064971629310af81f543322c2 to your computer and use it in GitHub Desktop.
Save okhlybov/78899b6064971629310af81f543322c2 to your computer and use it in GitHub Desktop.
(ba)sh function to generate a patch between $dir and $dir.orig subdirectories found in current directory
# (ba)sh function to generate a patch between $dir and $dir.orig subdirectories found in current directory
2diff() {
orig=`find . -maxdepth 1 -type d -and \( -name '*.org' -or -name '*.orig' \) -printf '%P'`
base=`echo $orig | sed 's/\.\(org\|orig\)$//'`
LANG=C diff -urN $orig $base
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment