git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Versioning configuration files on a server: fatal: Unable to create '//etc/.git/index.lock': No such file or directory
@ 2010-11-17  6:24 Albert Strasheim
  2010-11-17 11:20 ` Matthijs Kooijman
  0 siblings, 1 reply; 12+ messages in thread
From: Albert Strasheim @ 2010-11-17  6:24 UTC (permalink / raw)
  To: git

Hello all

I'm trying to use git to version all the configuration files on a server:

su
cd /
git init
cd /
touch k
git add k #this works
cd /etc
git add hosts

This fails with:

fatal: Unable to create '//etc/.git/index.lock': No such file or directory

I'm running git-1.7.3.2-1.fc14.x86_64.

Is there any way to convince git to work in this scenario?

Regards

Albert

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Versioning configuration files on a server: fatal: Unable to create '//etc/.git/index.lock': No such file or directory
@ 2010-11-24  8:01 Ilyas --
  2010-11-24  8:45 ` Nguyen Thai Ngoc Duy
  0 siblings, 1 reply; 12+ messages in thread
From: Ilyas -- @ 2010-11-24  8:01 UTC (permalink / raw)
  To: git

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++;

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-11-24  9:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-17  6:24 Versioning configuration files on a server: fatal: Unable to create '//etc/.git/index.lock': No such file or directory Albert Strasheim
2010-11-17 11:20 ` Matthijs Kooijman
2010-11-18 15:52   ` Matthijs Kooijman
2010-11-18 16:00     ` Santi Béjar
2010-11-18 16:07     ` Nguyen Thai Ngoc Duy
2010-11-18 16:26       ` Nguyen Thai Ngoc Duy
2010-11-18 17:17         ` Matthijs Kooijman
2010-11-18 20:36           ` Matthijs Kooijman
  -- strict thread matches above, loose matches on Subject: below --
2010-11-24  8:01 Ilyas --
2010-11-24  8:45 ` Nguyen Thai Ngoc Duy
2010-11-24  8:50   ` Matthijs Kooijman
2010-11-24  9:46     ` Ilyas --

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).