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

[PATCH 0/1] Fix UX issue with commit-graph.lock

From
Derrick Stolee <dstolee@microsoft.com>
Date
May 9, 2018, 14:15 UTC
Message-ID
<20180509141523.89896-1-dstolee@microsoft.com>

We use the lockfile API to avoid multiple Git processes from writing to the commit-graph file in the .git/objects/info directory. In some cases, this directory may not exist, so we check for its existence.

The existing code does the following when acquiring the lock:
1. Try to acquire the lock.
2. If it fails, try to create the .git/object/info directory.
3. Try to acquire the lock, failing if necessary.

The problem is that if the lockfile exists, then the mkdir fails, giving an error that doesn't help the user:

  "fatal: cannot mkdir .git/objects/info: File exists"
While technically this honors the lockfile, it does not help the user.
Instead, do the following:
1. Check for existence of .git/objects/info; create if necessary.
2. Try to acquire the lock, failing if necessary.
The new output looks like:
  fatal: Unable to create '/home/stolee/git/.git/objects/info/commit-graph.lock': File exists.
  Another git process seems to be running in this repository, e.g.
  an editor opened by 'git commit'. Please make sure all processes
  are terminated then try again. If it still fails, a git process
  may have crashed in this repository earlier:
  remove the file manually to continue.
This patch is based on ds/generation-numbers
Derrick Stolee (1):
  commit-graph: fix UX issue when .lock file exists
 commit-graph.c | 24 ++++++++----------------
 1 file changed, 8 insertions(+), 16 deletions(-)
base-commit: 7547b95b4fbb8591726b1d9381c176cc27fc6aea
-- 
2.17.0.39.g685157f7fb
Next: Derrick Stolee
Message 1 of 11 in “Fix UX issue with commit-graph.lock”
  1. 0/1 Fix UX issue with commit-graph.lockDerrick Stolee, May 9, 2018
  2. 1/1 commit-graph: fix UX issue when .lock file existsDerrick Stolee, May 9, 2018
  3. Jeff KingMay 9, 2018
  4. Derrick StoleeMay 9, 2018
  5. Jeff KingMay 10, 2018
  6. Duy NguyenMay 9, 2018
  7. Junio C HamanoMay 10, 2018
  8. Derrick StoleeMay 10, 2018
  9. Junio C HamanoMay 11, 2018
  10. commit-graph: fix UX issue when .lock file existsDerrick Stolee, May 10, 2018
  11. Jeff KingMay 11, 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.