git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCHv2 0/5] refactor unpack-trees
@ 2017-01-09 19:46 Stefan Beller
  2017-01-09 19:46 ` [PATCHv2 1/5] unpack-trees: move checkout state into check_updates Stefan Beller
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Stefan Beller @ 2017-01-09 19:46 UTC (permalink / raw)
  To: gitster, peff, l.s.r; +Cc: git, Stefan Beller

v2:

* Fixed the return type to be unsigned in patch 4.

This replaces origin/rs/unpack-trees-reduce-file-scope-global,
the first patch has the following diff to that branch
diff --git a/unpack-trees.c b/unpack-trees.c
index edf9fa2f6c..8e6768f283 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -221,10 +221,11 @@ static void unlink_entry(const struct cache_entry *ce)
 static int check_updates(struct unpack_trees_options *o)
 {
        unsigned cnt = 0, total = 0;
+       int i, errs = 0;
+
        struct progress *progress = NULL;
        struct index_state *index = &o->result;
        struct checkout state = CHECKOUT_INIT;
-       int i, errs = 0;
 
        state.force = 1;
        state.quiet = 1;
        
Thanks,
Stefan

v1:
unpack-trees is a central file needed for the understanding
of working tree manipulation. To help with the understanding
refactor the code to be more readable.

The first patch was a standalone patch 8 days ago;
now incorporated into this series as a v3,
reducing the scope of the checkout state.

The second patch removes a single continue statement;
it needed some digging to explain, but looks trivial.

The last 3 patches shorten the check_updates function by adding more
functions. If we ever want to parallelize file IO then these smaller
functions would be the scope to do it, keeping the check_updates as
a high level function guiding through the steps what is happening during
a working tree update.

Thanks,
Stefan

Stefan Beller (5):
  unpack-trees: move checkout state into check_updates
  unpack-trees: remove unneeded continue
  unpack-trees: factor progress setup out of check_updates
  unpack-trees: factor file removal out of check_updates
  unpack-trees: factor working tree update out of check_updates

 unpack-trees.c | 96 ++++++++++++++++++++++++++++++++++++++--------------------
 1 file changed, 64 insertions(+), 32 deletions(-)

-- 
2.11.0.31.g919a8d0.dirty


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-01-10 21:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-09 19:46 [PATCHv2 0/5] refactor unpack-trees Stefan Beller
2017-01-09 19:46 ` [PATCHv2 1/5] unpack-trees: move checkout state into check_updates Stefan Beller
2017-01-09 19:46 ` [PATCHv2 2/5] unpack-trees: remove unneeded continue Stefan Beller
2017-01-10 19:55   ` Junio C Hamano
2017-01-09 19:46 ` [PATCHv2 3/5] unpack-trees: factor progress setup out of check_updates Stefan Beller
2017-01-09 19:46 ` [PATCHv2 4/5] unpack-trees: factor file removal " Stefan Beller
2017-01-10 20:05   ` Junio C Hamano
2017-01-10 20:51     ` Stefan Beller
2017-01-10 21:34       ` Junio C Hamano
2017-01-09 19:46 ` [PATCHv2 5/5] unpack-trees: factor working tree update " Stefan Beller

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).