threads / discuss / 25830

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

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

## tl;dr

4 messages between Nov 24, 2010 and Nov 24, 2010.

replies: 3people: 3as markdown or json

Ilyas --· Nov 24, 2010, 08:01 UTC · lore
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++;
Nguyen Thai Ngoc Duy· Nov 24, 2010, 08:45 UTC · re: Ilyas -- · lore

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

On Wed, Nov 24, 2010 at 3:01 PM, Ilyas -- <umask00@gmail.com> wrote:
Show 6 quoted lines
> 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.
I also have another patch to fix this [1]. Hopefully Junio will pick it up soon.
[1] http://article.gmane.org/gmane.comp.version-control.git/161825
-- 
Duy
Matthijs Kooijman· Nov 24, 2010, 08:50 UTC · re: Nguyen Thai Ngoc Duy · lore

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

Hi folks,
On Wed, Nov 24, 2010 at 03:45:43PM +0700, Nguyen Thai Ngoc Duy wrote:
Show 7 quoted lines
> On Wed, Nov 24, 2010 at 3:01 PM, Ilyas -- <umask00@gmail.com> wrote:
> > 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.
> 
> I also have another patch to fix this [1]. Hopefully Junio will pick it up soon.

The patch sent by Ilyas is mine and it was just a quick hack. Please use the patch sent later by Nguyen instead, it solves the problem properly:

> [1] http://article.gmane.org/gmane.comp.version-control.git/161825
Ilyas --· Nov 24, 2010, 09:46 UTC · re: Matthijs Kooijman · lore

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

Yes, patch which I sent provided by Matthijs Kooijman in other thread (with the same subject).

We use git on many servers for track configs and when we get troubles with /.git we was really stressed.

I hope that this issue will be fixed in upstream soon.
Thank you.
On Wed, Nov 24, 2010 at 11:50 AM,  <matthijs@stdin.nl> wrote:
Show 24 quoted lines
> Hi folks,
>
> On Wed, Nov 24, 2010 at 03:45:43PM +0700, Nguyen Thai Ngoc Duy wrote:
>> On Wed, Nov 24, 2010 at 3:01 PM, Ilyas -- <umask00@gmail.com> wrote:
>> > 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.
>>
>> I also have another patch to fix this [1]. Hopefully Junio will pick it up soon.
> The patch sent by Ilyas is mine and it was just a quick hack. Please use
> the patch sent later by Nguyen instead, it solves the problem properly:
>
>> [1] http://article.gmane.org/gmane.comp.version-control.git/161825
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEARECAAYFAkzs0dYACgkQz0nQ5oovr7xKwQCgqd/l6cuub7zXlnbepYCDRwEW
> i88AniNyZFrWeYS5gNlKJfEnENo6ml2p
> =uRWs
> -----END PGP SIGNATURE-----
>
>

← back to recent threads