Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Fix splitting after using a squash merge.
author
Avery Pennarun
<apenwarr@gmail.com>
Sat, 30 May 2009 07:33:39 +0000
(
03:33
-0400)
committer
Avery Pennarun
<apenwarr@gmail.com>
Sat, 30 May 2009 07:33:39 +0000
(
03:33
-0400)
git-subtree.sh
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
eb4fb91
)
diff --git
a/git-subtree.sh
b/git-subtree.sh
index f7fe11117869460aad9f572cf0302b5f06ee0563..1fff10e8543279e8c46f3d47a4dc73b42d5f55be 100755
(executable)
--- a/
git-subtree.sh
+++ b/
git-subtree.sh
@@
-203,13
+203,17
@@
find_existing_splits()
dir="$1"
revs="$2"
git log --grep="^git-subtree-dir: $dir\$" \
dir="$1"
revs="$2"
git log --grep="^git-subtree-dir: $dir\$" \
- --pretty=format:'%s%n%n%b%nEND%n' $revs |
+ --pretty=format:'
START %H%n
%s%n%n%b%nEND%n' $revs |
while read a b junk; do
case "$a" in
while read a b junk; do
case "$a" in
- START) main="$b" ;;
+ START) main="$b"
; sq="$b"
;;
git-subtree-mainline:) main="$b" ;;
git-subtree-split:) sub="$b" ;;
END)
git-subtree-mainline:) main="$b" ;;
git-subtree-split:) sub="$b" ;;
END)
+ if [ -z "$main" -a -n "$sub" ]; then
+ # squash commits refer to a subtree
+ cache_set "$sq" "$sub"
+ fi
if [ -n "$main" -a -n "$sub" ]; then
debug " Prior: $main -> $sub"
cache_set $main $sub
if [ -n "$main" -a -n "$sub" ]; then
debug " Prior: $main -> $sub"
cache_set $main $sub