From: Junio C Hamano <gitster@pobox.com>
To: David Turner <dturner@twopensource.com>
Cc: git@vger.kernel.org, David Turner <dturner@twitter.com>
Subject: Re: [PATCH 1/3] cache-tree: Create/update cache-tree on checkout
Date: Sun, 29 Jun 2014 23:31:16 -0700 [thread overview]
Message-ID: <xmqqvbrizz63.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1403914856-3546-1-git-send-email-dturner@twitter.com> (David Turner's message of "Fri, 27 Jun 2014 17:20:54 -0700")
David Turner <dturner@twopensource.com> writes:
> When git checkout checks out a branch, create or update the
> cache-tree so that subsequent operations are faster.
>
> Signed-off-by: David Turner <dturner@twitter.com>
> ---
> builtin/checkout.c | 4 ++++
> cache-tree.c | 22 ++++++++++++----------
> cache-tree.h | 1 +
> t/t0090-cache-tree.sh | 15 ++++++++++++++-
> 4 files changed, 31 insertions(+), 11 deletions(-)
>
> diff --git a/builtin/checkout.c b/builtin/checkout.c
> index 07cf555..df791e8 100644
> --- a/builtin/checkout.c
> +++ b/builtin/checkout.c
> @@ -553,6 +553,10 @@ static int merge_working_tree(const struct checkout_opts *opts,
> }
> }
>
> + if (write_cache_as_tree(NULL, WRITE_TREE_DO_NOT_WRITE, "")) {
> + warn("Unable to write cache_tree");
> + }
> +
This is not even warn-worthy event, isn't it? "checkout -m other"
would attempt a three-way merge to replay your local changes
relative to your current HEAD in the context of "other" branch and
will leave conflicts in the index and in the working tree, and it is
perfectly a normal thing that you cannot write the index in such a
state as a tree object. Perhaps you should check if the index is
unmerged before even attempting to compute the cache tree.
Also it looks very strange that write-cache-as-tree, whose *PRIMARY*
function is to write a tree, receives a "DO NOT WRITE" option here.
I understand that you want a new interface into the cache-tree
subsystem that only updates the cache-tree but it somehow smells
like a sloppy/lazy refactoring that is not done quite right.
next prev parent reply other threads:[~2014-06-30 6:31 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-28 0:20 [PATCH 1/3] cache-tree: Create/update cache-tree on checkout David Turner
2014-06-28 0:20 ` [PATCH 2/3] test-dump-cache-tree: Improve output format and exit code David Turner
2014-06-28 0:20 ` [PATCH 3/3] cache-tree: Write index with updated cache-tree after commit David Turner
2014-06-30 18:10 ` Junio C Hamano
2014-06-29 3:33 ` [PATCH 1/3] cache-tree: Create/update cache-tree on checkout Duy Nguyen
2014-06-30 18:13 ` Junio C Hamano
2014-06-30 6:31 ` Junio C Hamano [this message]
-- strict thread matches above, loose matches on Subject: below --
2014-07-01 0:13 David Turner
2014-07-01 4:16 ` Torsten Bögershausen
2014-07-01 19:15 ` David Turner
2014-07-01 21:03 ` Junio C Hamano
2014-07-01 22:09 ` David Turner
2014-07-01 20:15 ` Junio C Hamano
2014-07-06 4:04 ` David Turner
2014-07-07 16:58 ` Junio C Hamano
2014-07-01 19:14 David Turner
2014-07-01 21:08 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqvbrizz63.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=dturner@twitter.com \
--cc=dturner@twopensource.com \
--cc=git@vger.kernel.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.