git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Junio C Hamano <gitster@pobox.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] Avoid running lstat(2) on the same cache entry.
Date: Sun, 20 Jan 2008 02:42:06 +0000 (GMT)	[thread overview]
Message-ID: <alpine.LSU.1.00.0801200231250.5731@racer.site> (raw)
In-Reply-To: <alpine.LFD.1.00.0801191709380.2957@woody.linux-foundation.org>

Hi,

On Sat, 19 Jan 2008, Linus Torvalds wrote:

> @@ -687,13 +732,20 @@ int run_diff_index(struct rev_info *revs, int cached)
>  	tree = parse_tree_indirect(ent->sha1);
>  	if (!tree)
>  		return error("bad tree object %s", tree_name);
> -	if (read_tree(tree, 1, revs->prune_data))
> -		return error("unable to read tree object %s", tree_name);
> -	ret = diff_cache(revs, active_cache, active_nr, revs->prune_data,
> -			 cached, match_missing);
> +
> +	memset(&opts, 0, sizeof(opts));
> +	opts.head_idx = 1;
> +	opts.index_only = cached;
> +	opts.merge = 1;
> +	opts.fn = oneway_diff;
> +	opts.unpack_data = revs;
> +
> +	init_tree_desc(&t, tree->buffer, tree->size);
> +	unpack_trees(1, &t, &opts);
> +	
>  	diffcore_std(&revs->diffopt);
>  	diff_flush(&revs->diffopt);
> -	return ret;
> +	return 0;
>  }
>

Two problems I see (before I go to bed): match_missing is now ignored, and 
the return value is set to 0, whereas it was the return value of 
diff_cache() before.

The first is easily fixed, by replacing the two "0"s in the calls to 
show_new_file() and show_modified() with "!revs->ignore_merges".  Unless I 
am missing something, of course.

And the second is not _that_ bad, as it seems that diff_cache() has only 
one return statement, and it returns 0, AFAICS.  But it had to be said 
somewhere. 

Ciao,
Dscho

      parent reply	other threads:[~2008-01-20  2:43 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-19  3:25 Updated in-memory index cleanup Linus Torvalds
2008-01-19  7:42 ` [PATCH] index: be careful when handling long names Junio C Hamano
2008-01-19  7:45 ` [PATCH] Avoid running lstat(2) on the same cache entry Junio C Hamano
2008-01-19 19:47   ` Linus Torvalds
2008-01-19 19:58     ` Linus Torvalds
2008-01-20  1:22     ` Linus Torvalds
2008-01-20  1:34       ` Linus Torvalds
2008-01-20  1:48       ` Johannes Schindelin
2008-01-20  2:02         ` Linus Torvalds
2008-01-20 10:33         ` Steffen Prohaska
2008-01-20 14:15           ` Johannes Schindelin
2008-01-21  0:18           ` Junio C Hamano
2008-01-20 15:10         ` Steffen Prohaska
2008-01-20 15:18           ` Johannes Schindelin
2008-01-20 15:19             ` [PATCH] Also use unpack_trees() in do_diff_cache() Johannes Schindelin
2008-01-20 20:32               ` Linus Torvalds
2008-01-20 21:53                 ` Linus Torvalds
2008-01-20 23:34                   ` Johannes Schindelin
2008-01-20 23:58                     ` Linus Torvalds
2008-01-21  0:19                       ` Johannes Schindelin
2008-01-20 15:21             ` [PATCH] Try to resurrect the handling for 'diff-index -m' Johannes Schindelin
2008-01-20 18:20           ` [PATCH] Avoid running lstat(2) on the same cache entry Linus Torvalds
2008-01-20 20:03             ` Brian Downing
2008-01-20 21:40             ` Steffen Prohaska
2008-01-20 22:09               ` Linus Torvalds
2008-01-20  2:42       ` Johannes Schindelin [this message]

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=alpine.LSU.1.00.0801200231250.5731@racer.site \
    --to=johannes.schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=torvalds@linux-foundation.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).