Re: [PATCH] unpack_trees(): skip trees that are the same in all input

Started by Junio C Hamano on Jun 15, 2016 · 2 messages from 2 authors · Last reply Jun 15, 2016

open the first message on its own page

Message details and related content
Nguyen Thai Ngoc Duy [off-list ref] writes:
On Thu, Dec 23, 2010 at 5:13 AM, Junio C Hamano [off-list ref] wrote:
quoted
@@ -447,6 +451,11 @@ static int traverse_trees_recursive(int n, unsigned long dirmask,
       struct traverse_info newinfo;
       struct name_entry *p;

+       if (!df_conflicts) {
+               int status = fast_forward_merge(n, dirmask, names, info);
+               if (status)
+                       return status;
+       }
Also skip the optimization when sparse checkout is active
(info->data->skip_sparse_checkout == 0). People may need to just
update skip-worktree bits and add/remove worktree files along the
line.
Sounds sensible and safer to special case that one, I would agree.

By the way, I think info->data->skip_sparse_checkout should be fixed by
renaming it to info->data->sparse_checkout.  The flag controls a special
case logic that should not be in effect unless explicitly asked, and
forcing normal codepath to say "If skip_sparse_checkout is not false, do
this" in double-negative is unnice than "If sparse_checkout is in effect,
please run this special case" when reading the code.
Message details and related content
On Thu, Dec 30, 2010 at 2:15 AM, Junio C Hamano [off-list ref] wrote:
By the way, I think info->data->skip_sparse_checkout should be fixed by
renaming it to info->data->sparse_checkout.  The flag controls a special
case logic that should not be in effect unless explicitly asked, and
forcing normal codepath to say "If skip_sparse_checkout is not false, do
this" in double-negative is unnice than "If sparse_checkout is in effect,
please run this special case" when reading the code.
It's something to do with zero value being "feature set by default".
Unless explicitly said otherwise, sparse checkout code should be in
effect so that skip-checkout bit is preserved in index. No, double
negation is not nice. But I don't know how I can set
unpack_trees_options.sparse_checkout = 1 by default.
-- 
Duy
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help