diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2016-04-05 21:21:20 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-04-05 21:23:48 -0700 |
commit | a1332ce36148e097fe7a9d7764bc02152d3b8425 (patch) | |
tree | 0b43d05c291779c4be0f73d0735604a9dca9f464 /core/save-git.c | |
parent | afb5bb8b06b079ffbccc970554733e63ee77b5b5 (diff) | |
download | subsurface-a1332ce36148e097fe7a9d7764bc02152d3b8425.tar.gz |
Simplify git tracking of git tree creation
With Linus' changes to the tree creation saving the dives is no longer
the dominant part of that process, so simplify the output (which also
removes the hacky buggy code to show the percentages that is of course
totally bogus).
(apparently a couple of white space cleanups snuck into this patch)
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/save-git.c')
-rw-r--r-- | core/save-git.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/core/save-git.c b/core/save-git.c index f2803c315..a8120cfeb 100644 --- a/core/save-git.c +++ b/core/save-git.c @@ -923,6 +923,7 @@ static int create_git_tree(git_repository *repo, struct dir *root, bool select_o struct dive *dive; dive_trip_t *trip; + git_storage_update_progress(20, "start create git tree"); save_settings(repo, root); save_divesites(repo, root); @@ -931,19 +932,11 @@ static int create_git_tree(git_repository *repo, struct dir *root, bool select_o trip->index = 0; /* save the dives */ - int notify_increment = dive_table.nr > 10 ? dive_table.nr / 10 : 1; - int last_threshold = 0; + git_storage_update_progress(22, "start saving dives"); for_each_dive(i, dive) { struct tm tm; struct dir *tree; - char buf[] = "save dives x0%"; - if (i / notify_increment > last_threshold) { - // notify of progress - we cover the range of 20..50 - last_threshold = i / notify_increment; - buf[11] = last_threshold + '0'; - git_storage_update_progress(20 + 3 * last_threshold, buf); - } trip = dive->divetrip; @@ -972,6 +965,7 @@ static int create_git_tree(git_repository *repo, struct dir *root, bool select_o save_one_dive(repo, tree, dive, &tm, cached_ok); } + git_storage_update_progress(25, "done creating git tree"); return 0; } @@ -1196,7 +1190,7 @@ int do_git_save(git_repository *repo, const char *branch, const char *remote, bo { struct dir tree; git_oid id; - bool cached_ok; + bool cached_ok; if (verbose) fprintf(stderr, "git storage: do git save\n"); @@ -1204,12 +1198,12 @@ int do_git_save(git_repository *repo, const char *branch, const char *remote, bo if (!create_empty) // so we are actually saving the dives git_storage_update_progress(19, "start git save"); - /* - * Check if we can do the cached writes - we need to - * have the original git commit we loaded in the repo - */ - cached_ok = try_to_find_parent(saved_git_id, repo); - + /* + * Check if we can do the cached writes - we need to + * have the original git commit we loaded in the repo + */ + cached_ok = try_to_find_parent(saved_git_id, repo); + /* Start with an empty tree: no subdirectories, no files */ tree.name[0] = 0; tree.subdirs = NULL; |