rebase -i: Document how temporary files are used
Add documentation, inferred by reverse-engineering, about how git-rebase--interactive.sh uses many of its temporary files. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty committed
Jan 14, 2010 at 06:54 UTC
80883bb30a9c0c41f3b4975874f8f5e527396543
1 file changed
+34
-7
git-rebase--interactive.sh
+34
-7
@@ -34,11 +34,45 @@ root rebase all reachable commmits up to the root(s)
34
require_work_tree
35
36
DOTEST="$GIT_DIR/rebase-merge"
37
+
38
+# The file containing rebase commands, comments, and empty lines.
39
+# This file is created by "git rebase -i" then edited by the user. As
40
+# the lines are processed, they are removed from the front of this
41
+# file and written to the tail of $DONE.
42
TODO="$DOTEST"/git-rebase-todo
43
+
44
+# The rebase command lines that have already been processed. A line
45
+# is moved here when it is first handled, before any associated user
46
+# actions.
47
DONE="$DOTEST"/done
48
+
49
+# The commit message that is planned to be used for any changes that
50
+# need to be committed following a user interaction.
51
MSG="$DOTEST"/message
52
+
53
+# The file into which is accumulated the suggested commit message for
54
+# squash/fixup commands. When the first of a series of squash/fixups
55
+# is seen, the file is created and the commit message from the
56
+# previous commit and from the first squash/fixup commit are written
57
+# to it. The commit message for each subsequent squash/fixup commit
58
+# is appended to the file as it is processed.
59
+#
60
+# The first line of the file is of the form
61
+# # This is a combination of $COUNT commits.
62
+# where $COUNT is the number of commits whose messages have been
63
+# written to the file so far (including the initial "pick" commit).
64
+# Each time that a commit message is processed, this line is read and
65
+# updated. It is deleted just before the combined commit is made.
66
SQUASH_MSG="$DOTEST"/message-squash
67
+
68
+# $REWRITTEN is the name of a directory containing files for each
69
+# commit that is reachable by at least one merge base of $HEAD and
70
+# $UPSTREAM. They are not necessarily rewritten, but their children
71
+# might be. This ensures that commits on merged, but otherwise
72
+# unrelated side branches are left alone. (Think "X" in the man page's
73
+# example.)
74
REWRITTEN="$DOTEST"/rewritten
75
+
76
DROPPED="$DOTEST"/dropped
77
PRESERVE_MERGES=
78
STRATEGY=
@@ -683,13 +717,6 @@ first and then run 'git rebase --continue' again."
717
test t = "$VERBOSE" && : > "$DOTEST"/verbose
718
if test t = "$PRESERVE_MERGES"
719
then
686
- # $REWRITTEN contains files for each commit that is
687
- # reachable by at least one merge base of $HEAD and
688
- # $UPSTREAM. They are not necessarily rewritten, but
689
- # their children might be.
690
- # This ensures that commits on merged, but otherwise
691
- # unrelated side branches are left alone. (Think "X"
692
- # in the man page's example.)
720
if test -z "$REBASE_ROOT"
721
then
722
mkdir "$REWRITTEN" &&