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

Re: Bug: git config does not respect read-only .gitconfig file

From
Jeff King <peff@peff.net>
Date
Nov 9, 2016, 03:34 UTC
Message-ID
<20161109033441.hp4eyf5qahimrtr3@sigill.intra.peff.net>
In-Reply-To
<xmqqk2cdbg5v.fsf@gitster.mtv.corp.google.com>
On Tue, Nov 08, 2016 at 05:22:52PM -0800, Junio C Hamano wrote:
Show 9 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> > Probably converting "rename(from, to)" to first check "access(to,
> > W_OK)". That's racy, but it's the best we could do.
> 
> Hmph, if these (possibly problematic) callers are all following the
> usual "lock, write to temp, rename" pattern, perhaps the lock_file()
> function can have access(path, W_OK) check before it returns a
> tempfile that has been successfully opened?

Yeah, that is a lot friendlier, as it prevents the caller from doing work (which may even involve the user typing things!) when it is clear that we would fail the final step anyway.

-Peff
Previous: Junio C HamanoNext: Jonathan Word
Message 6 of 7 in “Bug: git config does not respect read-only .gitconfig file”
  1. Jonathan WordNov 8, 2016
  2. Markus HitterNov 8, 2016
  3. Jonathan WordNov 8, 2016
  4. Jeff KingNov 8, 2016
  5. Junio C HamanoNov 9, 2016
  6. Jeff KingNov 9, 2016
  7. Jonathan WordNov 9, 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.