git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH 1/2] diff-lib: simplify do_diff_cache()
Date: Tue, 19 Jul 2011 14:28:01 -0700	[thread overview]
Message-ID: <7vei1m7yfy.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20110719201400.GA2938@sigill.intra.peff.net> (Jeff King's message of "Tue, 19 Jul 2011 16:14:00 -0400")

Jeff King <peff@peff.net> writes:

> On Tue, Jul 19, 2011 at 11:13:05AM -0700, Junio C Hamano wrote:
>
>> Since 34110cd (Make 'unpack_trees()' have a separate source and
>> destination index, 2008-03-06), we can run unpack_trees() without munging
>> the index at all, but do_diff_cache() tried ever so carefully to work
>> around the old behaviour of the function.
>> 
>> We can just tell unpack_trees() not to touch the original index and there
>> is no need to clean-up whatever the previous round has done.
>
> Can we drop the calls to discard_cache in reset.c now?

Possibly, along with "index-was-discarded" flag bit.

> $ git grep -B1 discard_cache builtin/reset.c
> builtin/reset.c-        /* do_diff_cache() mangled the index */
> builtin/reset.c:        discard_cache();
> --
> builtin/reset.c-                /* The index is still clobbered from do_diff_cache() */
> builtin/reset.c:                discard_cache();
>
> -Peff

  reply	other threads:[~2011-07-19 21:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-10 22:30 reproducible unexpected behavior for 'git reset' John Nowak
2011-07-11 21:54 ` Junio C Hamano
2011-07-11 22:41   ` Junio C Hamano
2011-07-14  6:01     ` Junio C Hamano
2011-07-19 18:13       ` [PATCH 0/2] refactoring diff-index Junio C Hamano
2011-07-19 18:13         ` [PATCH 1/2] diff-lib: simplify do_diff_cache() Junio C Hamano
2011-07-19 20:14           ` Jeff King
2011-07-19 21:28             ` Junio C Hamano [this message]
2011-07-19 18:13         ` [PATCH 2/2] diff-lib: refactor run_diff_index() and do_diff_cache() Junio C Hamano

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=7vei1m7yfy.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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).