summaryrefslogtreecommitdiff
path: root/src/pack-objects.h
diff options
context:
space:
mode:
authorJameson Miller <jamill@microsoft.com>2013-09-19 14:52:57 -0400
committerJameson Miller <jamill@microsoft.com>2013-09-30 13:22:28 -0400
commitb176ededb7d226ac85809b3ec594d185e7e3e866 (patch)
treef0ee8577697aa284cc98ab6ff6ad05b485c87c69 /src/pack-objects.h
parent5b09db15d1041032c446f6141a9b41265fb253bc (diff)
downloadlibgit2-b176ededb7d226ac85809b3ec594d185e7e3e866.tar.gz
Initial Implementation of progress reports during push
This adds the basics of progress reporting during push. While progress for all aspects of a push operation are not reported with this change, it lays the foundation to add these later. Push progress reporting can be improved in the future - and consumers of the API should just get more accurate information at that point. The main areas where this is lacking are: 1) packbuilding progress: does not report progress during deltafication, as this involves coordinating progress from multiple threads. 2) network progress: reports progress as objects and bytes are going to be written to the subtransport (instead of as client gets confirmation that they have been received by the server) and leaves out some of the bytes that are transfered as part of the push protocol. Basically, this reports the pack bytes that are written to the subtransport. It does not report the bytes sent on the wire that are received by the server. This should be a good estimate of progress (and an improvement over no progress).
Diffstat (limited to 'src/pack-objects.h')
-rw-r--r--src/pack-objects.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/pack-objects.h b/src/pack-objects.h
index 8e7ba7f78..0c94a5a7a 100644
--- a/src/pack-objects.h
+++ b/src/pack-objects.h
@@ -16,6 +16,7 @@
#include "netops.h"
#include "git2/oid.h"
+#include "git2/pack.h"
#define GIT_PACK_WINDOW 10 /* number of objects to possibly delta against */
#define GIT_PACK_DEPTH 50 /* max delta depth */
@@ -79,6 +80,10 @@ struct git_packbuilder {
int nr_threads; /* nr of threads to use */
+ git_packbuilder_progress progress_cb;
+ void *progress_cb_payload;
+ double last_progress_report_time; /* the time progress was last reported */
+
bool done;
};