From: Junio C Hamano <gitster@pobox.com>
To: Brad King <brad.king@kitware.com>
Cc: git@vger.kernel.org, newren@gmail.com, jrnieder@gmail.com
Subject: Re: [PATCH v2 2/3] read-cache.c: Optionally tolerate missing files in make_cache_entry
Date: Fri, 24 Jan 2014 12:39:40 -0800 [thread overview]
Message-ID: <xmqqr47xqflf.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <197b46e792c8640d19580f282834052a660d2c05.1390592626.git.brad.king@kitware.com> (Brad King's message of "Fri, 24 Jan 2014 15:10:48 -0500")
Brad King <brad.king@kitware.com> writes:
> +extern struct cache_entry *make_cache_entry(unsigned int mode, const unsigned char *sha1, const char *path, int stage, int refresh, int refresh_flags);
Why a new parameter? If refresh_flags can be ANY when refresh=NoThanks,
shouldn't they be a single variable that tells the callee how the entry
should be refreshed (e.g. "not at all", "normally", "missing is ok", etc.)?
> +static struct cache_entry *refresh_cache_entry(struct cache_entry *ce, int really,
> + int flags)
> {
> - return refresh_cache_ent(&the_index, ce, really, NULL, NULL);
> + int not_new = (flags & REFRESH_IGNORE_MISSING) != 0;
> + int cache_errno = 0;
> + struct cache_entry *new;
> +
> + new = refresh_cache_ent(&the_index, ce, really, &cache_errno, NULL);
> +
> + if(!new && not_new && cache_errno == ENOENT)
> + return ce;
I think this is still one level too high in the abstraction chain.
"int really" might be of type signed int by historical accidents,
but it is "unsigned int options" for the underlying
refresh_cache_ent(). I'd suggest renaming this to "unsigned int
refresh_options" or something, and then define a new constatnt
similar to the existing CE_MATCH_IGNORE_*.
next prev parent reply other threads:[~2014-01-24 20:39 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CABPp-BGAsrrjcZxVirzKU_VEyUM1U=4TFj18CieKKE7==c7v2A@mail.gmail.com>
2014-01-24 15:01 ` [PATCH/RFC 0/3] merge-recursive: Avoid diagnostic on empty work tree Brad King
2014-01-24 15:01 ` [PATCH/RFC 1/3] t3030-merge-recursive: Test known breakage with " Brad King
2014-01-24 16:51 ` Jonathan Nieder
2014-01-24 17:50 ` Brad King
2014-01-24 15:01 ` [PATCH/RFC 2/3] read-cache.c: Thread lstat error through make_cache_entry signature Brad King
2014-01-24 15:01 ` [PATCH/RFC 3/3] merge-recursive: Tolerate missing file when HEAD is up to date Brad King
[not found] ` <CABPp-BEK9+_ebRiodCp59DHJZExYn3N1jjtBsikSmwt-s_v_0A@mail.gmail.com>
2014-01-24 19:37 ` Fwd: " newren
2014-01-24 19:45 ` Brad King
2014-01-24 19:50 ` Junio C Hamano
2014-01-24 20:02 ` Brad King
2014-01-24 20:10 ` [PATCH v2 0/3] merge-recursive: Avoid diagnostic on empty work tree Brad King
2014-01-24 20:10 ` [PATCH v2 1/3] t3030-merge-recursive: Test known breakage with " Brad King
2014-01-24 20:10 ` [PATCH v2 2/3] read-cache.c: Optionally tolerate missing files in make_cache_entry Brad King
2014-01-24 20:39 ` Junio C Hamano [this message]
2014-01-24 20:10 ` [PATCH v2 3/3] merge-recursive.c: Tolerate missing files while refreshing index Brad King
2014-01-27 14:45 ` [PATCH v3 0/3] merge-recursive: Avoid diagnostic on empty work tree Brad King
2014-01-27 14:45 ` [PATCH v3 1/4] t3030-merge-recursive: Test known breakage with " Brad King
2014-01-27 14:45 ` [PATCH v3 2/4] read-cache.c: Refactor --ignore-missing implementation Brad King
2014-01-27 17:39 ` Junio C Hamano
2014-01-27 14:45 ` [PATCH v3 3/4] read-cache.c: Extend make_cache_entry refresh flag with options Brad King
2014-01-27 14:45 ` [PATCH v3 4/4] merge-recursive.c: Tolerate missing files while refreshing index Brad King
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=xmqqr47xqflf.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=brad.king@kitware.com \
--cc=git@vger.kernel.org \
--cc=jrnieder@gmail.com \
--cc=newren@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 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.