threads / discuss / 251

(unknown)

Subject: (unknown)

## tl;dr

2 messages between Apr 22, 2005 and Apr 22, 2005.

replies: 1people: 2as markdown or json

atani· Apr 22, 2005, 22:19 UTC · lore
In my tests of using git (both Linus and pasky versions) I had a 
problem with doing "gitadd.sh *" where * expands to include 
directories. This simple patch allows update-cache.c to more 
gracefully handle a directory being passed into the add_file_to_cache 
method.  Without this patch update-cache exits prematurely with an 
error similar to: 
------------- 
fatal: Unable to add plx to database 
------------- 
 
Now it spits out: 
------------- 
'plx' is a directory, ignoring 
------------- 
 
Which from an end user stand point is better. 
 
BTW, so far my tests of using git are positive for my small Dreamcast 
software projects...  I was previously using subversion but find it to 
be a bit of overkill for these small projects. 
 
Martin Schlemmer,  I ran "emerge sync" today and found git has been 
added to portage, version 0.5.  Also note that there are now two "git" 
entries within portage app-misc/git and dev-util/git.  app-misc/git is 
GNU Interactive Tools 
 
Mike 
 
Signed-off-by: Mike Dunston (atani@atani-software.net) 
 
Index: update-cache.c 
=================================================================== 
--- 690494557d393ca78f69a8569880ed4a3aeda276/update-cache.c  
(mode:100644  
sha1:4353b80890ba2afbe22248a4dc25060aa4a429b2) 
+++ uncommitted/update-cache.c  (mode:100644) 
@@ -104,6 +104,11 @@ 
                close(fd); 
                return -1; 
        } 
+       if(S_ISDIR(st.st_mode)) { 
+               printf("'%s' is a directory, ignoring\n", path); 
+               close(fd); 
+               return 0; 
+       } 
        namelen = strlen(path); 
        size = cache_entry_size(namelen); 
        ce = malloc(size); 
Martin Schlemmer· Apr 22, 2005, 23:16 UTC · re: atani · lore

Re:

On Fri, 2005-04-22 at 15:19 -0700, atani wrote:
<snip>
Show 5 quoted lines
> Martin Schlemmer,  I ran "emerge sync" today and found git has been 
> added to portage, version 0.5.  Also note that there are now two "git" 
> entries within portage app-misc/git and dev-util/git.  app-misc/git is 
> GNU Interactive Tools 
>  

Yeah, I know - that is actually why I complained to r3pek, as most of the guys interested in doing patches, etc will prob pull and build themselfs, but the user that just want to get the latest kernel, will rather want cogito (or git-pasky). So basically the git I mentioned that I wanted added (or maybe replace the current one in the tree depending on what r3pek do), was Petr's stuff ...

Thanks,
-- 
Martin Schlemmer

← back to recent threads