Skip to content

Instantly share code, notes, and snippets.

@atdt
Created September 12, 2016 19:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atdt/e34a75bee67184ce3c7e6514624b389b to your computer and use it in GitHub Desktop.
Save atdt/e34a75bee67184ce3c7e6514624b389b to your computer and use it in GitHub Desktop.
Diff JavaScript (or any other type of file) across two production branches
#!/usr/bin/env bash
file_pattern='*.js' # Which files to consider
v1="php-1.28.0-wmf.18" # Base branch
v2="php-1.28.0-wmf.17" # Target branch
while IFS= read -r a; do
b="${a/$v1/$v2}"
diff -u "$a" "$b" # Change '-u' to '-q' if you only want
# to list which files have changed.
done < <(find "/srv/mediawiki/${v1}" -name "$file_pattern")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment