Skip to contentSkip to conversation

cg-init should only process files

PATCH In review David Greaves 2 participants 3 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cg-init should only process files

cg-init tries to add directories

---
commit c6ecba40932efa0b28cd15d00fdab3b2607ec069
tree 39f7bebbadf6ebae67367b629d8cec298f7dcc90
parent f7d4b2adfc6a29036e2a8abe5b742e57b64e50d7
author David Greaves <[email protected]> Thu, 12 May 2005 13:05:03 +0100 committer David Greaves <david@ash.(none)> Thu, 12 May 2005 13:05:03 +0100

 cg-init |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
cg-init (mode:100755) +1 -1
Index: cg-init
===================================================================
@@ -31,7 +31,7 @@
 	echo "Cloned (origin $uri available as branch \"origin\")"
 else
 	git-read-tree # Seed the dircache
-	find * | xargs cg-add
+	find * -type f | xargs cg-add
 	cg-commit -C -m"Initial commit" -e
 fi
 exit 0
#1 lore raw

cg-init (mode:100755) line 34

Quoted 2 lines
cg-init (mode:100755) +1 -1
-       find * | xargs cg-add
+       find * -type f | xargs cg-add

I think we went through that a day or two ago: Problems:

1. You forgot symlinks.
2. It does not work if nothing matches "*". (Nor does the original.)
3. Either it should not match dotfiles in subdirectories, or else it should match
them in the top directory too.
4. With needs some -print0 and "--" protection.

Morten

#2 lore raw
Quoted 7 lines · Morten Welinder

cg-init (mode:100755) line 34

Quoted 4 lines
cg-init (mode:100755) +1 -1
-       find * | xargs cg-add
+       find * -type f | xargs cg-add

I think we went through that a day or two ago:

Doh!
I even commented.

Sorry for the noise.

David