git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Ben Peart <peartben@gmail.com>
To: Alex Vandiver <alexmv@dropbox.com>, git@vger.kernel.org
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: Re: [PATCH 2/2] fsmonitor: Store fsmonitor bitmap before splitting index
Date: Mon, 13 Nov 2017 10:28:43 -0500	[thread overview]
Message-ID: <9b6679ea-b7e4-b45a-32bb-448cd2e891df@gmail.com> (raw)
In-Reply-To: <4ff73be656d5bbf9e2cada6bdec61843da9d1516.1510257457.git.alexmv@dropbox.com>



On 11/9/2017 2:58 PM, Alex Vandiver wrote:
> ba1b9caca6 resolved the problem of the fsmonitor data being applied to
> the non-base index when reading; however, a similar problem exists
> when writing the index.  Specifically, writing of the fsmonitor
> extension happens only after the work to split the index has been
> applied -- as such, the information in the index is only for the
> non-"base" index, and thus the extension information contains only
> partial data.
> 
> When saving, compute the ewah bitmap before the index is split, and
> store it in the fsmonitor_dirty field, mirroring the behavior that
> occurred during reading.  fsmonitor_dirty is kept from being leaked by
> being freed when the extension data is written -- which always happens
> precisely once, no matter the split index configuration.
> 
> Signed-off-by: Alex Vandiver <alexmv@dropbox.com>
> ---

The patch looks like a reasonable fix to make fsmonitor work correctly 
with split index.  I also did manual testing to verify it was working as 
expected.

Thanks for adding this additional test case to ensure we don't have any 
regressions with the interactions between fsmonitor and split-index. 
While the test does correctly fail before the patch and pass after the 
patch, I had a question about the test-dump-fsmonitor lines.

Why do you redirect stdout to stderr and then and perform an "echo" 
afterwards?  I don't understand what benefit that provides.  I removed 
this logic and the test still passes so am confused as to what its 
purpose is.


>   
> +# test that splitting the index dosn't interfere
> +test_expect_success 'splitting the index results in the same state' '
> +	write_integration_script &&
> +	dirty_repo &&
> +	git update-index --fsmonitor  &&
> +	git ls-files -f >expect &&
> +	test-dump-fsmonitor >&2 && echo &&
> +	git update-index --fsmonitor --split-index &&
> +	test-dump-fsmonitor >&2 && echo &&
> +	git ls-files -f >actual &&
> +	test_cmp expect actual
> +'
> +
>   test_done
> 

  parent reply	other threads:[~2017-11-13 15:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-09 19:58 [PATCH 0/2] fsmonitor: Stop reading from PWD, write fsmonitor+split index right Alex Vandiver
2017-11-09 19:58 ` [PATCH 1/2] fsmonitor: Read from getcwd(), not the PWD environment variable Alex Vandiver
2017-11-09 19:58   ` [PATCH 2/2] fsmonitor: Store fsmonitor bitmap before splitting index Alex Vandiver
2017-11-10  5:11     ` Junio C Hamano
2017-11-13 15:28     ` Ben Peart [this message]
2017-12-16  2:02       ` Alex Vandiver
2017-11-10  5:04   ` [PATCH 1/2] fsmonitor: Read from getcwd(), not the PWD environment variable Junio C Hamano
2017-11-10 21:03     ` [PATCH v1] fsmonitor: simplify determining the git worktree under Windows Ben Peart
2017-11-13  1:02       ` 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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=9b6679ea-b7e4-b45a-32bb-448cd2e891df@gmail.com \
    --to=peartben@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=alexmv@dropbox.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).