chiark
/
gitweb
/
~ian
/
topgit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'i/build' into refs/top-bases/i/basis-merge
[topgit.git]
/
tg-export.sh
diff --git
a/tg-export.sh
b/tg-export.sh
index 90f7c6a6dfcf739a6f89061e4e89f33aa810a292..d68a6acd6d7286fabb1e59fde256dea29283d0f1 100644
(file)
--- a/
tg-export.sh
+++ b/
tg-export.sh
@@
-63,22
+63,11
@@
fi
# $name is equal to the last of the list of branches
# $name is equal to the last of the list of branches
-playground="$(mktemp -d -t tg-export.XXXXXX)"
-trap 'rm -rf "$playground"' EXIT
+playground="$(get_temp tg-export -d)"
## Collapse driver
## Collapse driver
-# pretty_tree NAME
-# Output tree ID of a cleaned-up tree without tg's artifacts.
-pretty_tree()
-{
- (export GIT_INDEX_FILE="$playground/^index"
- git read-tree "$1"
- git update-index --force-remove ".topmsg" ".topdeps"
- git write-tree)
-}
-
create_tg_commit()
{
name="$1"
create_tg_commit()
{
name="$1"
@@
-119,7
+108,7
@@
collapsed_commit()
echo "TopGit-driven merge of branches:"
echo
cut -f 2 "$playground/$name^parents"
echo "TopGit-driven merge of branches:"
echo
cut -f 2 "$playground/$name^parents"
- } | git commit-tree "$(pretty_tree "
refs/top-bases/$name"
)" \
+ } | git commit-tree "$(pretty_tree "
$name" -b
)" \
$(for p in $parent; do echo -p $p; done))"
fi
$(for p in $parent; do echo -p $p; done))"
fi
@@
-191,8
+180,8
@@
quilt()
echo "Skip empty patch $_dep";
else
if "$numbered"; then
echo "Skip empty patch $_dep";
else
if "$numbered"; then
- number="$(
printf "%04u"
$(($(cat "$playground/^number" 2>/dev/null) + 1)))";
- bn="$
number-$bn
";
+ number="$(
echo
$(($(cat "$playground/^number" 2>/dev/null) + 1)))";
+ bn="$
(printf "%04u-$bn" $number)
";
echo "$number" >"$playground/^number";
fi;
echo "$number" >"$playground/^number";
fi;
@@
-222,22
+211,25
@@
linearize()
# already included, just skip
:;
else
# already included, just skip
:;
else
- git merge -s recursive "$_dep";
- retmerge="$?";
+ retmerge=0;
+
+ git merge -s recursive "$_dep" || retmerge="$?";
if test "x$retmerge" != "x0"; then
echo fix up the merge, commit and then exit;
#todo error handling
if test "x$retmerge" != "x0"; then
echo fix up the merge, commit and then exit;
#todo error handling
- sh -i
+ sh -i
</dev/tty;
fi;
fi;
else
fi;
fi;
else
- git merge-recursive "$(pretty_tree "refs/top-bases/$_dep")" -- HEAD "$(pretty_tree "refs/heads/$_dep")";
- retmerge="$?";
+ retmerge=0;
+
+ git merge-recursive "$(pretty_tree "$_dep" -b)" -- HEAD "$(pretty_tree "refs/heads/$_dep")" || retmerge="$?";
if test "x$retmerge" != "x0"; then
if test "x$retmerge" != "x0"; then
+ git rerere;
echo "fix up the merge and update the index. Don't commit!"
#todo error handling
echo "fix up the merge and update the index. Don't commit!"
#todo error handling
- sh -i
+ sh -i
</dev/tty;
fi
result_tree=$(git write-tree)
fi
result_tree=$(git write-tree)