* git add / update-cache --add fails.
@ 2005-04-25 21:26 Rhys Hardwick
2005-04-25 21:50 ` Rhys Hardwick
2005-04-25 21:52 ` Rhys Hardwick
0 siblings, 2 replies; 14+ messages in thread
From: Rhys Hardwick @ 2005-04-25 21:26 UTC (permalink / raw)
To: git
Hello people,
I get these errors when trying to add a new file to the directory. I pulled
the latest version today, and the day before yesterdays version had the same
problem (using git-pasky)
rhys@metatron:~/repo/learning.repo$ update-cache --add w1d4p1.c
fatal: Unable to add w1d4p1.c to database
rhys@metatron:~/repo/learning.repo$ git add w1d4p1.c
fatal: Unable to add w1d4p1.c to database
rhys@metatron:~/repo/learning.repo$
Any ideas?
Rhys
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: git add / update-cache --add fails.
2005-04-25 21:26 git add / update-cache --add fails Rhys Hardwick
@ 2005-04-25 21:50 ` Rhys Hardwick
2005-04-25 21:52 ` Rhys Hardwick
1 sibling, 0 replies; 14+ messages in thread
From: Rhys Hardwick @ 2005-04-25 21:50 UTC (permalink / raw)
To: git
To update - the last version of git to be merged with pasky is:
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: git add / update-cache --add fails.
2005-04-25 21:26 git add / update-cache --add fails Rhys Hardwick
2005-04-25 21:50 ` Rhys Hardwick
@ 2005-04-25 21:52 ` Rhys Hardwick
2005-04-25 22:09 ` Chris Wedgwood
` (2 more replies)
1 sibling, 3 replies; 14+ messages in thread
From: Rhys Hardwick @ 2005-04-25 21:52 UTC (permalink / raw)
To: git
Sorry about previous email.
Just to clarify, the latest version of git to be merged with pasky is:
4e03aae5feb2e3fd2f543796ca3d3e8aa86c02dc
I have tried rebooting, and looking at a few sources, and nothing has helped.
It's interesting noone else has had the same problem.
Rhys
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: git add / update-cache --add fails.
2005-04-25 21:52 ` Rhys Hardwick
@ 2005-04-25 22:09 ` Chris Wedgwood
2005-04-26 0:47 ` Linus Torvalds
2005-04-26 1:38 ` Junio C Hamano
2 siblings, 0 replies; 14+ messages in thread
From: Chris Wedgwood @ 2005-04-25 22:09 UTC (permalink / raw)
To: Rhys Hardwick; +Cc: git
On Mon, Apr 25, 2005 at 10:52:05PM +0100, Rhys Hardwick wrote:
> I have tried rebooting, and looking at a few sources, and nothing
> has helped. It's interesting noone else has had the same problem.
why would a reboot help?
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: git add / update-cache --add fails.
2005-04-25 21:52 ` Rhys Hardwick
2005-04-25 22:09 ` Chris Wedgwood
@ 2005-04-26 0:47 ` Linus Torvalds
2005-04-26 6:26 ` Rhys Hardwick
2005-04-26 1:38 ` Junio C Hamano
2 siblings, 1 reply; 14+ messages in thread
From: Linus Torvalds @ 2005-04-26 0:47 UTC (permalink / raw)
To: Rhys Hardwick; +Cc: git
On Mon, 25 Apr 2005, Rhys Hardwick wrote:
>
> Just to clarify, the latest version of git to be merged with pasky is:
>
> 4e03aae5feb2e3fd2f543796ca3d3e8aa86c02dc
>
> I have tried rebooting
[ somebody has been using windows for too long ;]
Just do an "strace update-cache --add xxxxx", that often gives a clue.
Also, "ltrace" is a wonderful tool at times.
update-cache will be unhappy if the file is unreadable, for example. But
it will also be unhappy if it cannot create the sha1 hashed object file,
which can happen if the permissions on the object directories are screwed
up or similar.
I think these things should generally show up as a sore thumb in an
strace.
Linus
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: git add / update-cache --add fails.
2005-04-25 21:52 ` Rhys Hardwick
2005-04-25 22:09 ` Chris Wedgwood
2005-04-26 0:47 ` Linus Torvalds
@ 2005-04-26 1:38 ` Junio C Hamano
2 siblings, 0 replies; 14+ messages in thread
From: Junio C Hamano @ 2005-04-26 1:38 UTC (permalink / raw)
To: rhys; +Cc: git
Just a wild guess. Are you trying to run the command from a
subdirectory, not from the top directory (that is, the one that
has subdirectory .git/ in it)?
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: git add / update-cache --add fails.
2005-04-26 0:47 ` Linus Torvalds
@ 2005-04-26 6:26 ` Rhys Hardwick
2005-04-27 2:35 ` Herbert Xu
0 siblings, 1 reply; 14+ messages in thread
From: Rhys Hardwick @ 2005-04-26 6:26 UTC (permalink / raw)
To: git
That may be true! I changed to linux full time only about 8 months ago, but
haven't looked back.
Ok strace gave me:
=====
rhys@metatron:~/repo/learning.repo$ strace update-cache --add w1d4p1.c
execve("/home/rhys/bin/update-cache", ["update-cache", "--add", "w1d4p1.c"],
[/*
37 vars */]) = 0
uname({sys="Linux", node="metatron", ...}) = 0
brk(0) = 0x8050000
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0
xb7fe9000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or
directory)
open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such file or
directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=78204, ...}) = 0
old_mmap(NULL, 78204, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7fd5000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or
directory)
open("/usr/lib/libz.so.1", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\200\27"..., 512) =
512
fstat64(3, {st_mode=S_IFREG|0644, st_size=67468, ...}) = 0
old_mmap(NULL, 70528, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xb7fc3000
old_mmap(0xb7fd4000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3,
0x100
00) = 0xb7fd4000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or
directory)
open("/usr/lib/i686/cmov/libssl.so.0.9.7", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0\205\0"..., 512) =
512
fstat64(3, {st_mode=S_IFREG|0644, st_size=198576, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0
xb7fc2000
old_mmap(NULL, 199344, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xb7f91000
old_mmap(0xb7fbf000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3,
0x2e
000) = 0xb7fbf000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or
directory)
open("/lib/tls/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0`Z\1\000"..., 512) =
512
fstat64(3, {st_mode=S_IFREG|0644, st_size=1254468, ...}) = 0
old_mmap(NULL, 1264780, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xb7e5c000
old_mmap(0xb7f86000, 36864, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3,
0x12
9000) = 0xb7f86000
old_mmap(0xb7f8f000, 7308, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|
MAP_ANONY
MOUS, -1, 0) = 0xb7f8f000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or
directory)
open("/usr/lib/i686/cmov/libcrypto.so.0.9.7", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0p\300\2"..., 512) =
512
fstat64(3, {st_mode=S_IFREG|0644, st_size=1029672, ...}) = 0
old_mmap(NULL, 1043608, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xb7d5d000
old_mmap(0xb7e47000, 73728, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3,
0xea
000) = 0xb7e47000
old_mmap(0xb7e59000, 11416, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|
MAP_ANON
YMOUS, -1, 0) = 0xb7e59000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or
directory)
open("/lib/tls/libdl.so.2", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\320\32"..., 512) =
512
fstat64(3, {st_mode=S_IFREG|0644, st_size=9872, ...}) = 0
old_mmap(NULL, 8632, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xb7d5a000
old_mmap(0xb7d5c000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3,
0x200
0) = 0xb7d5c000
close(3) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0xb7d59000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb7d592a0, limit:1048575,
seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1,
seg_not_present:0, useable:1}) = 0
munmap(0xb7fd5000, 78204) = 0
open(".git/index.lock", O_RDWR|O_CREAT|O_EXCL, 0600) = 3
access(".git/objects", X_OK) = 0
open(".git/index", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0600, st_size=176, ...}) = 0
mmap2(NULL, 176, PROT_READ, MAP_PRIVATE, 4, 0) = 0xb7fe8000
close(4) = 0
brk(0) = 0x8050000
brk(0x8071000) = 0x8071000
brk(0) = 0x8071000
open("w1d4p1.c", O_RDONLY) = -1 ENOENT (No such file or
directory)
write(2, "fatal: ", 7fatal: ) = 7
write(2, "Unable to add w1d4p1.c to databa"..., 34Unable to add w1d4p1.c to
database) = 34
write(2, "\n", 1
) = 1
unlink(".git/index.lock") = 0
exit_group(1) = ?
====
ltrace update-cache --add xxxx gave
====
rhys@metatron:~/repo/learning.repo$ ltrace update-cache --add w1d4p1.c
__libc_start_main(0x8049680, 3, 0xbffff854, 0x804ad60, 0x804adc0
<unfinished ...>
getenv("GIT_INDEX_FILE") = NULL
snprintf(".git/index.lock", 4097, "%s.lock", ".git/index") = 15
open(".git/index.lock", 194, 0600) = 3
__cxa_atexit(0x8049660, 0, 0, 0xb7f8de80, 0xbffff7c8) = 0
__errno_location() =
0xb7d59280
getenv("SHA1_FILE_DIRECTORY") = NULL
access(".git/objects", 1) = 0
getenv("GIT_INDEX_FILE") = NULL
open(".git/index", 0, 026777021220) = 4
__fxstat(3, 4, 0xbffff710) = 0
__errno_location() =
0xb7d59280
mmap(0, 176, 1, 2, 4) =
0xb7fe8000
close(4) = 0
SHA1_Init(0xbffff660, 0xb7e67bc8, 0xb7fc2290, 0x804870e, 96) = 1
SHA1_Update(0xbffff660, 0xb7fe8000, 156, 0x804870e, 96) = 1
SHA1_Final(0xbffff640, 0xbffff660, 156, 0x804870e, 96) = 1
calloc(27, 4) =
0x8050008
open("w1d4p1.c", 0, 044653) = -1
__errno_location() =
0xb7d59280
fputs("fatal: ", 0xb7f86f60fatal: )
= 1
vfprintf(0xb7f86f60, "Unable to add %s to database", 0xbffff794Unable to add
w1d4p1.c to database) = 34
fputc('\n', 0xb7f86f60
) = 10
exit(1 <unfinished ...>
unlink(".git/index.lock") = 0
+++ exited (status 1) +++
====
More information: this seems to be happening with all my local repositories.
I can remove files from the cache, and commit fine, but not add files.
Rhys
On Tuesday 26 Apr 2005 01:47, Linus Torvalds wrote:
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: git add / update-cache --add fails.
2005-04-26 6:26 ` Rhys Hardwick
@ 2005-04-27 2:35 ` Herbert Xu
2005-04-27 16:48 ` Ed L Cashin
0 siblings, 1 reply; 14+ messages in thread
From: Herbert Xu @ 2005-04-27 2:35 UTC (permalink / raw)
To: rhys; +Cc: git
Rhys Hardwick <rhys@rhyshardwick.co.uk> wrote:
>
> rhys@metatron:~/repo/learning.repo$ strace update-cache --add w1d4p1.c
...
> open("w1d4p1.c", O_RDONLY) = -1 ENOENT (No such file or
> directory)
The file that you're trying to add doesn't exist.
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: git add / update-cache --add fails.
2005-04-27 2:35 ` Herbert Xu
@ 2005-04-27 16:48 ` Ed L Cashin
2005-04-27 17:30 ` Petr Baudis
0 siblings, 1 reply; 14+ messages in thread
From: Ed L Cashin @ 2005-04-27 16:48 UTC (permalink / raw)
To: git
[-- Attachment #1: Type: text/plain, Size: 396 bytes --]
Herbert Xu <herbert@gondor.apana.org.au> writes:
> Rhys Hardwick <rhys@rhyshardwick.co.uk> wrote:
>>
>> rhys@metatron:~/repo/learning.repo$ strace update-cache --add w1d4p1.c
> ...
>> open("w1d4p1.c", O_RDONLY) = -1 ENOENT (No such file or
>> directory)
>
> The file that you're trying to add doesn't exist.
Maybe the user should be informed as soon as update-cache knows that?
[-- Attachment #2: diff --]
[-- Type: text/plain, Size: 360 bytes --]
update-cache.c: 11388582a830a6161d1c769aa8616bed6f593b8a
--- a/update-cache.c
+++ b/update-cache.c
@@ -98,6 +98,7 @@ static int add_file_to_cache(char *path)
fd = open(path, O_RDONLY);
if (fd < 0) {
+ fprintf(stderr, "update-cache Error: %s\n", strerror(errno));
if (errno == ENOENT) {
if (allow_remove)
return remove_file_from_cache(path);
[-- Attachment #3: Type: text/plain, Size: 319 bytes --]
By the way, I created that patch with "git diff" in my git-pasky
working directory. Strangely, I had to redirect standard error to the
same place as standard output in order to get the filename in the diff
output. I didn't check why the filename is on standard error,
though.
--
Ed L Cashin <ecashin@coraid.com>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: git add / update-cache --add fails.
2005-04-27 16:48 ` Ed L Cashin
@ 2005-04-27 17:30 ` Petr Baudis
2005-04-27 17:38 ` Ed L Cashin
2005-04-28 1:01 ` Paul Jackson
0 siblings, 2 replies; 14+ messages in thread
From: Petr Baudis @ 2005-04-27 17:30 UTC (permalink / raw)
To: Ed L Cashin; +Cc: git
Dear diary, on Wed, Apr 27, 2005 at 06:48:43PM CEST, I got a letter
where Ed L Cashin <ecashin@coraid.com> told me that...
> Herbert Xu <herbert@gondor.apana.org.au> writes:
>
> > Rhys Hardwick <rhys@rhyshardwick.co.uk> wrote:
> >>
> >> rhys@metatron:~/repo/learning.repo$ strace update-cache --add w1d4p1.c
> > ...
> >> open("w1d4p1.c", O_RDONLY) = -1 ENOENT (No such file or
> >> directory)
> >
> > The file that you're trying to add doesn't exist.
>
> Maybe the user should be informed as soon as update-cache knows that?
>
> update-cache.c: 11388582a830a6161d1c769aa8616bed6f593b8a
> --- a/update-cache.c
> +++ b/update-cache.c
> @@ -98,6 +98,7 @@ static int add_file_to_cache(char *path)
>
> fd = open(path, O_RDONLY);
> if (fd < 0) {
> + fprintf(stderr, "update-cache Error: %s\n", strerror(errno));
> if (errno == ENOENT) {
> if (allow_remove)
> return remove_file_from_cache(path);
FWIW, I have this in my tree for some time already. :-)
> By the way, I created that patch with "git diff" in my git-pasky
> working directory. Strangely, I had to redirect standard error to the
> same place as standard output in order to get the filename in the diff
> output. I didn't check why the filename is on standard error,
> though.
Interesting. Anyway, you are apparently using some quite antique
git-pasky version.
--
Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: git add / update-cache --add fails.
2005-04-27 17:30 ` Petr Baudis
@ 2005-04-27 17:38 ` Ed L Cashin
2005-04-28 1:01 ` Paul Jackson
1 sibling, 0 replies; 14+ messages in thread
From: Ed L Cashin @ 2005-04-27 17:38 UTC (permalink / raw)
To: Petr Baudis; +Cc: git
Petr Baudis <pasky@ucw.cz> writes:
...
>> + fprintf(stderr, "update-cache Error: %s\n", strerror(errno));
...
> FWIW, I have this in my tree for some time already. :-)
OK, nice.
...
>
>> By the way, I created that patch with "git diff" in my git-pasky
>> working directory. Strangely, I had to redirect standard error to the
>> same place as standard output in order to get the filename in the diff
>> output. I didn't check why the filename is on standard error,
>> though.
>
> Interesting. Anyway, you are apparently using some quite antique
> git-pasky version.
It wasn't on purpose! :)
Thinking back, my "git pull" probably didn't merge correctly because
it was too old. I'll just blow away the old one and start over.
--
Ed L Cashin <ecashin@coraid.com>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: git add / update-cache --add fails.
2005-04-27 17:30 ` Petr Baudis
2005-04-27 17:38 ` Ed L Cashin
@ 2005-04-28 1:01 ` Paul Jackson
2005-04-28 1:05 ` Petr Baudis
1 sibling, 1 reply; 14+ messages in thread
From: Paul Jackson @ 2005-04-28 1:01 UTC (permalink / raw)
To: Petr Baudis; +Cc: ecashin, git
Petr wrote:
> fd = open(path, O_RDONLY);
> if (fd < 0) {
> + fprintf(stderr, "update-cache Error: %s\n", strerror(errno));
It's usually a good idea to indicate which system call you were
attempting in such error messages, and if handy, the key argument.
Just the errno might not mean much:
> + fprintf(stderr, "update-cache open(%s) failed: %s\n", path, strerror(errno));
--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@engr.sgi.com> 1.650.933.1373, 1.925.600.0401
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: git add / update-cache --add fails.
2005-04-28 1:01 ` Paul Jackson
@ 2005-04-28 1:05 ` Petr Baudis
2005-04-28 1:20 ` Paul Jackson
0 siblings, 1 reply; 14+ messages in thread
From: Petr Baudis @ 2005-04-28 1:05 UTC (permalink / raw)
To: Paul Jackson; +Cc: ecashin, git
Dear diary, on Thu, Apr 28, 2005 at 03:01:43AM CEST, I got a letter
where Paul Jackson <pj@sgi.com> told me that...
> Petr wrote:
> > fd = open(path, O_RDONLY);
> > if (fd < 0) {
> > + fprintf(stderr, "update-cache Error: %s\n", strerror(errno));
>
> It's usually a good idea to indicate which system call you were
> attempting in such error messages, and if handy, the key argument.
> Just the errno might not mean much:
>
> > + fprintf(stderr, "update-cache open(%s) failed: %s\n", path, strerror(errno));
Sorry for being unclear, I meant that I did an analogous change in my
tree before; it is actually a little different:
if (errno == ENOENT) {
if (allow_remove)
return remove_file_from_cache(path);
}
return error("open(\"%s\"): %s", path, strerror(errno));
--
Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: git add / update-cache --add fails.
2005-04-28 1:05 ` Petr Baudis
@ 2005-04-28 1:20 ` Paul Jackson
0 siblings, 0 replies; 14+ messages in thread
From: Paul Jackson @ 2005-04-28 1:20 UTC (permalink / raw)
To: Petr Baudis; +Cc: ecashin, git
> I meant that I did an analogous change in my
ah - fine - sorry for the noise
--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@engr.sgi.com> 1.650.933.1373, 1.925.600.0401
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2005-04-28 1:16 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-25 21:26 git add / update-cache --add fails Rhys Hardwick
2005-04-25 21:50 ` Rhys Hardwick
2005-04-25 21:52 ` Rhys Hardwick
2005-04-25 22:09 ` Chris Wedgwood
2005-04-26 0:47 ` Linus Torvalds
2005-04-26 6:26 ` Rhys Hardwick
2005-04-27 2:35 ` Herbert Xu
2005-04-27 16:48 ` Ed L Cashin
2005-04-27 17:30 ` Petr Baudis
2005-04-27 17:38 ` Ed L Cashin
2005-04-28 1:01 ` Paul Jackson
2005-04-28 1:05 ` Petr Baudis
2005-04-28 1:20 ` Paul Jackson
2005-04-26 1:38 ` Junio C Hamano
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).