git write-tree)
}
-# collapsed_commit NAME
-# Produce a collapsed commit of branch NAME.
-collapsed_commit()
+create_tg_commit()
{
name="$1"
-
- rm -f "$playground/^pre" "$playground/^post"
- >"$playground/^body"
+ tree="$2"
+ parent="$3"
# Get commit message and authorship information
git cat-file blob "$name:.topmsg" | git mailinfo "$playground/^msg" /dev/null > "$playground/^info"
test -n "$GIT_AUTHOR_EMAIL" && export GIT_AUTHOR_EMAIL
test -n "$GIT_AUTHOR_DATE" && export GIT_AUTHOR_DATE
+ (printf '%s\n\n' "$SUBJECT"; cat "$playground/^msg") |
+ git stripspace |
+ git commit-tree "$tree" -p "$parent"
+}
+
+# collapsed_commit NAME
+# Produce a collapsed commit of branch NAME.
+collapsed_commit()
+{
+ name="$1"
+
+ rm -f "$playground/^pre" "$playground/^post"
+ >"$playground/^body"
+
# Determine parent
parent="$(cut -f 1 "$playground/$name^parents")"
if [ "$(cat "$playground/$name^parents" | wc -l)" -gt 1 ]; then
if branch_empty "$name"; then
echo "$parent";
else
- (printf '%s\n\n' "$SUBJECT"; cat "$playground/^msg") |
- git stripspace |
- git commit-tree "$(pretty_tree "$name")" -p "$parent"
+ create_tg_commit "$name" "$(pretty_tree $name)" "$parent"
fi;
echo "$name" >>"$playground/^ticker"