X-Git-Url: https://git.phdru.name/?p=git-scripts.git;a=blobdiff_plain;f=submodules%2Fdiff-name-only;h=2209563f725ee62693257002f8642a77254d115d;hp=d5136135e5d2e5e4369b36f3b49a6f3a4ea9bfa1;hb=05a269340e7584e2a963c07907ce706bdcb8ee53;hpb=7ca782188bb509b1ba815f6842834509611f4687 diff --git a/submodules/diff-name-only b/submodules/diff-name-only index d513613..2209563 100755 --- a/submodules/diff-name-only +++ b/submodules/diff-name-only @@ -8,13 +8,14 @@ fi from_commit="$1" to_commit="${2:-HEAD}" +export from_commit to_commit # In the superproject git --no-pager diff --name-only "$from_commit" "$to_commit" -git submodule foreach " - # In submodule \"\$name\" - prev_commit=\`(git -C \"\$toplevel\" ls-tree "$from_commit" \"\$sm_path\" | awk '{print \$3}')\` - curr_commit=\`(git -C \"\$toplevel\" ls-tree "$to_commit" \"\$sm_path\" | awk '{print \$3}')\` - git --no-pager diff --name-only \$prev_commit \$curr_commit -" +git submodule foreach ' + # In submodule "$name" + prev_commit=`(git -C "$toplevel" ls-tree "$from_commit" "$sm_path" | awk "{print \\$3}")` + curr_commit=`(git -C "$toplevel" ls-tree "$to_commit" "$sm_path" | awk "{print \\$3}")` + git --no-pager diff --name-only $prev_commit $curr_commit +'