git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org
Subject: Re: [RFC PATCH v2 4/4] read-tree: add --no-sparse to turn off sparse  hook
Date: Tue, 11 Aug 2009 08:38:03 +0700	[thread overview]
Message-ID: <fcaeb9bf0908101838k37751fclac5c572eb042138e@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.1.00.0908101842530.8324@intel-tinevez-2-302>

2009/8/10 Johannes Schindelin <Johannes.Schindelin@gmx.de>:
> Hi,
>
> On Mon, 10 Aug 2009, Nguyễn Thái Ngọc Duy wrote:
>
>> diff --git a/unpack-trees.c b/unpack-trees.c
>> index f407bf5..d087112 100644
>> --- a/unpack-trees.c
>> +++ b/unpack-trees.c
>> @@ -530,8 +530,10 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
>>       if (o->trivial_merges_only && o->nontrivial_merge)
>>               return unpack_failed(o, "Merge requires file-level merging");
>>
>> -     if (run_sparse_hook(o))
>> -             return unpack_failed(o, NULL);
>> +     if (!o->no_sparse_hook) {
>> +             if (run_sparse_hook(o))
>> +                     return unpack_failed(o, NULL);
>> +     }
>>
>
> IMHO this would read nicelier as
>
>        if (!o->no_sparse_hook && run_sparse_hook(o))
>                return unpack_failed(o, NULL);

Right.

>> diff --git a/unpack-trees.h b/unpack-trees.h
>> index ad21823..81eb2ef 100644
>> --- a/unpack-trees.h
>> +++ b/unpack-trees.h
>> @@ -30,6 +30,7 @@ struct unpack_trees_options {
>>                    skip_unmerged,
>>                    initial_checkout,
>>                    diff_index_cached,
>> +                  no_sparse_hook,
>>                    gently;
>
> Hmm.  I understand that the assumption is that memset(&opts, 0,
> sizeof(opts)); should give you a sensible default, but I cannot avoid
> noticing that "no_sparse_hook = 0" is a double negation, something to be
> avoided...

skip_sparse_hook then? :-)
-- 
Duy

  reply	other threads:[~2009-08-11  1:38 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-10 15:19 [RFC PATCH v2 0/4] Sparse checkout Nguyễn Thái Ngọc Duy
2009-08-10 15:19 ` [RFC PATCH v2 1/4] Prevent diff machinery from examining assume-unchanged entries on worktree Nguyễn Thái Ngọc Duy
2009-08-10 15:19   ` [RFC PATCH v2 2/4] gitignore: read from index if .gitignore is assume-unchanged Nguyễn Thái Ngọc Duy
2009-08-10 15:19     ` [RFC PATCH v2 3/4] unpack_trees(): add support for sparse checkout Nguyễn Thái Ngọc Duy
2009-08-10 15:19       ` [RFC PATCH v2 4/4] read-tree: add --no-sparse to turn off sparse hook Nguyễn Thái Ngọc Duy
2009-08-10 16:46         ` Johannes Schindelin
2009-08-11  1:38           ` Nguyen Thai Ngoc Duy [this message]
2009-08-11  5:13             ` Junio C Hamano
2009-08-11  6:50               ` Johannes Schindelin
2009-08-11  7:08                 ` Nguyen Thai Ngoc Duy
2009-08-10 16:41       ` [RFC PATCH v2 3/4] unpack_trees(): add support for sparse checkout Johannes Schindelin
2009-08-11  1:47         ` Nguyen Thai Ngoc Duy
2009-08-11  7:02           ` Johannes Schindelin
2009-08-10 16:33     ` [RFC PATCH v2 2/4] gitignore: read from index if .gitignore is assume-unchanged Johannes Schindelin
2009-08-11  1:57       ` Nguyen Thai Ngoc Duy
2009-08-11  8:12         ` Johannes Schindelin
2009-08-10 16:20   ` [RFC PATCH v2 1/4] Prevent diff machinery from examining assume-unchanged entries on worktree Johannes Schindelin
2009-08-11  1:34     ` Nguyen Thai Ngoc Duy
2009-08-11  6:45       ` Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fcaeb9bf0908101838k37751fclac5c572eb042138e@mail.gmail.com \
    --to=pclouds@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).