git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 3/3] read-cache: don't write index twice if we can't write shared index

From
Duy Nguyen <pclouds@gmail.com>
Date
Jan 23, 2018, 04:06 UTC
Message-ID
<CACsJy8B059uev+HpL=JGDdh+FM19vSFObhp7DB4eAt-u6d7GnQ@mail.gmail.com>
In-Reply-To
<xmqqfu6xjxrx.fsf@gitster.mtv.corp.google.com>
On Tue, Jan 23, 2018 at 6:09 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 16 quoted lines
> Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:
>
>> diff --git a/t/t1700-split-index.sh b/t/t1700-split-index.sh
>> index af9b847761..d2a8e0312a 100755
>> --- a/t/t1700-split-index.sh
>> +++ b/t/t1700-split-index.sh
>> @@ -401,4 +401,23 @@ done <<\EOF
>>  0642 -rw-r---w-
>>  EOF
>>
>> +test_expect_success SANITY 'graceful handling when splitting index is not allowed' '
>
> Is SANITY the only prereq we want, or do we want both it and POSIXPERM?
>
> In "git grep SANITY t/" output, we see that they are almost always
> used together.

SANITY test does more or less the same as this one (chmod then verify) which is the reason I removed POSIXPERM. Looking at other tests though, they don't do anything different than what I do here and still require both SANITY and POSIXPERM. I'm adding POSIXPERM back.

Show 20 quoted lines
>
>> +     test_create_repo ro &&
>> +     (
>> +             cd ro &&
>> +             test_commit initial &&
>> +             git update-index --split-index &&
>> +             test -f .git/sharedindex.*
>> +     ) &&
>> +     cp ro/.git/index new-index &&
>> +     test_when_finished "chmod u+w ro/.git" &&
>> +     chmod u-w ro/.git &&
>> +     GIT_INDEX_FILE="$(pwd)/new-index" git -C ro update-index --split-index &&
>> +     chmod u+w ro/.git &&
>> +     rm ro/.git/sharedindex.* &&
>> +     GIT_INDEX_FILE=new-index git ls-files >actual &&
>> +     echo initial.t >expected &&
>> +     test_cmp expected actual
>> +'
>> +
>>  test_done
-- 
Duy
Previous: Junio C HamanoNext: Nguyễn Thái Ngọc Duy
Message 6 of 11 in “nd/shared-index-fix update”
  1. 0/3 nd/shared-index-fix updateNguyễn Thái Ngọc Duy, Jan 22, 2018
  2. 1/3 read-cache.c: change type of "temp" in write_shared_index()Nguyễn Thái Ngọc Duy, Jan 22, 2018
  3. 2/3 read-cache.c: move tempfile creation/cleanup out of write_shared_indexNguyễn Thái Ngọc Duy, Jan 22, 2018
  4. 3/3 read-cache: don't write index twice if we can't write shared indexNguyễn Thái Ngọc Duy, Jan 22, 2018
  5. Junio C HamanoJan 22, 2018
  6. Duy NguyenJan 23, 2018
  7. 0/3 nd/shared-index-fix updatesNguyễn Thái Ngọc Duy, Jan 24, 2018
  8. 1/3 read-cache.c: change type of "temp" in write_shared_index()Nguyễn Thái Ngọc Duy, Jan 24, 2018
  9. 2/3 read-cache.c: move tempfile creation/cleanup out of write_shared_indexNguyễn Thái Ngọc Duy, Jan 24, 2018
  10. 3/3 read-cache: don't write index twice if we can't write shared indexNguyễn Thái Ngọc Duy, Jan 24, 2018
  11. Junio C HamanoJan 24, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.