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

Versioning configuration files on a server: fatal: Unable to create '//etc/.git/index.lock': No such file or directory

From
I-Ilyas -- <umask00@gmail.com>
Date
Nov 24, 2010, 08:01 UTC
Message-ID
<AANLkTikfg9fLtqC6V3hQkiSZ+RfWqViJsHPxrt6ycoRR@mail.gmail.com>
Hi!

The patch bellow for problem 'Versioning configuration files on a server: fatal: Unable to create '//etc/.git/index.lock': No such file or directory' works fine on FreeBSD/Linux. Please fix this problem in upstream.

Thank you.
diff --git a/dir.c b/dir.c
index d1e5e5e..5408db9 100644
--- a/dir.c
+++ b/dir.c
@@ -943,6 +943,7 @@ int file_exists(const char *f)


 char *get_relative_cwd(char *buffer, int size, const char *dir)

 {
        char *cwd = buffer;
+       size_t len, root_len;

        if (!dir)
                return NULL;
@@ -952,6 +953,15 @@ char *get_relative_cwd(char *buffer, int size,
const char *dir)

        if (!is_absolute_path(dir))


                dir = make_absolute_path(dir);

+       len = strlen(dir);
+       root_len = offset_1st_component(dir);
+
+       if (root_len >= len) {

+           /* dir is the filesystem root, so the cwd is always inside */


+           root_len = offset_1st_component(cwd);
+           return cwd + root_len;
+       }
+
        while (*dir && *dir == *cwd) {

                dir++;
                cwd++;
Next: Nguyen Thai Ngoc Duy
Message 1 of 4 in “Versioning configuration files on a server: fatal: Unable to create '//etc/.git/index.lock': No such file or directory”
  1. Ilyas --Nov 24, 2010
  2. Nguyen Thai Ngoc DuyNov 24, 2010
  3. Matthijs KooijmanNov 24, 2010
  4. Ilyas --Nov 24, 2010

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.