git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
To: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>, git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH nd/split-index] fixup! read-cache: new API write_locked_index instead of write_index/write_cache
Date: Mon, 02 Jun 2014 16:12:01 +0100	[thread overview]
Message-ID: <538C9441.3010804@ramsay1.demon.co.uk> (raw)
In-Reply-To: <1401583635-1332-1-git-send-email-pclouds@gmail.com>

On 01/06/14 01:47, Nguyễn Thái Ngọc Duy wrote:
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
>  I intended it resend the series after the comments I received, but it
>  looks like Junio has picked up all comments except this one, so
>  here's the fix.
> 
>  sequencer.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sequencer.c b/sequencer.c
> index 377c877..4b709db 100644
> --- a/sequencer.c
> +++ b/sequencer.c
> @@ -672,7 +672,7 @@ static void prepare_revs(struct replay_opts *opts)
>  static void read_and_refresh_cache(struct replay_opts *opts)
>  {
>  	static struct lock_file index_lock;
> -	hold_locked_index(&index_lock, 0);
> +	int index_fd = hold_locked_index(&index_lock, 0);
>  	if (read_index_preload(&the_index, NULL) < 0)
>  		die(_("git %s: failed to read the index"), action_name(opts));
>  	refresh_index(&the_index, REFRESH_QUIET|REFRESH_UNMERGED, NULL, NULL, NULL);
> 

Yep, this silences sparse. I would have declared the variable to be
(say) fd (and changed the _use_ site as well, of course!), rather
than once again hiding the index_fd() global function. However, this
is perfectly fine as-is.

The actual culprit is the index_fd() global function, but renaming it
now is probably not worth the code churn (and I'm lazy). ;-)

Thanks!

ATB,
Ramsay Jones

      reply	other threads:[~2014-06-02 15:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-30 23:44 split index: sparse warning Ramsay Jones
2014-05-01  0:12 ` Duy Nguyen
2014-06-01  0:47   ` [PATCH nd/split-index] fixup! read-cache: new API write_locked_index instead of write_index/write_cache Nguyễn Thái Ngọc Duy
2014-06-02 15:12     ` Ramsay Jones [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=538C9441.3010804@ramsay1.demon.co.uk \
    --to=ramsay@ramsay1.demon.co.uk \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pclouds@gmail.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).