All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Duy Nguyen <pclouds@gmail.com>
Cc: Thomas Gummerer <t.gummerer@gmail.com>,
	Git Mailing List <git@vger.kernel.org>,
	Jaime Soriano Pastor <jsorianopastor@gmail.com>
Subject: Re: [PATCH 2/2] read-cache: fix reading of split index
Date: Tue, 24 Mar 2015 10:19:42 -0700	[thread overview]
Message-ID: <xmqqpp7y71ox.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <CACsJy8CYi+hYu8zwOy=m7zZk3-8fr+Jq9uT4kEf8fLCOcjHJzw@mail.gmail.com> (Duy Nguyen's message of "Tue, 24 Mar 2015 20:02:36 +0700")

Duy Nguyen <pclouds@gmail.com> writes:

> Thank you for catching this. I was about to write "would be nice to
> point out what tests fail so the reviewer has easier time trying
> themselves", but whoa.. quite a few of them!
>
> May I suggest a slight modification. Even though stage info is messed
> up before the index is merged, I think we should still check that both
> front and base indexes have all the names sorted correctly (and even
> stronger, the base index should never contain staged entries).

I smell a slight layering violation here, though.  As far as the
code to check the validity of the index is concerned, it is only
about the in-core index other code uses at runtime, and how that
in-core index is prepared, and most importantly, what is recorded in
the istate before it gets ready to be used by other code, is not its
concern.  The state immediately after the base index is read but
before it gets fixed up by the split-index code can have quirks
specific to how split-index code does things and it is perfectly OK
if it does not pass the check for the final shape.

The above does not change if the current split-index code happens to
promise certain properties in that intermediate state.  It is fine
if the split-index codepath wants to add its own validator to the
intermediate state for added robustness, but the rules for the
intermediate state and the rules for the final state can be
different, and from the maintainability's point of view, it is
better if we keep the validator for the final-shape oblivious to
what split-index does.

      parent reply	other threads:[~2015-03-24 17:19 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-20 15:09 [PATCH] t1700: make test pass with index-v4 Thomas Gummerer
2015-03-20 17:23 ` Junio C Hamano
2015-03-20 17:37   ` Thomas Gummerer
2015-03-20 18:06     ` Junio C Hamano
2015-03-20 18:20       ` [PATCH v2] " Thomas Gummerer
2015-03-20 19:38         ` Junio C Hamano
2015-03-20 19:59           ` Thomas Gummerer
2015-03-20 21:43             ` [PATCH 0/2] fix test suite with split index Thomas Gummerer
2015-03-20 21:43               ` [PATCH 1/2] test-lib: allow using split index in the test suite Thomas Gummerer
2015-03-20 21:55                 ` Junio C Hamano
2015-03-20 22:12                   ` Thomas Gummerer
2015-03-20 21:43               ` [PATCH 2/2] read-cache: fix reading of split index Thomas Gummerer
2015-03-24 13:02                 ` Duy Nguyen
2015-03-24 17:00                   ` [PATCH] read-cache: tighten checks for do_read_index Thomas Gummerer
2015-03-24 21:33                     ` Junio C Hamano
2015-03-24 21:51                       ` Thomas Gummerer
2015-03-24 17:07                   ` [PATCH 2/2] read-cache: fix reading of split index Thomas Gummerer
2015-03-24 17:19                   ` 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=xmqqpp7y71ox.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jsorianopastor@gmail.com \
    --cc=pclouds@gmail.com \
    --cc=t.gummerer@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.