{"thread":{"id":"314","subject":"git add / update-cache --add fails.","startedAt":"2005-04-25T21:26:00Z","lastAt":"2005-04-28T01:20:39Z","messageCount":14,"participants":["Rhys Hardwick","Chris Wedgwood","Linus Torvalds","Junio C Hamano","Herbert Xu","Ed L Cashin","Petr Baudis","Paul Jackson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"1654","messageId":"200504252226.00354.rhys@rhyshardwick.co.uk","threadId":"314","inReplyTo":null,"subject":"git add / update-cache --add fails.","fromName":"Rhys Hardwick","fromEmail":"rhys@rhyshardwick.co.uk","sentAt":"2005-04-25T21:26:00Z","receivedAt":"2005-04-25T21:26:00Z","isPatch":false,"sender":{"key":"rhys@rhyshardwick.co.uk","avatar":null},"body":"Hello people,\n\nI get these errors when trying to add a new file to the directory.  I pulled \nthe latest version today, and the day before yesterdays version had the same \nproblem (using git-pasky)\n\nrhys@metatron:~/repo/learning.repo$ update-cache --add w1d4p1.c\nfatal: Unable to add w1d4p1.c to database\nrhys@metatron:~/repo/learning.repo$ git add w1d4p1.c\nfatal: Unable to add w1d4p1.c to database\nrhys@metatron:~/repo/learning.repo$  \n\nAny ideas?\n\nRhys\n\n\n"},{"id":"1661","messageId":"200504252250.54809.rhys@rhyshardwick.co.uk","threadId":"314","inReplyTo":"200504252226.00354.rhys@rhyshardwick.co.uk","subject":"Re: git add / update-cache --add fails.","fromName":"Rhys Hardwick","fromEmail":"rhys@rhyshardwick.co.uk","sentAt":"2005-04-25T21:50:54Z","receivedAt":"2005-04-25T21:50:54Z","isPatch":false,"sender":{"key":"rhys@rhyshardwick.co.uk","avatar":null},"body":"To update - the last version of git to be merged with pasky is:\n\n\n"},{"id":"1662","messageId":"200504252252.05957.rhys@rhyshardwick.co.uk","threadId":"314","inReplyTo":"200504252226.00354.rhys@rhyshardwick.co.uk","subject":"Re: git add / update-cache --add fails.","fromName":"Rhys Hardwick","fromEmail":"rhys@rhyshardwick.co.uk","sentAt":"2005-04-25T21:52:05Z","receivedAt":"2005-04-25T21:52:05Z","isPatch":false,"sender":{"key":"rhys@rhyshardwick.co.uk","avatar":null},"body":"Sorry about previous email.\n\nJust to clarify, the latest version of git to be merged with pasky is:\n\n4e03aae5feb2e3fd2f543796ca3d3e8aa86c02dc\n\nI have tried rebooting, and looking at a few sources, and nothing has helped.  \nIt's interesting noone else has had the same problem.\n\nRhys\n\n\n"},{"id":"1665","messageId":"20050425220906.GA14676@taniwha.stupidest.org","threadId":"314","inReplyTo":"200504252252.05957.rhys@rhyshardwick.co.uk","subject":"Re: git add / update-cache --add fails.","fromName":"Chris Wedgwood","fromEmail":"cw@f00f.org","sentAt":"2005-04-25T22:09:06Z","receivedAt":"2005-04-25T22:09:06Z","isPatch":false,"sender":{"key":"cw@f00f.org","avatar":null},"body":"On Mon, Apr 25, 2005 at 10:52:05PM +0100, Rhys Hardwick wrote:\n\n> I have tried rebooting, and looking at a few sources, and nothing\n> has helped.  It's interesting noone else has had the same problem.\n\nwhy would a reboot help?\n"},{"id":"1682","messageId":"Pine.LNX.4.58.0504251741430.18901@ppc970.osdl.org","threadId":"314","inReplyTo":"200504252252.05957.rhys@rhyshardwick.co.uk","subject":"Re: git add / update-cache --add fails.","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-04-26T00:47:23Z","receivedAt":"2005-04-26T00:47:23Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Mon, 25 Apr 2005, Rhys Hardwick wrote:\n> \n> Just to clarify, the latest version of git to be merged with pasky is:\n> \n> 4e03aae5feb2e3fd2f543796ca3d3e8aa86c02dc\n> \n> I have tried rebooting\n\n[ somebody has been using windows for too long ;]\n\nJust do an \"strace update-cache --add xxxxx\", that often gives a clue. \nAlso, \"ltrace\" is a wonderful tool at times.\n\nupdate-cache will be unhappy if the file is unreadable, for example. But \nit will also be unhappy if it cannot create the sha1 hashed object file, \nwhich can happen if the permissions on the object directories are screwed \nup or similar.\n\nI think these things should generally show up as a sore thumb in an \nstrace.\n\n\t\tLinus\n"},{"id":"1689","messageId":"7vhdhuqpv1.fsf@assigned-by-dhcp.cox.net","threadId":"314","inReplyTo":"200504252252.05957.rhys@rhyshardwick.co.uk","subject":"Re: git add / update-cache --add fails.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-04-26T01:38:26Z","receivedAt":"2005-04-26T01:38:26Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Just a wild guess.  Are you trying to run the command from a\nsubdirectory, not from the top directory (that is, the one that\nhas subdirectory .git/ in it)?\n\n"},{"id":"1717","messageId":"200504260726.04908.rhys@rhyshardwick.co.uk","threadId":"314","inReplyTo":"Pine.LNX.4.58.0504251741430.18901@ppc970.osdl.org","subject":"Re: git add / update-cache --add fails.","fromName":"Rhys Hardwick","fromEmail":"rhys@rhyshardwick.co.uk","sentAt":"2005-04-26T06:26:04Z","receivedAt":"2005-04-26T06:26:04Z","isPatch":false,"sender":{"key":"rhys@rhyshardwick.co.uk","avatar":null},"body":"That may be true!  I changed to linux full time only about 8 months ago, but \nhaven't looked back.\n\nOk strace gave me:\n\n=====\n\nrhys@metatron:~/repo/learning.repo$ strace update-cache --add w1d4p1.c\nexecve(\"/home/rhys/bin/update-cache\", [\"update-cache\", \"--add\", \"w1d4p1.c\"], \n[/*\n 37 vars */]) = 0\nuname({sys=\"Linux\", node=\"metatron\", ...}) = 0\nbrk(0)                                  = 0x8050000\nold_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = \n0\nxb7fe9000\naccess(\"/etc/ld.so.nohwcap\", F_OK)      = -1 ENOENT (No such file or \ndirectory)\nopen(\"/etc/ld.so.preload\", O_RDONLY)    = -1 ENOENT (No such file or \ndirectory)\nopen(\"/etc/ld.so.cache\", O_RDONLY)      = 3\nfstat64(3, {st_mode=S_IFREG|0644, st_size=78204, ...}) = 0\nold_mmap(NULL, 78204, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7fd5000\nclose(3)                                = 0\naccess(\"/etc/ld.so.nohwcap\", F_OK)      = -1 ENOENT (No such file or \ndirectory)\nopen(\"/usr/lib/libz.so.1\", O_RDONLY)    = 3\nread(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) = \n512\nfstat64(3, {st_mode=S_IFREG|0644, st_size=67468, ...}) = 0\nold_mmap(NULL, 70528, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xb7fc3000\nold_mmap(0xb7fd4000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, \n0x100\n00) = 0xb7fd4000\nclose(3)                                = 0\naccess(\"/etc/ld.so.nohwcap\", F_OK)      = -1 ENOENT (No such file or \ndirectory)\nopen(\"/usr/lib/i686/cmov/libssl.so.0.9.7\", O_RDONLY) = 3\nread(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) = \n512\nfstat64(3, {st_mode=S_IFREG|0644, st_size=198576, ...}) = 0\nold_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = \n0\nxb7fc2000\nold_mmap(NULL, 199344, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xb7f91000\nold_mmap(0xb7fbf000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, \n0x2e\n000) = 0xb7fbf000\nclose(3)                                = 0\naccess(\"/etc/ld.so.nohwcap\", F_OK)      = -1 ENOENT (No such file or \ndirectory)\nopen(\"/lib/tls/libc.so.6\", O_RDONLY)    = 3\nread(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) = \n512\nfstat64(3, {st_mode=S_IFREG|0644, st_size=1254468, ...}) = 0\nold_mmap(NULL, 1264780, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xb7e5c000\nold_mmap(0xb7f86000, 36864, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, \n0x12\n9000) = 0xb7f86000\nold_mmap(0xb7f8f000, 7308, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|\nMAP_ANONY\nMOUS, -1, 0) = 0xb7f8f000\nclose(3)                                = 0\naccess(\"/etc/ld.so.nohwcap\", F_OK)      = -1 ENOENT (No such file or \ndirectory)\nopen(\"/usr/lib/i686/cmov/libcrypto.so.0.9.7\", O_RDONLY) = 3\nread(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) = \n512\nfstat64(3, {st_mode=S_IFREG|0644, st_size=1029672, ...}) = 0\nold_mmap(NULL, 1043608, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xb7d5d000\nold_mmap(0xb7e47000, 73728, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, \n0xea\n000) = 0xb7e47000\nold_mmap(0xb7e59000, 11416, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|\nMAP_ANON\nYMOUS, -1, 0) = 0xb7e59000\nclose(3)                                = 0\naccess(\"/etc/ld.so.nohwcap\", F_OK)      = -1 ENOENT (No such file or \ndirectory)\nopen(\"/lib/tls/libdl.so.2\", O_RDONLY)   = 3\nread(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) = \n512\nfstat64(3, {st_mode=S_IFREG|0644, st_size=9872, ...}) = 0\nold_mmap(NULL, 8632, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xb7d5a000\nold_mmap(0xb7d5c000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, \n0x200\n0) = 0xb7d5c000\nclose(3)                                = 0\nold_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = \n0xb7d59000\nset_thread_area({entry_number:-1 -> 6, base_addr:0xb7d592a0, limit:1048575, \nseg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, \nseg_not_present:0, useable:1}) = 0\nmunmap(0xb7fd5000, 78204)               = 0\nopen(\".git/index.lock\", O_RDWR|O_CREAT|O_EXCL, 0600) = 3\naccess(\".git/objects\", X_OK)            = 0\nopen(\".git/index\", O_RDONLY)            = 4\nfstat64(4, {st_mode=S_IFREG|0600, st_size=176, ...}) = 0\nmmap2(NULL, 176, PROT_READ, MAP_PRIVATE, 4, 0) = 0xb7fe8000\nclose(4)                                = 0\nbrk(0)                                  = 0x8050000\nbrk(0x8071000)                          = 0x8071000\nbrk(0)                                  = 0x8071000\nopen(\"w1d4p1.c\", O_RDONLY)              = -1 ENOENT (No such file or \ndirectory)\nwrite(2, \"fatal: \", 7fatal: )                  = 7\nwrite(2, \"Unable to add w1d4p1.c to databa\"..., 34Unable to add w1d4p1.c to \ndatabase) = 34\nwrite(2, \"\\n\", 1\n)                       = 1\nunlink(\".git/index.lock\")               = 0\nexit_group(1)                           = ?\n\n====\n\nltrace update-cache --add xxxx gave\n\n====\n\nrhys@metatron:~/repo/learning.repo$ ltrace update-cache --add w1d4p1.c\n__libc_start_main(0x8049680, 3, 0xbffff854, 0x804ad60, 0x804adc0 \n<unfinished ...>\ngetenv(\"GIT_INDEX_FILE\")                                                = NULL\nsnprintf(\".git/index.lock\", 4097, \"%s.lock\", \".git/index\")              = 15\nopen(\".git/index.lock\", 194, 0600)                                      = 3\n__cxa_atexit(0x8049660, 0, 0, 0xb7f8de80, 0xbffff7c8)                   = 0\n__errno_location()                                                      = \n0xb7d59280\ngetenv(\"SHA1_FILE_DIRECTORY\")                                           = NULL\naccess(\".git/objects\", 1)                                               = 0\ngetenv(\"GIT_INDEX_FILE\")                                                = NULL\nopen(\".git/index\", 0, 026777021220)                                     = 4\n__fxstat(3, 4, 0xbffff710)                                              = 0\n__errno_location()                                                      = \n0xb7d59280\nmmap(0, 176, 1, 2, 4)                                                   = \n0xb7fe8000\nclose(4)                                                                = 0\nSHA1_Init(0xbffff660, 0xb7e67bc8, 0xb7fc2290, 0x804870e, 96)            = 1\nSHA1_Update(0xbffff660, 0xb7fe8000, 156, 0x804870e, 96)                 = 1\nSHA1_Final(0xbffff640, 0xbffff660, 156, 0x804870e, 96)                  = 1\ncalloc(27, 4)                                                           = \n0x8050008\nopen(\"w1d4p1.c\", 0, 044653)                                             = -1\n__errno_location()                                                      = \n0xb7d59280\nfputs(\"fatal: \", 0xb7f86f60fatal: )                                            \n= 1\nvfprintf(0xb7f86f60, \"Unable to add %s to database\", 0xbffff794Unable to add \nw1d4p1.c to database)        = 34\nfputc('\\n', 0xb7f86f60\n)                                                 = 10\nexit(1 <unfinished ...>\nunlink(\".git/index.lock\")                                               = 0\n+++ exited (status 1) +++\n\n====\n\nMore information:  this seems to be happening with all my local repositories.  \nI can remove files from the cache, and commit fine, but not add files.\n\n\nRhys\n\nOn Tuesday 26 Apr 2005 01:47, Linus Torvalds wrote:\n\n\n"},{"id":"1841","messageId":"E1DQcOc-00054l-00@gondolin.me.apana.org.au","threadId":"314","inReplyTo":"200504260726.04908.rhys@rhyshardwick.co.uk","subject":"Re: git add / update-cache --add fails.","fromName":"Herbert Xu","fromEmail":"herbert@gondor.apana.org.au","sentAt":"2005-04-27T02:35:26Z","receivedAt":"2005-04-27T02:35:26Z","isPatch":false,"sender":{"key":"herbert@gondor.apana.org.au","avatar":null},"body":"Rhys Hardwick <rhys@rhyshardwick.co.uk> wrote:\n> \n> rhys@metatron:~/repo/learning.repo$ strace update-cache --add w1d4p1.c\n...\n> open(\"w1d4p1.c\", O_RDONLY)              = -1 ENOENT (No such file or \n> directory)\n\nThe file that you're trying to add doesn't exist.\n-- \nVisit Openswan at http://www.openswan.org/\nEmail: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>\nHome Page: http://gondor.apana.org.au/~herbert/\nPGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt\n"},{"id":"1876","messageId":"87ll74go7o.fsf@coraid.com","threadId":"314","inReplyTo":"E1DQcOc-00054l-00@gondolin.me.apana.org.au","subject":"Re: git add / update-cache --add fails.","fromName":"Ed L Cashin","fromEmail":"ecashin@coraid.com","sentAt":"2005-04-27T16:48:43Z","receivedAt":"2005-04-27T16:48:43Z","isPatch":false,"sender":{"key":"ecashin@coraid.com","avatar":null},"body":"Herbert Xu <herbert@gondor.apana.org.au> writes:\n\n> Rhys Hardwick <rhys@rhyshardwick.co.uk> wrote:\n>> \n>> rhys@metatron:~/repo/learning.repo$ strace update-cache --add w1d4p1.c\n> ...\n>> open(\"w1d4p1.c\", O_RDONLY)              = -1 ENOENT (No such file or \n>> directory)\n>\n> The file that you're trying to add doesn't exist.\n\nMaybe the user should be informed as soon as update-cache knows that?\n\n\n\nupdate-cache.c: 11388582a830a6161d1c769aa8616bed6f593b8a\n--- a/update-cache.c\n+++ b/update-cache.c\n@@ -98,6 +98,7 @@ static int add_file_to_cache(char *path)\n \n \tfd = open(path, O_RDONLY);\n \tif (fd < 0) {\n+\t\tfprintf(stderr, \"update-cache Error: %s\\n\", strerror(errno));\n \t\tif (errno == ENOENT) {\n \t\t\tif (allow_remove)\n \t\t\t\treturn remove_file_from_cache(path);\n\n\n\nBy the way, I created that patch with \"git diff\" in my git-pasky\nworking directory.  Strangely, I had to redirect standard error to the\nsame place as standard output in order to get the filename in the diff\noutput.  I didn't check why the filename is on standard error,\nthough.\n\n-- \n  Ed L Cashin <ecashin@coraid.com>\n"},{"id":"1877","messageId":"20050427173059.GE22956@pasky.ji.cz","threadId":"314","inReplyTo":"87ll74go7o.fsf@coraid.com","subject":"Re: git add / update-cache --add fails.","fromName":"Petr Baudis","fromEmail":"pasky@ucw.cz","sentAt":"2005-04-27T17:30:59Z","receivedAt":"2005-04-27T17:30:59Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Wed, Apr 27, 2005 at 06:48:43PM CEST, I got a letter\nwhere Ed L Cashin <ecashin@coraid.com> told me that...\n> Herbert Xu <herbert@gondor.apana.org.au> writes:\n> \n> > Rhys Hardwick <rhys@rhyshardwick.co.uk> wrote:\n> >> \n> >> rhys@metatron:~/repo/learning.repo$ strace update-cache --add w1d4p1.c\n> > ...\n> >> open(\"w1d4p1.c\", O_RDONLY)              = -1 ENOENT (No such file or \n> >> directory)\n> >\n> > The file that you're trying to add doesn't exist.\n> \n> Maybe the user should be informed as soon as update-cache knows that?\n> \n\n> update-cache.c: 11388582a830a6161d1c769aa8616bed6f593b8a\n> --- a/update-cache.c\n> +++ b/update-cache.c\n> @@ -98,6 +98,7 @@ static int add_file_to_cache(char *path)\n>  \n>  \tfd = open(path, O_RDONLY);\n>  \tif (fd < 0) {\n> +\t\tfprintf(stderr, \"update-cache Error: %s\\n\", strerror(errno));\n>  \t\tif (errno == ENOENT) {\n>  \t\t\tif (allow_remove)\n>  \t\t\t\treturn remove_file_from_cache(path);\n\nFWIW, I have this in my tree for some time already. :-)\n\n> By the way, I created that patch with \"git diff\" in my git-pasky\n> working directory.  Strangely, I had to redirect standard error to the\n> same place as standard output in order to get the filename in the diff\n> output.  I didn't check why the filename is on standard error,\n> though.\n\nInteresting. Anyway, you are apparently using some quite antique\ngit-pasky version.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nC++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor\n"},{"id":"1881","messageId":"87r7gwf7c8.fsf@coraid.com","threadId":"314","inReplyTo":"20050427173059.GE22956@pasky.ji.cz","subject":"Re: git add / update-cache --add fails.","fromName":"Ed L Cashin","fromEmail":"ecashin@coraid.com","sentAt":"2005-04-27T17:38:31Z","receivedAt":"2005-04-27T17:38:31Z","isPatch":false,"sender":{"key":"ecashin@coraid.com","avatar":null},"body":"Petr Baudis <pasky@ucw.cz> writes:\n\n...\n>> +\t\tfprintf(stderr, \"update-cache Error: %s\\n\", strerror(errno));\n...\n> FWIW, I have this in my tree for some time already. :-)\n\nOK, nice.\n\n...\n>\n>> By the way, I created that patch with \"git diff\" in my git-pasky\n>> working directory.  Strangely, I had to redirect standard error to the\n>> same place as standard output in order to get the filename in the diff\n>> output.  I didn't check why the filename is on standard error,\n>> though.\n>\n> Interesting. Anyway, you are apparently using some quite antique\n> git-pasky version.\n\nIt wasn't on purpose!  :)\n\nThinking back, my \"git pull\" probably didn't merge correctly because\nit was too old.  I'll just blow away the old one and start over.\n\n-- \n  Ed L Cashin <ecashin@coraid.com>\n\n"},{"id":"1957","messageId":"20050427180143.0447ceaa.pj@sgi.com","threadId":"314","inReplyTo":"20050427173059.GE22956@pasky.ji.cz","subject":"Re: git add / update-cache --add fails.","fromName":"Paul Jackson","fromEmail":"pj@sgi.com","sentAt":"2005-04-28T01:01:43Z","receivedAt":"2005-04-28T01:01:43Z","isPatch":false,"sender":{"key":"pj@sgi.com","avatar":null},"body":"Petr wrote:\n>  \tfd = open(path, O_RDONLY);\n>  \tif (fd < 0) {\n> +\t\tfprintf(stderr, \"update-cache Error: %s\\n\", strerror(errno));\n\nIt's usually a good idea to indicate which system call you were\nattempting in such error messages, and if handy, the key argument.\nJust the errno might not mean much:\n\n> +\t\tfprintf(stderr, \"update-cache open(%s) failed: %s\\n\", path, strerror(errno));\n\n-- \n                  I won't rest till it's the best ...\n                  Programmer, Linux Scalability\n                  Paul Jackson <pj@engr.sgi.com> 1.650.933.1373, 1.925.600.0401\n"},{"id":"1959","messageId":"20050428010523.GB3422@pasky.ji.cz","threadId":"314","inReplyTo":"20050427180143.0447ceaa.pj@sgi.com","subject":"Re: git add / update-cache --add fails.","fromName":"Petr Baudis","fromEmail":"pasky@ucw.cz","sentAt":"2005-04-28T01:05:23Z","receivedAt":"2005-04-28T01:05:23Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Thu, Apr 28, 2005 at 03:01:43AM CEST, I got a letter\nwhere Paul Jackson <pj@sgi.com> told me that...\n> Petr wrote:\n> >  \tfd = open(path, O_RDONLY);\n> >  \tif (fd < 0) {\n> > +\t\tfprintf(stderr, \"update-cache Error: %s\\n\", strerror(errno));\n> \n> It's usually a good idea to indicate which system call you were\n> attempting in such error messages, and if handy, the key argument.\n> Just the errno might not mean much:\n> \n> > +\t\tfprintf(stderr, \"update-cache open(%s) failed: %s\\n\", path, strerror(errno));\n\nSorry for being unclear, I meant that I did an analogous change in my\ntree before; it is actually a little different:\n\n\tif (errno == ENOENT) {\n\t\tif (allow_remove)\n\t\t\treturn remove_file_from_cache(path);\n\t}\n\treturn error(\"open(\\\"%s\\\"): %s\", path, strerror(errno));\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nC++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor\n"},{"id":"1964","messageId":"20050427182039.0c59f8f8.pj@sgi.com","threadId":"314","inReplyTo":"20050428010523.GB3422@pasky.ji.cz","subject":"Re: git add / update-cache --add fails.","fromName":"Paul Jackson","fromEmail":"pj@sgi.com","sentAt":"2005-04-28T01:20:39Z","receivedAt":"2005-04-28T01:20:39Z","isPatch":false,"sender":{"key":"pj@sgi.com","avatar":null},"body":"> I meant that I did an analogous change in my\n\nah - fine - sorry for the noise\n\n-- \n                  I won't rest till it's the best ...\n                  Programmer, Linux Scalability\n                  Paul Jackson <pj@engr.sgi.com> 1.650.933.1373, 1.925.600.0401\n"}]}