summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 39ee6ec)
raw | patch | inline | side by side (parent: 39ee6ec)
author | Avery Pennarun <apenwarr@gmail.com> | |
Fri, 2 Oct 2009 19:22:15 +0000 (15:22 -0400) | ||
committer | Avery Pennarun <apenwarr@gmail.com> | |
Fri, 2 Oct 2009 20:08:58 +0000 (16:08 -0400) |
Prefixes that differ only in the trailing slash should be considered
identical.
Also update the test to check that this works.
identical.
Also update the test to check that this works.
git-subtree.sh | patch | blob | history | |
test.sh | patch | blob | history | |
todo | patch | blob | history |
diff --git a/git-subtree.sh b/git-subtree.sh
index 454ce7ef2228fcd2698a0f3a21b0ffb48fa26951..0949fefe20112d7d03e3036286313453a6da156b 100755 (executable)
--- a/git-subtree.sh
+++ b/git-subtree.sh
if [ -z "$prefix" ]; then
die "You must provide the --prefix option."
fi
-dir="$prefix"
+dir="$(dirname "$prefix/.")"
if [ "$command" != "pull" ]; then
revs=$(git rev-parse $default --revs-only "$@") || exit $?
sq=
main=
sub=
- git log --grep="^git-subtree-dir: $dir\$" \
+ git log --grep="^git-subtree-dir: $dir/*\$" \
--pretty=format:'START %H%n%s%n%n%b%nEND%n' HEAD |
while read a b junk; do
debug "$a $b $junk"
revs="$2"
main=
sub=
- git log --grep="^git-subtree-dir: $dir\$" \
+ git log --grep="^git-subtree-dir: $dir/*\$" \
--pretty=format:'START %H%n%s%n%n%b%nEND%n' $revs |
while read a b junk; do
case "$a" in
index bed7f2790629a76d9ec58bf8cca5b51619dd2ef5..12b04565747cb995fb91c2dec8709690b367523c 100755 (executable)
--- a/test.sh
+++ b/test.sh
git fetch ../subproj sub1
git branch sub1 FETCH_HEAD
-git subtree add --prefix=subdir FETCH_HEAD
+git subtree add --prefix=subdir/ FETCH_HEAD
# this shouldn't actually do anything, since FETCH_HEAD is already a parent
git merge -m 'merge -s -ours' -s ours FETCH_HEAD
git commit -m 'sub9'
cd ../mainline
-split2=$(git subtree split --annotate='*' --prefix subdir --rejoin)
+split2=$(git subtree split --annotate='*' --prefix subdir/ --rejoin)
git branch split2 "$split2"
create subdir/main-sub10
index 5e72b2e5100bccbf820cf47269d8a66009d0a74f..7e44b0024fa35ae76f62875704fcd24e3f690c7d 100644 (file)
--- a/todo
+++ b/todo
one of the other git tools that git-subtree calls. Should
detect this situation and print the *real* problem.
- In fact, the prefix should *not* end with slash, and we
- should detect (and fix) it if it does. Otherwise the
- log message looks weird.
-
"pull --squash" should do fetch-synthesize-merge, but instead just
does "pull" directly, which doesn't work at all.