{"thread":{"id":"252","subject":"[PATCH] update-cache.c ignore directories","startedAt":"2005-04-22T22:25:07Z","lastAt":"2005-04-22T22:27:10Z","messageCount":2,"participants":["atani","Fabian Franz"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"1334","messageId":"1114208707.12699@tsunami.he.net","threadId":"252","inReplyTo":null,"subject":"[PATCH] update-cache.c ignore directories","fromName":"atani","fromEmail":"atani@atani-software.net","sentAt":"2005-04-22T22:25:07Z","receivedAt":"2005-04-22T22:25:07Z","isPatch":true,"sender":{"key":"atani@atani-software.net","avatar":null},"body":"--- sorry if this dupes, mail client issues... \n \nIn my tests of using git (both Linus and pasky versions) I had a \nproblem with  \ndoing \"gitadd.sh *\" where * expands to include directories.  This \nsimple  \npatch allows update-cache.c to more gracefully handle a directory \nbeing  \npassed into the add_file_to_cache method.  Without this patch \nupdate-cache  \nexits prematurely with an error similar to: \n------------- \nfatal: Unable to add plx to database \n------------- \n \nNow it spits out: \n------------- \n'plx' is a directory, ignoring \n------------- \n \nWhich from an end user stand point is better. \n \nBTW, so far my tests of using git are positive for my small Dreamcast \nsoftware  \nprojects...  I was previously using subversion but find it to be a bit \nof  \noverkill for these small projects. \n \nMartin Schlemmer,  I ran \"emerge sync\" today and found git has been \nadded to  \nportage, version 0.5.  Also note that there are now two \"git\" entries \nwithin  \nportage app-misc/git and dev-util/git.  app-misc/git is GNU \nInteractive Tools \n \nMike \n \nSigned-off-by: Mike Dunston (atani@atani-software.net) \n \nIndex: update-cache.c \n=================================================================== \n--- 690494557d393ca78f69a8569880ed4a3aeda276/update-cache.c  \n(mode:100644  \nsha1:4353b80890ba2afbe22248a4dc25060aa4a429b2) \n+++ uncommitted/update-cache.c  (mode:100644) \n@@ -104,6 +104,11 @@ \n                close(fd); \n                return -1; \n        } \n+       if(S_ISDIR(st.st_mode)) { \n+               printf(\"'%s' is a directory, ignoring\\n\", path); \n+               close(fd); \n+               return 0; \n+       } \n        namelen = strlen(path); \n        size = cache_entry_size(namelen); \n        ce = malloc(size); \n"},{"id":"1335","messageId":"200504230027.14833.FabianFranz@gmx.de","threadId":"252","inReplyTo":"1114208707.12699@tsunami.he.net","subject":"Re: [PATCH] update-cache.c ignore directories","fromName":"Fabian Franz","fromEmail":"fabianfranz@gmx.de","sentAt":"2005-04-22T22:27:10Z","receivedAt":"2005-04-22T22:27:10Z","isPatch":true,"sender":{"key":"fabianfranz@gmx.de","avatar":null},"body":"Am Samstag, 23. April 2005 00:25 schrieb atani:\n\n> Now it spits out:\n> -------------\n> 'plx' is a directory, ignoring\n> -------------\n\nI saw that you spit this out to stdout. Wouldn't it be better to spit it out \nto stderr (even if its just a warning)?\n\ncu\n\nFabian\n\n"}]}