Fix cg-log -f option so that a complete list of files is displayed when a commit has more than one parent. Signed-off-by: Sean Estabrooks Signed-off-by: Jonas Fonseca --- commit 06a6b40f8e52eff0e34706c7024b54df50abb6b9 tree 95bc73fd188347aa294991d1c5c7cffd60422098 parent 4ed293bc0a5ffca9683e139cad499b69a4c4d569 author jonas Mon, 09 May 2005 13:23:20 +0200 committer jonas Mon, 09 May 2005 13:23:20 +0200 cg-log | 34 +++++++++++++++------------------- 1 files changed, 15 insertions(+), 19 deletions(-) Index: cg-log =================================================================== --- 00b94eea5b99d5dd1d1bbe9c9ca3502d11aec581/cg-log (mode:100755) +++ 95bc73fd188347aa294991d1c5c7cffd60422098/cg-log (mode:100755) @@ -53,17 +53,20 @@ list_commit_files() { - tree1="$1" - tree2="$2" + tree="$1" sep=" * $colfiles" - # List all files for for the initial commit - if [ -z $tree2 ]; then - list_cmd="git-ls-tree $tree1" - else - list_cmd="git-diff-tree -r $tree1 $tree2" - fi echo - $list_cmd | while read modes type sha1s file; do + if [ -z $2 ]; then + # List all files for the initial commit + git-ls-tree $tree + else + shift + # List changes from each parent + for parent; do + git-diff-tree -r $tree $parent + done + fi | sort -u | \ + while read modes type sha1s file; do echo -n "$sep$file" sep=", " done @@ -102,8 +105,7 @@ $revls | $revsort | while read time commit parents; do trap exit SIGPIPE - tree1= - tree2= + trees= [ "$revfmt" = "git-rev-list" ] && commit="$time" if [ $# -ne 0 ]; then parent=$(git-cat-file commit $commit | sed -n '2s/parent //p;2Q') @@ -131,17 +133,11 @@ fi ;; "tree"|"parent") - if [ -z $tree1 ]; then - tree1=$rest - elif [ -z $tree2 ]; then - tree2=$rest - fi + trees="$trees $rest" echo $colheader$key $rest $coldefault ;; "") - if [ -n "$list_files" ]; then - list_commit_files "$tree1" "$tree2" - fi + [ -n "$list_files" ] && list_commit_files $trees echo; sed -re ' / *Signed-off-by:.*/Is//'$colsignoff'&'$coldefault'/ / *Acked-by:.*/Is//'$colsignoff'&'$coldefault'/