Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Only copy a commit if it has at least one nonidentical parent.
author
Avery Pennarun
<apenwarr@gmail.com>
Sun, 26 Apr 2009 21:07:16 +0000
(17:07 -0400)
committer
Avery Pennarun
<apenwarr@gmail.com>
Sun, 26 Apr 2009 21:07:16 +0000
(17:07 -0400)
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.
git-subtree.sh
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
a64f3a7
)
diff --git
a/git-subtree.sh
b/git-subtree.sh
index ffd3e0b865f5d12a42428e80c03f6272931ce878..90e22ad8be3952e5ef77492cb46a8850b61c10c6 100755
(executable)
--- a/
git-subtree.sh
+++ b/
git-subtree.sh
@@
-258,6
+258,7
@@
copy_or_skip()
assert [ -n "$tree" ]
identical=
assert [ -n "$tree" ]
identical=
+ nonidentical=
p=
gotparents=
for parent in $newparents; do
p=
gotparents=
for parent in $newparents; do
@@
-266,6
+267,8
@@
copy_or_skip()
if [ "$ptree" = "$tree" ]; then
# an identical parent could be used in place of this rev.
identical="$parent"
if [ "$ptree" = "$tree" ]; then
# an identical parent could be used in place of this rev.
identical="$parent"
+ else
+ nonidentical="$parent"
fi
# sometimes both old parents map to the same newparent;
fi
# sometimes both old parents map to the same newparent;
@@
-283,7
+286,7
@@
copy_or_skip()
fi
done
fi
done
- if [ -n "$identical" -a
"$gotparents" = " $
identical" ]; then
+ if [ -n "$identical" -a
-z "$non
identical" ]; then
echo $identical
else
copy_commit $rev $tree "$p" || exit $?
echo $identical
else
copy_commit $rev $tree "$p" || exit $?