git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] builtin-commit: fix partial-commit support

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 18, 2007, 18:44 UTC
Message-ID
<7vve7zv1fd.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<7vr6inx1m8.fsf@gitster.siamese.dyndns.org>
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...
Show 25 quoted lines
> +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.

Previous: Junio C HamanoNext: Kristian Høgsberg
Message 7 of 8 in “file_exists(): dangling symlinks do exist”
  1. file_exists(): dangling symlinks do existJunio C Hamano, Nov 18, 2007
  2. Export three helper functions from ls-filesJunio C Hamano, Nov 18, 2007
  3. Fix add_files_to_cache() to take pathspec, not user specified list of filesJunio C Hamano, Nov 18, 2007
  4. builtin-commit: fix partial-commit supportJunio C Hamano, Nov 18, 2007
  5. Junio C HamanoNov 18, 2007
  6. Junio C HamanoNov 18, 2007
  7. Junio C HamanoNov 18, 2007
  8. Kristian HøgsbergNov 19, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.