All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Rast <trast@inf.ethz.ch>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: git@vger.kernel.org, "Junio C Hamano" <gitster@pobox.com>,
	"René Scharfe" <rene.scharfe@lsrfire.ath.cx>,
	"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>,
	"Adam Spiers" <git@adamspiers.org>,
	"Ramkumar Ramachandra" <artagnon@gmail.com>,
	"Stephen Boyd" <sboyd@codeaurora.org>
Subject: Re: [PATCH 1/4] commit: reload cache properly
Date: Thu, 30 May 2013 14:17:14 +0200	[thread overview]
Message-ID: <87ehcok6gl.fsf@linux-k42r.v.cablecom.net> (raw)
In-Reply-To: <1369915136-4248-2-git-send-email-felipe.contreras@gmail.com> (Felipe Contreras's message of "Thu, 30 May 2013 06:58:53 -0500")

Felipe Contreras <felipe.contreras@gmail.com> writes:

> We are supposedly adding files, to to which cache if 'the_index' is
> discarded?
[...]
>  	if (!current_head) {
>  		discard_cache();
> +		if (read_cache() < 0)
> +			die(_("cannot read the index"));
>  		return;
>  	}

It is not obvious to me that this is a correct change.  discard_cache()
without subsequent reloading could also legitimately be used to empty
the index.  So if you are fixing a bug, please justify the change and
provide a testcase to guard against it in the future.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

  reply	other threads:[~2013-05-30 12:17 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-30 11:58 [PATCH 0/4] cherry-pick: fix memory leaks Felipe Contreras
2013-05-30 11:58 ` [PATCH 1/4] commit: reload cache properly Felipe Contreras
2013-05-30 12:17   ` Thomas Rast [this message]
2013-05-30 12:35     ` Felipe Contreras
2013-05-30 12:58       ` Thomas Rast
2013-05-30 13:07         ` Felipe Contreras
2013-06-01  9:09         ` Duy Nguyen
2013-06-01 11:02           ` [PATCH] Test 'commit --only' after 'checkout --orphan' Thomas Rast
2013-05-30 13:08     ` [PATCH 1/4] commit: reload cache properly Duy Nguyen
2013-05-30 11:58 ` [PATCH 2/4] read-cache: plug small memory leak Felipe Contreras
2013-05-30 11:58 ` [PATCH 3/4] unpack-trees: plug a " Felipe Contreras
2013-06-02 19:33   ` Junio C Hamano
2013-06-02 19:51     ` Felipe Contreras
2013-06-02 22:17       ` Junio C Hamano
2013-06-02 22:45         ` Felipe Contreras
2013-05-30 11:58 ` [PATCH 4/4] unpack-trees: free created cache entries Felipe Contreras

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=87ehcok6gl.fsf@linux-k42r.v.cablecom.net \
    --to=trast@inf.ethz.ch \
    --cc=artagnon@gmail.com \
    --cc=felipe.contreras@gmail.com \
    --cc=git@adamspiers.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pclouds@gmail.com \
    --cc=rene.scharfe@lsrfire.ath.cx \
    --cc=sboyd@codeaurora.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 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.