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

Re: [PATCH v2] read-cache: write all indexes with the same permissions

From
Duy Nguyen <pclouds@gmail.com>
Date
Nov 16, 2018, 18:02 UTC
Message-ID
<CACsJy8Cdk8YQWJM1HAFYWB6qJpepNQoj86yrTqF9Rg3oN0TeUA@mail.gmail.com>
In-Reply-To
<20181116173105.21784-1-chriscool@tuxfamily.org>

On Fri, Nov 16, 2018 at 6:31 PM Christian Couder <christian.couder@gmail.com> wrote:

Show 10 quoted lines
> diff --git a/read-cache.c b/read-cache.c
> index 8c924506dd..ea80600bff 100644
> --- a/read-cache.c
> +++ b/read-cache.c
> @@ -3165,7 +3165,8 @@ int write_locked_index(struct index_state *istate, struct lock_file *lock,
>                 struct tempfile *temp;
>                 int saved_errno;
>
> -               temp = mks_tempfile(git_path("sharedindex_XXXXXX"));
> +               /* Same permissions as the main .git/index file */

If the permission is already correct from the beginning (of this temp file), should df801f3f9f be reverted since we don't need to adjust permission anymore?

Or does $GIT_DIR/index go through the same adjust_shared_perm() anyway in the end, which means df801f3f9f must stay? If so, perhaps clarify that in the commit message.

> +               temp = mks_tempfile_sm(git_path("sharedindex_XXXXXX"), 0, 0666);
>                 if (!temp) {
>                         oidclr(&si->base_oid);
>                         ret = do_write_locked_index(istate, lock, flags);
-- 
Duy
Previous: Christian CouderNext: Christian Couder
Message 2 of 16 in “read-cache: write all indexes with the same permissions”
  1. read-cache: write all indexes with the same permissionsChristian Couder, Nov 16, 2018
  2. Duy NguyenNov 16, 2018
  3. Christian CouderNov 16, 2018
  4. Duy NguyenNov 16, 2018
  5. SZEDER GáborNov 16, 2018
  6. Ævar Arnfjörð BjarmasonNov 16, 2018
  7. Christian CouderNov 16, 2018
  8. Junio C HamanoNov 17, 2018
  9. SZEDER GáborNov 17, 2018
  10. Junio C HamanoNov 17, 2018
  11. Christian CouderNov 17, 2018
  12. Junio C HamanoNov 17, 2018
  13. Ævar Arnfjörð BjarmasonNov 17, 2018
  14. Junio C HamanoNov 18, 2018
  15. Ævar Arnfjörð BjarmasonNov 18, 2018
  16. read-cache: make the split index obey umask settingsÆvar Arnfjörð Bjarmason, Nov 18, 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.