All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 11/16] unpack_trees(): add support for narrow checkout
Date: Mon, 15 Sep 2008 12:34:57 -0700	[thread overview]
Message-ID: <7vsks1b3tq.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: 1221397685-27715-12-git-send-email-pclouds@gmail.com

Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:

> diff --git a/cache.h b/cache.h
> index 2b2c90f..1fc0f83 100644
> --- a/cache.h
> +++ b/cache.h
> @@ -167,6 +167,9 @@ struct cache_entry {
>  #define CE_HASHED    (0x100000)
>  #define CE_UNHASHED  (0x200000)
>  
> +/* Only remove in work directory, not index */
> +#define CE_WD_REMOVE (0x400000)
> +
>  /*
>   * Extended on-disk flags
>   */
> diff --git a/unpack-trees.c b/unpack-trees.c
> index e59d144..968cc98 100644
> --- a/unpack-trees.c
> +++ b/unpack-trees.c
> @@ -96,6 +96,15 @@ static int check_updates(struct unpack_trees_options *o)
>  	if (o->update && o->verbose_update) {
>  		for (total = cnt = 0; cnt < index->cache_nr; cnt++) {
>  			struct cache_entry *ce = index->cache[cnt];
> +
> +			if (ce->ce_flags & CE_WD_REMOVE) {
> +				total++;
> +				continue;
> +			}
> +
> +			if (ce_no_checkout(ce))
> +				continue;
> +
>  			if (ce->ce_flags & (CE_UPDATE | CE_REMOVE))
>  				total++;
>  		}

This check for ce_no_checkout() before the existing check to see if
CE_UPDATE and/or CE_REMOVE are on puzzles me (you have the same check
sequence in later loop that does the actualy worktree updates).  If
apply_narrow_checkout() check is working correctly, would we ever give
CE_UPDATE and/or CE_REMOVE bits to a cache entry with CE_NO_CHECKOUT set?

IOW, I think this extra check is Ok as it is expected to be no-op when
combined with the existing check, but it leaves me wondering if it is
hiding some codepath that incorrectly sets CE_UPDATE/CE_REMOVE to an entry
outside the narrow checkout area.

I have two more messages but other than these the series is nicely done
and a pleasure to read.

  parent reply	other threads:[~2008-09-15 19:36 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-14 13:07 [PATCH 00/16] Narrow/Partial/Sparse checkout Nguyễn Thái Ngọc Duy
2008-09-14 13:07 ` [PATCH 01/16] Extend index to save more flags Nguyễn Thái Ngọc Duy
2008-09-14 13:07   ` [PATCH 02/16] Introduce CE_NO_CHECKOUT bit Nguyễn Thái Ngọc Duy
2008-09-14 13:07     ` [PATCH 03/16] update-index: refactor mark_valid() in preparation for new options Nguyễn Thái Ngọc Duy
2008-09-14 13:07       ` [PATCH 04/16] update-index: add --checkout/--no-checkout to update CE_NO_CHECKOUT bit Nguyễn Thái Ngọc Duy
2008-09-14 13:07         ` [PATCH 05/16] ls-files: add --narrow-checkout option to "will checkout" entries Nguyễn Thái Ngọc Duy
2008-09-14 13:07           ` [PATCH 06/16] Add tests for updating no-checkout entries in index Nguyễn Thái Ngọc Duy
2008-09-14 13:07             ` [PATCH 07/16] Prevent diff machinery from examining worktree outside narrow checkout Nguyễn Thái Ngọc Duy
2008-09-14 13:07               ` [PATCH 08/16] checkout_entry(): CE_NO_CHECKOUT on checked out entries Nguyễn Thái Ngọc Duy
2008-09-14 13:07                 ` [PATCH 09/16] ls-files: apply --deleted on narrow area only Nguyễn Thái Ngọc Duy
2008-09-14 13:07                   ` [PATCH 10/16] grep: skip files that have not been checked out Nguyễn Thái Ngọc Duy
2008-09-14 13:08                     ` [PATCH 11/16] unpack_trees(): add support for narrow checkout Nguyễn Thái Ngọc Duy
2008-09-14 13:08                       ` [PATCH 12/16] narrow spec: put '+' before a spec will change semantic of '*' Nguyễn Thái Ngọc Duy
2008-09-14 13:08                         ` [PATCH 13/16] ls-files: add --narrow-match=spec option for testing narrow matching Nguyễn Thái Ngọc Duy
2008-09-14 13:08                           ` [PATCH 14/16] clone: support narrow checkout with --path option Nguyễn Thái Ngọc Duy
2008-09-14 13:08                             ` [PATCH 15/16] checkout: add new options to support narrow checkout Nguyễn Thái Ngọc Duy
2008-09-14 13:08                               ` [PATCH 16/16] ls-files: add --overlay option Nguyễn Thái Ngọc Duy
2008-09-14 21:10                                 ` Jakub Narebski
2008-09-15 19:35                                 ` Junio C Hamano
2008-09-16 12:00                                   ` Nguyen Thai Ngoc Duy
2008-09-16 17:00                                     ` Junio C Hamano
2008-09-14 21:12                               ` [PATCH 15/16] checkout: add new options to support narrow checkout Jakub Narebski
2008-09-16  9:53                               ` Baz
2008-09-16 10:17                               ` Johannes Sixt
2008-09-16 13:13                                 ` Nguyen Thai Ngoc Duy
2008-09-14 19:01                             ` [PATCH 14/16] clone: support narrow checkout with --path option Jakub Narebski
2008-09-15 20:27                               ` Junio C Hamano
2008-09-14 18:58                           ` [PATCH 13/16] ls-files: add --narrow-match=spec option for testing narrow matching Jakub Narebski
2008-09-15 19:34                       ` Junio C Hamano [this message]
2008-09-16 11:45                         ` [PATCH 11/16] unpack_trees(): add support for narrow checkout Nguyen Thai Ngoc Duy
2008-09-14 18:56                     ` [PATCH 10/16] grep: skip files that have not been checked out Jakub Narebski
2008-09-15 19:35                   ` [PATCH 09/16] ls-files: apply --deleted on narrow area only Junio C Hamano
2008-09-14 18:55           ` [PATCH 05/16] ls-files: add --narrow-checkout option to "will checkout" entries Jakub Narebski
2008-09-15 20:20             ` Junio C Hamano
2008-09-14 18:50         ` [PATCH 04/16] update-index: add --checkout/--no-checkout to update CE_NO_CHECKOUT bit Jakub Narebski

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=7vsks1b3tq.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.