Skip to content

Instantly share code, notes, and snippets.

@oxyc
Created July 25, 2015 15:02
Show Gist options
  • Save oxyc/ffd0d3600c8535d98ba6 to your computer and use it in GitHub Desktop.
Save oxyc/ffd0d3600c8535d98ba6 to your computer and use it in GitHub Desktop.
add drupal module updates as separate git commits
# oneliner
for m in $(git status -s . | cut -c 4- | cut -d'/' -f1 | sort -u); do git status -s $m; read -p "Are you sure you want to add it? [y/N]" -n 1 -r; echo; if [[ $REPLY =~ ^[Yy]$ ]]; then git add -A "$m"; git commit -m "${m}: updated module"; fi; done
for module in $(git status -s . | cut -c 4- | cut -d'/' -f1 | sort -u); do
git status -s $module
read -p "Are you sure you want to add it? [y/N]" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
git add -A "$module"
git commit -m "${module}: updated module"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment