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

Re: [PATCH v3 0/2] Correctly handle transient files in shared repositories

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 11, 2016, 21:22 UTC
Message-ID
<xmqq60yzx14w.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<xmqqa8obx1ll.fsf@gitster.mtv.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 6 quoted lines
>> The only change relative to v2 is that the second commit message
>> clarifies why apply, fsck and fast-import are left unchanged.
>
> I do not think it clarifies to make "fsck" whose lost and found are
> written to GIT_DIR and "apply"'s ".rej" share the same "we dunno"
> reasoning, though.

I'd say we should go with this one. I think the reasoning for "fsck" should be a lot clearer this way.

-- >8 --
Author: Johannes Schindelin <johannes.schindelin@gmx.de>
Date:   Mon Jan 11 19:35:54 2016 +0100
    Handle more file writes correctly in shared repos
    
    In shared repositories, we have to be careful when writing files whose
    permissions do not allow users other than the owner to write them.
    
    In particular, we force the marks file of fast-export and the FETCH_HEAD
    when fetching to be rewritten from scratch.
    
    This commit does not touch other calls to fopen() that want to
    write files:
    
     - commands that write to working tree files (core.sharedRepository
       does not affect permission bits of working tree files),
       e.g. .rej file created by "apply --reject", result of applying a
       previous conflict resolution by "rerere", "git merge-file".
    
     - git am, when splitting mails (git-am correctly cleans up its directory
       after finishing, so there is no need to share those files between users)
    
     - git fsck, when writing lost&found blobs (they are written in the
       file under its object name, so an existing file with tighter
       permission that you cannot write into is OK, because what you are
       failing to write is the same contents that the file already has
       anyway).
    
     - git submodule clone, when writing the .git file, because the file
       will not be overwritten
    
     - git_terminal_prompt() in compat/terminal.c, because it is not writing to
       a file at all
    
     - git diff --output, because the output file is clearly not intended to be
       shared between the users of the current repository
    
     - git fast-import, when writing a crash report, because the reports' file
       names are unique due to an embedded process ID
    
     - mailinfo() in mailinfo.c, because the output is clearly not intended to
       be shared between the users of the current repository
    
     - check_or_regenerate_marks() in remote-testsvn.c, because this is only
       used for Git's internal testing
    
    Note that this patch does not touch callers of write_file() and
    write_file_gently(), which would benefit from the same scrutiny as
    to usage in shared repositories.  Most notable users are branch,
    daemon, submodule & worktree, and a worrisome call in transport.c
    when updating one ref (which ignores the shared flag).
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Previous: Junio C HamanoNext: Jeff King
Message 41 of 45 in “commit: ensure correct permissions of the commit message”
  1. commit: ensure correct permissions of the commit messageJohannes Schindelin, Dec 19, 2015
  2. Jeff KingDec 20, 2015
  3. Johannes SchindelinDec 20, 2015
  4. Torsten BögershausenDec 20, 2015
  5. Johannes SchindelinDec 30, 2015
  6. Junio C HamanoDec 21, 2015
  7. Jeff KingDec 21, 2015
  8. Junio C HamanoDec 21, 2015
  9. Johannes SchindelinDec 30, 2015
  10. Junio C HamanoDec 30, 2015
  11. Johannes SchindelinJan 1, 2016
  12. Junio C HamanoJan 4, 2016
  13. Johannes SchindelinJan 5, 2016
  14. Junio C HamanoJan 5, 2016
  15. Johannes SchindelinJan 6, 2016
  16. Jeff KingJan 6, 2016
  17. Johannes SchindelinJan 6, 2016
  18. SZEDER GáborJan 15, 2016
  19. Junio C HamanoJan 15, 2016
  20. Johannes SchindelinJan 15, 2016
  21. SZEDER GáborJan 15, 2016
  22. Johannes SchindelinJan 15, 2016
  23. 0/2 Correctly handle transient files in shared repositoriesJohannes Schindelin, Jan 6, 2016
  24. 1/2 commit: allow editing the commit message even in shared reposJohannes Schindelin, Jan 6, 2016
  25. Jeff KingJan 7, 2016
  26. Junio C HamanoJan 7, 2016
  27. 2/2 Handle more file writes correctly in shared reposJohannes Schindelin, Jan 6, 2016
  28. Jeff KingJan 7, 2016
  29. Johannes SchindelinJan 8, 2016
  30. Junio C HamanoJan 7, 2016
  31. Johannes SchindelinJan 8, 2016
  32. Junio C HamanoJan 8, 2016
  33. Johannes SchindelinJan 11, 2016
  34. Junio C HamanoJan 11, 2016
  35. Junio C HamanoJan 11, 2016
  36. 0/2 Correctly handle transient files in shared repositoriesJohannes Schindelin, Jan 11, 2016
  37. 1/2 commit: allow editing the commit message even in shared reposJohannes Schindelin, Jan 11, 2016
  38. 2/2 Handle more file writes correctly in shared reposJohannes Schindelin, Jan 11, 2016
  39. Jeff KingJan 11, 2016
  40. Junio C HamanoJan 11, 2016
  41. Junio C HamanoJan 11, 2016
  42. Jeff KingJan 11, 2016
  43. Junio C HamanoJan 11, 2016
  44. Jeff KingJan 11, 2016
  45. Johannes SchindelinJan 12, 2016

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.