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

Re: Why O_EXCL would make this difference? I am puzzled..

From
Linus Torvalds <torvalds@osdl.org>
Date
Jul 14, 2005, 16:08 UTC
Message-ID
<Pine.LNX.4.58.0507140904440.19183@g5.osdl.org>
In-Reply-To
<7v8y09g5sq.fsf@assigned-by-dhcp.cox.net>
On Thu, 14 Jul 2005, Junio C Hamano wrote:
Show 7 quoted lines
>
> The bisect search found that the commit
> 
> 	Make "git-checkout" create files with O_EXCL
> 
> makes the test t1005 fail.  But it is getting late so I give up
> to figuire this out tonight.
Ahh, thanks for noticing.
It says
	* expecting success: rm -f .git/index &&
	     rm -fr DF &&
	     mkdir DF &&
	     echo DF/DF >DF/DF &&
	     git-update-cache --add DF/DF &&
	     read_tree_twoway $treeDFDF $treeDF &&
	     git-ls-files --stage >DFDFcheck.out &&
	     diff -u DF.out DFDFcheck.out &&
	     check_cache_at DF clean && # different from pure 2-way
	     :
	100644 052efc3abbc31348f7abd34535b1953d38273257 3       DF
	100644 b90ea14b2dd74b6f377c10870b3757344bbe077c 1       DF/DF
	100644 b90ea14b2dd74b6f377c10870b3757344bbe077c 2       DF/DF
	Adding DF
	error: git-checkout-cache: unable to create file DF (File exists)
	Removing DF/DF
	100644 052efc3abbc31348f7abd34535b1953d38273257 0       DF
	DF: dirty
	* FAIL 24: DF vs DF/DF case test (#2) rm -f .git/index &&

Which is strange. If the path already exists, the "lstat(path, &st)" should have returned 0 in checkout_entry (which is the only caller of "write_entry()"), and that code does an "unlink(path)" before it calls write-entry. So I was sure O_EXCL wouldn't make any difference, but I'm obviously wrong, wrong, wrong.

I'll strace the dang thing.
		Linus
Previous: Junio C HamanoNext: Linus Torvalds
Message 2 of 3 in “Why O_EXCL would make this difference? I am puzzled..”
  1. Junio C HamanoJul 14, 2005
  2. Linus TorvaldsJul 14, 2005
  3. Linus TorvaldsJul 14, 2005

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.