2 # See the discussion at https://stackoverflow.com/q/67724347/7976758
5 echo "Usage $0 from_commit [to_commit]"
9 if [ -z "$prog_dir" -o -z "$prog_name" ]; then
11 prog_dir="`dirname \"$0\"`"
12 prog_name="`basename \"$0\"`"
17 export prog_dir prog_name
21 to_commit="${2:-HEAD}"
22 export from_commit to_commit
25 git --no-pager diff --name-only "$from_commit" "$to_commit"
27 git submodule foreach '
28 # In submodule "$name"
29 prev_commit=`(git -C "$toplevel" ls-tree "$from_commit" "$sm_path" | awk "{print \\$3}")`
30 curr_commit=`(git -C "$toplevel" ls-tree "$to_commit" "$sm_path" | awk "{print \\$3}")`
31 "$prog_dir/$prog_name" $prev_commit $curr_commit