aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-08-01 10:23:08 -0400
committerShawn O. Pearce <spearce@spearce.org>2007-08-19 03:38:36 -0400
commitac053c02029d88c7ed4d7e92949a1586eb3f7704 (patch)
tree84e5e58df838e7f27d8cee33cb1fae6d0f7b6917 /t
parent1fdb649c6ac4cfc536983077b4851a1959cbc1c4 (diff)
downloadgit-ac053c02029d88c7ed4d7e92949a1586eb3f7704.tar.gz
git-ac053c02029d88c7ed4d7e92949a1586eb3f7704.tar.xz
Allow frontends to bidirectionally communicate with fast-import
The existing checkpoint command is very useful to force fast-import to dump the branches out to disk so that standard Git tools can access them and the objects they refer to. However there was not a way to know when fast-import had finished executing the checkpoint and it was safe to read those refs. The progress command can be used to make fast-import output any message of the frontend's choosing to standard out. The frontend can scan for these messages using select() or poll() to monitor a pipe connected to the standard output of fast-import. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 't')
-rwxr-xr-xt/t9300-fast-import.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index 5d82b0f1c..0595041af 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -885,4 +885,35 @@ test_expect_success \
git log --reverse --pretty=oneline O3 | sed s/^.*z// >actual &&
git diff expect actual'
+cat >input <<INPUT_END
+commit refs/heads/O4
+committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
+data <<COMMIT
+zstring
+COMMIT
+commit refs/heads/O4
+committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
+data <<COMMIT
+zof
+COMMIT
+progress Two commits down, 2 to go!
+commit refs/heads/O4
+committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
+data <<COMMIT
+zempty
+COMMIT
+progress Three commits down, 1 to go!
+commit refs/heads/O4
+committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
+data <<COMMIT
+zcommits
+COMMIT
+progress I'm done!
+INPUT_END
+test_expect_success \
+ 'O: progress outputs as requested by input' \
+ 'git-fast-import <input >actual &&
+ grep "progress " <input >expect &&
+ git diff expect actual'
+
test_done