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

Bug? - Unexpected lock file error

From
EREric Raible <raible@gmail.com>
Date
Sep 5, 2008, 23:22 UTC
Message-ID
<279b37b20809051622q6b3ab37tec3f1726c71952e4@mail.gmail.com>

In playing around with creating new unatached branches I came across a seemingly bogus "fatal: unable to create '.git/index.lock': File exists" error message.

Now I understand that the final merge below is a no-op at best but the resulting error message is less than intuitive.

This is in "git version 1.6.0.1.319.g9f32b.dirty" (msysgit/devel, but I doubt that makes a difference).

Comments?

# Make a couple of versions of 'a' in main repo mkdir foo cd foo git init -q touch a for i in a b c; do echo $i > a && git add a && git commit -q -m $i; done

# Make a new repo and push it into main repo (to make an unattached branch) mkdir empty cd empty git init -q git commit -q --allow-empty -m empty git push .. master:empty

# Trigger "fatal: unable to create '.git/index.lock': File exists" error cd .. git merge empty

If 'empty' has any commits then the merge happens as expected. Is this just another special case involving initial commits that I should just get over? Or is there something more substantive going on here?

- Eric
Next: Junio C Hamano
Message 1 of 7 in “Bug? - Unexpected lock file error”
  1. Eric RaibleSep 5, 2008
  2. Junio C HamanoSep 5, 2008
  3. Eric RaibleSep 6, 2008
  4. Junio C HamanoSep 6, 2008
  5. Miklos VajnaSep 6, 2008
  6. builtin-merge: release the lockfile in try_merge_strategy()Miklos Vajna, Sep 6, 2008
  7. Junio C HamanoSep 7, 2008

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.