include unchanged files in series_diff_start.sh
It's hard to compute how many files changed, because with renames and deletions it can look like more changed than exist now. It's easier to compute how many files *did not* change, by looking at which SHAs are referenced from the git trees at the start and end point. Change-Id: I9e565d3d31352921b81847528d09c6d733196352 Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
parent
6183870449
commit
ab9441327b
@ -62,6 +62,18 @@ function count_files() {
|
|||||||
git ls-files | wc -l
|
git ls-files | wc -l
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function shas_at_tag() {
|
||||||
|
# Produce a list of shas used by objects at the tag point
|
||||||
|
git ls-tree -lr $1 | cut -f3 -d' '
|
||||||
|
}
|
||||||
|
|
||||||
|
function count_unchanged_files() {
|
||||||
|
local start="$1"
|
||||||
|
local end="$2"
|
||||||
|
|
||||||
|
comm -12 <( shas_at_tag $start | sort ) <( shas_at_tag $end | sort ) | wc -l
|
||||||
|
}
|
||||||
|
|
||||||
for repo in $REPOS; do
|
for repo in $REPOS; do
|
||||||
clone_repo $repo
|
clone_repo $repo
|
||||||
cd $repo
|
cd $repo
|
||||||
@ -88,5 +100,8 @@ for repo in $REPOS; do
|
|||||||
git diff --stat ${base}..${latest} | tail -n 1
|
git diff --stat ${base}..${latest} | tail -n 1
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
echo "Unchanged files: $(count_unchanged_files $base $latest)"
|
||||||
|
echo
|
||||||
|
|
||||||
cd $MYTMPDIR
|
cd $MYTMPDIR
|
||||||
done
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user