Skip to content

Instantly share code, notes, and snippets.

@MBtech
Last active June 1, 2016 09:17
Show Gist options
  • Select an option

  • Save MBtech/400404173de4081d77b053b50e28870b to your computer and use it in GitHub Desktop.

Select an option

Save MBtech/400404173de4081d77b053b50e28870b to your computer and use it in GitHub Desktop.
This bash one liner can be used to display the number of configurations for all the branches of Storm and Flink
#For Storm
git ls-remote --heads origin | sed 's?.*refs/heads/??' | xargs -I {} sh -c 'git reset; git checkout .; git clean -fdx; git checkout origin/{} >/dev/null 2>&1; echo $(grep "[^#]" conf/defaults.yaml 2>/dev/null | wc -l ) {};' | sort -k 1 -n
#For Flink
git ls-remote --heads origin | sed 's?.*refs/heads/??' | xargs -I {} ../script.sh {} | sort -k 1 -n
#Script
#!/bin/bash
git reset
git checkout .
git clean -fdx
git checkout origin/$1 >/dev/null 2>&1
echo $(awk '/Configuration Keys/,/Default Values/' flink-core/src/main/java/org/apache/flink/configuration/ConfigConstants.java 2>/dev/null | grep "public static final String" | wc -l) $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment