git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Kristian Høgsberg" <krh@redhat.com>
Cc: gitster@pobox.com, git@vger.kernel.org
Subject: Re: [PATCH] Call refresh_cache() when updating the user index for --only commits.
Date: Mon, 12 Nov 2007 15:01:54 -0800	[thread overview]
Message-ID: <7vmytj1319.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <1194900502-8987-1-git-send-email-krh@redhat.com> (Kristian Høgsberg's message of "Mon, 12 Nov 2007 15:48:22 -0500")

Kristian Høgsberg <krh@redhat.com> writes:

> We're guaranteeing the user that the index will be stat-clean after
> git commit. Thus, we need to call refresh_cache() for the user index too,
> in the 'git commit <paths>' case.
>
> Signed-off-by: Kristian Høgsberg <krh@redhat.com>
> ---
>  builtin-commit.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/builtin-commit.c b/builtin-commit.c
> index 5011b8b..35205ef 100644
> --- a/builtin-commit.c
> +++ b/builtin-commit.c
> @@ -109,6 +109,7 @@ static char *prepare_index(const char **files, const char *prefix)
>  
>  	/* update the user index file */
>  	add_files_to_cache(verbose, prefix, files);
> +	refresh_cache(REFRESH_QUIET);
>  	if (write_cache(fd, active_cache, active_nr) || close(fd))
>  		die("unable to write new_index file");
>  

Ah.  This is the real index file that is left for the user after
a partial commit "git-commit <path>" returns.

The other refresh_cache() after this one does not matter if we
did not have hook scripts, but it is not very easy to cheaply
detect if we are not going to run any hooks so let's leave it
there. 

Thanks.

      reply	other threads:[~2007-11-12 23:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-12 20:48 [PATCH] Call refresh_cache() when updating the user index for --only commits Kristian Høgsberg
2007-11-12 23:01 ` Junio C Hamano [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

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

  git send-email \
    --in-reply-to=7vmytj1319.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=krh@redhat.com \
    /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).