diff options
author | Sasha Levin <sasha.levin@oracle.com> | 2015-11-01 19:12:01 -0500 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2015-11-01 19:12:01 -0500 |
commit | 07d27828aae06a38e9be677f3eb63a96e376dd4a (patch) | |
tree | 3423beffa7af73820280616e47421f47daf2ef16 | |
parent | b89182e21deb3cace5f78e0f1d0bc1452e51e1c5 (diff) | |
download | stable-tools-07d27828aae06a38e9be677f3eb63a96e376dd4a.tar.gz |
audit-commits
User readable output comparing range and current branch.
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
-rw-r--r-- | README | 10 | ||||
-rwxr-xr-x | stable-audit-range | 42 |
2 files changed, 52 insertions, 0 deletions
@@ -94,3 +94,13 @@ the conflicts and commit the changes, resuming by exiting the shell. This is useful as an automatic first pass to copy commits from another stable branch, the result should later be audited for correctness - the main purpose is to get the trivial things out of the way. + + +7) stable audit-range <commit range> + +Provides a human readable output comparing the commit range with the current +branch. This is a simple way to find out about commits not in current branch +and: + + - Tagged for stable and which other stable branches they are present in. + - Not tagged for stable, but are present in other stable branches. diff --git a/stable-audit-range b/stable-audit-range new file mode 100755 index 0000000..bc302ef --- /dev/null +++ b/stable-audit-range @@ -0,0 +1,42 @@ +#!/bin/bash + +. show-missing-iter + +function handle_stable { + others=$(stable find-alts $1) + if [ "$others" != "" ]; then + printf "Commit \"%s\" marked for stable and exists in the following branches:\n" "$(git log -1 --oneline $1)" + for j in $others; do + echo $(git branch -a --contains $j | sed 's/remotes\///g') + done + else + printf "Commit \"%s\" marked for stable but doesn't exist in any other branch\n" "$(git log -1 --oneline $1)" + fi + echo "" +} + +function handle_nonstable { + others=$(stable find-alts $1) + if [ "$others" != "" ]; then + printf "Commit \"%s\" isn't marked for stable but exists in the following branches:\n" "$(git log -1 --oneline $1)" + for j in $others; do + echo $(git branch -a --contains $j | sed 's/remotes\///g') + done + echo "" + fi +} + +function do_one { + if [ "$(git show $1 | grep -i 'stable@vger' | wc -l)" -gt 0 ]; then + handle_stable $1 + else + handle_nonstable $1 + fi +} + +if [ "$#" -ne 1 ]; then + echo "Usage: stable audit-range <commit range>" + exit 1 +fi + +show_missing_iter $1 do_one |