git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Subject: Re: [PATCH] builtin-commit: fix partial-commit support
Date: Sun, 18 Nov 2007 10:44:22 -0800	[thread overview]
Message-ID: <7vve7zv1fd.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <7vr6inx1m8.fsf@gitster.siamese.dyndns.org> (Junio C. Hamano's message of "Sun, 18 Nov 2007 02:57:19 -0800")

Junio C Hamano <gitster@pobox.com> writes:

> diff --git a/builtin-commit.c b/builtin-commit.c
> index 3e7d281..e487bc0 100644
> --- a/builtin-commit.c
> +++ b/builtin-commit.c

There was another...

> +static int list_paths(struct path_list *list, const char *with_tree,
> +		      const char *prefix, const char **pattern)
> +{
> +	struct dir_struct dir;
> +	int i;
> +	char *m;
> +
> +	for (i = 0; pattern[i]; i++)
> +		;
> +	m = xcalloc(1, i);
> +
> +	memset(&dir, 0, sizeof(dir));
> +	if (with_tree)
> +		overlay_tree_on_cache(with_tree, prefix);
> +
> +	for (i = 0; i < active_nr; i++) {
> +		struct cache_entry *ce = active_cache[i];
> +		if (ce->ce_flags & htons(CE_UPDATE))
> +			continue;
> +		if (!pathspec_match(pattern, m, ce->name, 0))
> +			continue;
> +		if (excluded(&dir, ce->name))
> +			continue;
> +		path_list_insert(ce->name, list);
> +	}

This "excluded", and the whole "struct dir" business is
unneeded, as we are walking on the index and finding the set of
paths the user cares about.

  reply	other threads:[~2007-11-18 18:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-18 10:21 [PATCH] file_exists(): dangling symlinks do exist Junio C Hamano
2007-11-18 10:21 ` [PATCH] Export three helper functions from ls-files Junio C Hamano
2007-11-18 10:21   ` [PATCH] Fix add_files_to_cache() to take pathspec, not user specified list of files Junio C Hamano
2007-11-18 10:21     ` [PATCH] builtin-commit: fix partial-commit support Junio C Hamano
2007-11-18 10:26       ` Junio C Hamano
2007-11-18 10:57       ` Junio C Hamano
2007-11-18 18:44         ` Junio C Hamano [this message]
2007-11-19 16:47       ` Kristian Høgsberg

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=7vve7zv1fd.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --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).