Only copy a commit if it has at least one nonidentical parent.
This is a simplification of the previous logic. I don't *think* it'll break anything. Results in far fewer useless merge commmits when playing with gitweb in the git project: git subtree split --prefix=gitweb --annotate='(split) ' 0a8f4f0^^..f2e7330 --onto=1130ef3 ...and it doesn't *seem* to eliminate anything important.
This commit is contained in:
parent
a64f3a7286
commit
49cf82288a
@ -258,6 +258,7 @@ copy_or_skip()
|
|||||||
assert [ -n "$tree" ]
|
assert [ -n "$tree" ]
|
||||||
|
|
||||||
identical=
|
identical=
|
||||||
|
nonidentical=
|
||||||
p=
|
p=
|
||||||
gotparents=
|
gotparents=
|
||||||
for parent in $newparents; do
|
for parent in $newparents; do
|
||||||
@ -266,6 +267,8 @@ copy_or_skip()
|
|||||||
if [ "$ptree" = "$tree" ]; then
|
if [ "$ptree" = "$tree" ]; then
|
||||||
# an identical parent could be used in place of this rev.
|
# an identical parent could be used in place of this rev.
|
||||||
identical="$parent"
|
identical="$parent"
|
||||||
|
else
|
||||||
|
nonidentical="$parent"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# sometimes both old parents map to the same newparent;
|
# sometimes both old parents map to the same newparent;
|
||||||
@ -283,7 +286,7 @@ copy_or_skip()
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -n "$identical" -a "$gotparents" = " $identical" ]; then
|
if [ -n "$identical" -a -z "$nonidentical" ]; then
|
||||||
echo $identical
|
echo $identical
|
||||||
else
|
else
|
||||||
copy_commit $rev $tree "$p" || exit $?
|
copy_commit $rev $tree "$p" || exit $?
|
||||||
|
Loading…
Reference in New Issue
Block a user