# [PATCH Cogito] cg-init breaks if . contains sub-dir

22 messages from 2005-05-09 to 2005-05-12. Participants: Brandon Philips, Morten Welinder, Matthias Urlichs, Brian Gerst, Jan-Benedict Glaw, David Greaves, Martin Waitz, Junio C Hamano, H. Peter Anvin, David Mansfield, Petr Baudis.
Thread: https://gitlist.dev/t/555

## Brandon Philips, 2005-05-09 23:39

Subject: [PATCH Cogito] cg-init breaks if . contains sub-dir
Message-ID: <20050509233904.GB878@osuosl.org>
URL: https://gitlist.dev/e/20050509233904.GB878%40osuosl.org

```
Hi Petr,

cg-init has the ability to cg-add all files in the current directory.

But if the current directory has a sub directory cg-init breaks because
the `find *` command on line 34 returns directories which cg-add doesn't
accept.

Regards

Brandon Philips

Shameless plug: cogito-0.10 available in Gentoo

--
http://ifup.org

---

cg-init: needs update
Index: cg-init
===================================================================
--- 972d8624458936868e6f392b40858b7c362af8cd/cg-init  (mode:100755)
+++ uncommitted/cg-init  (mode:100755)
@@ -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 d | xargs cg-add 
 	cg-commit -C -m"Initial commit" -e
 fi
 exit 0

```

## Morten Welinder, 2005-05-10 01:36

Subject: Re: [PATCH Cogito] cg-init breaks if . contains sub-dir
Message-ID: <118833cc05050918367319d740@mail.gmail.com>
URL: https://gitlist.dev/e/118833cc05050918367319d740%40mail.gmail.com
In-Reply-To: <20050509233904.GB878@osuosl.org>

```
And it is also unhappy when the directory is empty or contains dotfiles only.

Morten

```

## Matthias Urlichs, 2005-05-10 03:41

Subject: Re: [PATCH Cogito] cg-init breaks if . contains sub-dir
Message-ID: <pan.2005.05.10.03.41.15.683163@smurf.noris.de>
URL: https://gitlist.dev/e/pan.2005.05.10.03.41.15.683163%40smurf.noris.de
In-Reply-To: <20050509233904.GB878@osuosl.org>

```
Hi, Brandon Philips wrote:

> -	find * | xargs cg-add
> +	find * ! -type d | xargs cg-add

Actually, (almost) every use of "find | xargs" which is not a subset of
"find -print0 | xargs -0r" is a bug.

So please don't do that. Special files aren't liked by git either, thus:

        find * -type f -print0 | xargs -0r cg-add

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de



```

## Brian Gerst, 2005-05-10 05:17

Subject: Re: [PATCH Cogito] cg-init breaks if . contains sub-dir
Message-ID: <428043EB.7010004@didntduck.org>
URL: https://gitlist.dev/e/428043EB.7010004%40didntduck.org
In-Reply-To: <pan.2005.05.10.03.41.15.683163@smurf.noris.de>

```
Matthias Urlichs wrote:
> Hi, Brandon Philips wrote:
> 
> 
>>-	find * | xargs cg-add
>>+	find * ! -type d | xargs cg-add
> 
> 
> Actually, (almost) every use of "find | xargs" which is not a subset of
> "find -print0 | xargs -0r" is a bug.
> 
> So please don't do that. Special files aren't liked by git either, thus:
> 
>         find * -type f -print0 | xargs -0r cg-add
> 

But it can handle symlinks:

	find * -type f -o -type l -print0 | xargs -0r cg-add

--
				Brian Gerst

```

## Jan-Benedict Glaw, 2005-05-10 07:52

Subject: Re: [PATCH Cogito] cg-init breaks if . contains sub-dir
Message-ID: <20050510075227.GA8176@lug-owl.de>
URL: https://gitlist.dev/e/20050510075227.GA8176%40lug-owl.de
In-Reply-To: <428043EB.7010004@didntduck.org>

```
On Tue, 2005-05-10 01:17:31 -0400, Brian Gerst <bgerst@didntduck.org> wrote:
> But it can handle symlinks:
> 
> 	find * -type f -o -type l -print0 | xargs -0r cg-add

This won't work because the explicit OR (-o) lower precedence compared
to the implicit AND between "-type l" and "-print0", thus this find
command will do print0 IFF the matched entry is a symlink. Use something
like this instead:

	find * \( -type f -o tyle l \) -print0 | ...

MfG, JBG

-- 
Jan-Benedict Glaw       jbglaw@lug-owl.de    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 fuer einen Freien Staat voll Freier Bürger" | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));

```

## Jan-Benedict Glaw, 2005-05-10 08:04

Subject: Re: [PATCH Cogito] cg-init breaks if . contains sub-dir
Message-ID: <20050510080445.GB8176@lug-owl.de>
URL: https://gitlist.dev/e/20050510080445.GB8176%40lug-owl.de
In-Reply-To: <20050510075227.GA8176@lug-owl.de>

```
On Tue, 2005-05-10 09:52:27 +0200, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
> On Tue, 2005-05-10 01:17:31 -0400, Brian Gerst <bgerst@didntduck.org> wrote:
> > But it can handle symlinks:
> > 
> > 	find * -type f -o -type l -print0 | xargs -0r cg-add
> 
> This won't work because the explicit OR (-o) lower precedence compared
> to the implicit AND between "-type l" and "-print0", thus this find
> command will do print0 IFF the matched entry is a symlink. Use something
> like this instead:
> 
> 	find * \( -type f -o tyle l \) -print0 | ...

Btw, this won't find dot files, so using "." as the path list (instead
of "*") might be wise...

MfG, JBG

-- 
Jan-Benedict Glaw       jbglaw@lug-owl.de    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 fuer einen Freien Staat voll Freier Bürger" | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));

```

## Matthias Urlichs, 2005-05-10 08:36

Subject: Re: [PATCH Cogito] cg-init breaks if . contains sub-dir
Message-ID: <20050510083609.GF11221@kiste.smurf.noris.de>
URL: https://gitlist.dev/e/20050510083609.GF11221%40kiste.smurf.noris.de
In-Reply-To: <20050510080445.GB8176@lug-owl.de>

```
Hi,

Jan-Benedict Glaw:
> > 	find * \( -type f -o tyle l \) -print0 | ...
> 
> Btw, this won't find dot files, so using "." as the path list (instead
> of "*") might be wise...
> 
git doesn't want to handle dot files anyway.

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de

```

## David Greaves, 2005-05-10 08:42

Subject: Re: [PATCH Cogito] cg-init breaks if . contains sub-dir
Message-ID: <428073EF.4090407@dgreaves.com>
URL: https://gitlist.dev/e/428073EF.4090407%40dgreaves.com
In-Reply-To: <20050510080445.GB8176@lug-owl.de>

```
Jan-Benedict Glaw wrote:

>On Tue, 2005-05-10 09:52:27 +0200, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
>  
>
>>On Tue, 2005-05-10 01:17:31 -0400, Brian Gerst <bgerst@didntduck.org> wrote:
>>    
>>
>>>But it can handle symlinks:
>>>
>>>	find * -type f -o -type l -print0 | xargs -0r cg-add
>>>      
>>>
>>This won't work because the explicit OR (-o) lower precedence compared
>>to the implicit AND between "-type l" and "-print0", thus this find
>>command will do print0 IFF the matched entry is a symlink. Use something
>>like this instead:
>>
>>	find * \( -type f -o tyle l \) -print0 | ...
>>    
>>
>
>Btw, this won't find dot files, so using "." as the path list (instead
>of "*") might be wise...
>  
>
This is a good thing - git ignores dot-files. see:
  http://www.dgreaves.com/git/git-update-cache.html
*
<file> *
    Files to act on. Note that files begining with *.* are discarded.
    This includes ./file and dir/./file. If you don't want this, then
    use cleaner names. The same applies to directories ending */* and
    paths with *//* 

Cogito should eventually spot and remove these since find * will
obviously find files beginning with a dot in subdirectories.

David

-- 


```

## Martin Waitz, 2005-05-10 08:56

Subject: Re: [PATCH Cogito] cg-init breaks if . contains sub-dir
Message-ID: <20050510085604.GV3562@admingilde.org>
URL: https://gitlist.dev/e/20050510085604.GV3562%40admingilde.org
In-Reply-To: <20050510083609.GF11221@kiste.smurf.noris.de>

```
hoi :)

On Tue, May 10, 2005 at 10:36:09AM +0200, Matthias Urlichs wrote:
> Jan-Benedict Glaw:
> > > 	find * \( -type f -o tyle l \) -print0 | ...
> > 
> > Btw, this won't find dot files, so using "." as the path list (instead
> > of "*") might be wise...
> > 
> git doesn't want to handle dot files anyway.

but find will output dotfiles in subdirectories.
So you have to prune the list anyway.

-- 
Martin Waitz

```

## Jan-Benedict Glaw, 2005-05-10 08:56

Subject: Re: [PATCH Cogito] cg-init breaks if . contains sub-dir
Message-ID: <20050510085626.GC8176@lug-owl.de>
URL: https://gitlist.dev/e/20050510085626.GC8176%40lug-owl.de
In-Reply-To: <20050510083609.GF11221@kiste.smurf.noris.de>

```
On Tue, 2005-05-10 10:36:09 +0200, Matthias Urlichs <smurf@smurf.noris.de> wrote:
> Jan-Benedict Glaw:
> > > 	find * \( -type f -o tyle l \) -print0 | ...
> > 
> > Btw, this won't find dot files, so using "." as the path list (instead
> > of "*") might be wise...
> > 
> git doesn't want to handle dot files anyway.

...which I actually consider to be a bug. Why should git care about the
filename, as long as it doesn't clash with ".git"?  After all, it's just
a plumbing mechanism designed to locate file contents by SHA-1 hashes.
It shouldn't deal with file names at all, really:-)

MfG, JBG

-- 
Jan-Benedict Glaw       jbglaw@lug-owl.de    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 fuer einen Freien Staat voll Freier Bürger" | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));

```

## Junio C Hamano, 2005-05-10 09:01

Subject: Re: [PATCH Cogito] cg-init breaks if . contains sub-dir
Message-ID: <7vis1rpi8a.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vis1rpi8a.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20050510080445.GB8176@lug-owl.de>

```
>>>>> "JBG" == Jan-Benedict Glaw <jbglaw@lug-owl.de> writes:

>> find * \( -type f -o tyle l \) -print0 | ...

JBG> Btw, this won't find dot files, so using "." as the path list (instead
JBG> of "*") might be wise...

Huh?  Since when GIT started managing paths whose _any_ of their
path component starts with a dot?


```

## Jan-Benedict Glaw, 2005-05-10 09:32

Subject: Re: [PATCH Cogito] cg-init breaks if . contains sub-dir
Message-ID: <20050510093212.GD8176@lug-owl.de>
URL: https://gitlist.dev/e/20050510093212.GD8176%40lug-owl.de
In-Reply-To: <7vis1rpi8a.fsf@assigned-by-dhcp.cox.net>

```
On Tue, 2005-05-10 02:01:41 -0700, Junio C Hamano <junkio@cox.net> wrote:
> >>>>> "JBG" == Jan-Benedict Glaw <jbglaw@lug-owl.de> writes:
> 
> >> find * \( -type f -o tyle l \) -print0 | ...
> 
> JBG> Btw, this won't find dot files, so using "." as the path list (instead
> JBG> of "*") might be wise...
> 
> Huh?  Since when GIT started managing paths whose _any_ of their
> path component starts with a dot?

The Catholic Church never ever had female priests, so how could this
be a good thing?

Ever thought about keeping some important files (of your $HOME) in some
SCM? For sure, some of those are dot files:-)

MfG, JBG

-- 
Jan-Benedict Glaw       jbglaw@lug-owl.de    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 fuer einen Freien Staat voll Freier Bürger" | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));

```

## Matthias Urlichs, 2005-05-10 09:39

Subject: Re: [PATCH Cogito] cg-init breaks if . contains sub-dir
Message-ID: <20050510093924.GH11221@kiste.smurf.noris.de>
URL: https://gitlist.dev/e/20050510093924.GH11221%40kiste.smurf.noris.de
In-Reply-To: <20050510093212.GD8176@lug-owl.de>

```
Hi,

Jan-Benedict Glaw:
> Ever thought about keeping some important files (of your $HOME) in some
> SCM? For sure, some of those are dot files:-)
> 
Yeah, but so are various local temporary files.

Please don't change that without talking to Linus.


FWIW, I keep important files backed up (backuppc is your friend).
No need to bother with an SCM for that.

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de

```

## Jan-Benedict Glaw, 2005-05-10 09:45

Subject: Re: [PATCH Cogito] cg-init breaks if . contains sub-dir
Message-ID: <20050510094538.GE8176@lug-owl.de>
URL: https://gitlist.dev/e/20050510094538.GE8176%40lug-owl.de
In-Reply-To: <20050510093924.GH11221@kiste.smurf.noris.de>

```
On Tue, 2005-05-10 11:39:24 +0200, Matthias Urlichs <smurf@smurf.noris.de> wrote:
> Jan-Benedict Glaw:
> > Ever thought about keeping some important files (of your $HOME) in some
> > SCM? For sure, some of those are dot files:-)
>
> Yeah, but so are various local temporary files.
> 
> Please don't change that without talking to Linus.

I won't.  You haven't seen a patch from me "fixing" this, too.  *I*
consider this as a defect, but that doesn't mean that I'll force others
to take this view, too.  But maybe I'll talk Linus into this when he's
back from his trip.

MfG, JBG

-- 
Jan-Benedict Glaw       jbglaw@lug-owl.de    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 fuer einen Freien Staat voll Freier Bürger" | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));

```

## David Greaves, 2005-05-10 09:47

Subject: Re: [PATCH Cogito] cg-init breaks if . contains sub-dir
Message-ID: <4280833E.2020300@dgreaves.com>
URL: https://gitlist.dev/e/4280833E.2020300%40dgreaves.com
In-Reply-To: <20050510085626.GC8176@lug-owl.de>

```
Jan-Benedict Glaw wrote:

>On Tue, 2005-05-10 10:36:09 +0200, Matthias Urlichs <smurf@smurf.noris.de> wrote:
>  
>
>>Jan-Benedict Glaw:
>>    
>>
>>>>	find * \( -type f -o tyle l \) -print0 | ...
>>>>        
>>>>
>>>Btw, this won't find dot files, so using "." as the path list (instead
>>>of "*") might be wise...
>>>
>>>      
>>>
>>git doesn't want to handle dot files anyway.
>>    
>>
>
>...which I actually consider to be a bug. Why should git care about the
>filename, as long as it doesn't clash with ".git"?  After all, it's just
>a plumbing mechanism designed to locate file contents by SHA-1 hashes.
>It shouldn't deal with file names at all, really:-)
>  
>
I tend to agree that a generic 'content tracking system' shouldn't
impose this kind of rule.
Requiring well formed filenames (eg no //, no trailing /s) is fine - but
dot-file-discrimination?

When I first saw it, I expected this kind of rule to (eventually) be
lifted from the plumbing to the porcelain. The minor problem is that
Linus seems to like getting his hands dirty and keeps using the plumbing ;)
(eek - these analogies...)

David

-- 


```

## Matthias Urlichs, 2005-05-10 09:58

Subject: Re: [PATCH Cogito] cg-init breaks if . contains sub-dir
Message-ID: <20050510095825.GI11221@kiste.smurf.noris.de>
URL: https://gitlist.dev/e/20050510095825.GI11221%40kiste.smurf.noris.de
In-Reply-To: <20050510094538.GE8176@lug-owl.de>

```
Hi,

Jan-Benedict Glaw:
> > Please don't change that without talking to Linus.
> 
> I won't.  You haven't seen a patch from me "fixing" this, too.  *I*
> consider this as a defect, but that doesn't mean that I'll force others
> to take this view, too.  But maybe I'll talk Linus into this when he's
> back from his trip.

That would be a good idea; I do support dropping (or at least relaxing)
that rule. For excluding unwanted files, I'd suggest using a .git/ignore
file with nice shiny patterns (*.a *.o *.swp ...) inside -- git already
supports that anyway.

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de

```

## H. Peter Anvin, 2005-05-10 15:14

Subject: Re: [PATCH Cogito] cg-init breaks if . contains sub-dir
Message-ID: <4280CFBE.6010904@zytor.com>
URL: https://gitlist.dev/e/4280CFBE.6010904%40zytor.com
In-Reply-To: <20050510094538.GE8176@lug-owl.de>

```
Jan-Benedict Glaw wrote:
> On Tue, 2005-05-10 11:39:24 +0200, Matthias Urlichs <smurf@smurf.noris.de> wrote:
> 
>>Jan-Benedict Glaw:
>>
>>>Ever thought about keeping some important files (of your $HOME) in some
>>>SCM? For sure, some of those are dot files:-)
>>
>>Yeah, but so are various local temporary files.
>>
>>Please don't change that without talking to Linus.
> 
> 
> I won't.  You haven't seen a patch from me "fixing" this, too.  *I*
> consider this as a defect, but that doesn't mean that I'll force others
> to take this view, too.  But maybe I'll talk Linus into this when he's
> back from his trip.
> 

Another vote for fixing this!

	-hpa

```

## David Mansfield, 2005-05-10 21:31

Subject: Re: [PATCH Cogito] cg-init breaks if . contains sub-dir
Message-ID: <4281281F.6000101@cobite.com>
URL: https://gitlist.dev/e/4281281F.6000101%40cobite.com
In-Reply-To: <20050510095825.GI11221@kiste.smurf.noris.de>

```
Matthias Urlichs wrote:
> Hi,
> 
> Jan-Benedict Glaw:
> 
>>>Please don't change that without talking to Linus.
>>
>>I won't.  You haven't seen a patch from me "fixing" this, too.  *I*
>>consider this as a defect, but that doesn't mean that I'll force others
>>to take this view, too.  But maybe I'll talk Linus into this when he's
>>back from his trip.
> 
> 
> That would be a good idea; I do support dropping (or at least relaxing)
> that rule. For excluding unwanted files, I'd suggest using a .git/ignore
> file with nice shiny patterns (*.a *.o *.swp ...) inside -- git already
> supports that anyway.
> 

Speaking of which, for a large project, (such as the kernel) it is a 
pain in the butt if exclude lists only consider the 'basename' of the 
file, and cannot include any path matching information.

For a long time there were generated files in the kernel which had the 
same names as non-generated files somewhere else in the kernel tree 
(under a different path).  Making an automated 'take latest patch from 
Linus, apply, commit' was really a pain because of this.

Is there/will there be support for path matching in the ignore files?

If the answer is no, but people like the idea, I could look into it.

David





```

## Matthias Urlichs, 2005-05-11 05:25

Subject: [PATCH Cogito] match pathnames in exclude handling
Message-ID: <20050511052546.GC11192@kiste.smurf.noris.de>
URL: https://gitlist.dev/e/20050511052546.GC11192%40kiste.smurf.noris.de
In-Reply-To: <4281281F.6000101@cobite.com>

```
Hi,

David Mansfield:
> Is there/will there be support for path matching in the ignore files?
> 
> If the answer is no, but people like the idea, I could look into it.
> 
I already did, last week. (I do need to cleanup my changes...)

The idea is that "foo" matches anywhere, "foo/bar" the exact pathname.
As a special case, "./foo" matches in the root directory only.

NB: "*" can cross subdirectory paths, so "*/foo/bar" does match
"a/b/c/foo/bar".

Signed-Off-By: Matthias Urlichs <smurf@smurf.noris.de>

---
Index: ls-files.c
===================================================================
--- 972d8624458936868e6f392b40858b7c362af8cd/ls-files.c  (mode:100644)
+++ 12deb13b12cdb338fe3fdc2e77a024490d6c39ea/ls-files.c  (mode:100644)
@@ -80,9 +80,17 @@
 	if (nr_excludes) {
 		const char *basename = strrchr(pathname, '/');
 		basename = (basename) ? basename+1 : pathname;
-		for (i = 0; i < nr_excludes; i++)
-			if (fnmatch(excludes[i], basename, 0) == 0)
-				return 1;
+		for (i = 0; i < nr_excludes; i++) {
+			if (excludes[i][0] != '.' || excludes[i][1] != '/') {
+				if (fnmatch(excludes[i], pathname, 0) == 0)
+					return 1;
+				if (basename != pathname && fnmatch(excludes[i], pathname, 0) == 0)
+					return 1;
+			} else {
+				if (fnmatch(excludes[i]+2, pathname, 0) == 0)
+					return 1;
+			}
+		}
 	}
 	return 0;
 }
@@ -129,10 +137,10 @@
 
 			if (de->d_name[0] == '.')
 				continue;
-			if (excluded(de->d_name) != show_ignored)
-				continue;
 			len = strlen(de->d_name);
 			memcpy(fullname + baselen, de->d_name, len+1);
+			if (excluded(fullname) != show_ignored)
+				continue;
 
 			switch (DTYPE(de)) {
 			struct stat st;
-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de

```

## H. Peter Anvin, 2005-05-11 21:30

Subject: Re: [PATCH Cogito] match pathnames in exclude handling
Message-ID: <4282797A.5020001@zytor.com>
URL: https://gitlist.dev/e/4282797A.5020001%40zytor.com
In-Reply-To: <20050511052546.GC11192@kiste.smurf.noris.de>

```
Matthias Urlichs wrote:
> 
> I already did, last week. (I do need to cleanup my changes...)
> 
> The idea is that "foo" matches anywhere, "foo/bar" the exact pathname.
> As a special case, "./foo" matches in the root directory only.
> 
> NB: "*" can cross subdirectory paths, so "*/foo/bar" does match
> "a/b/c/foo/bar".
> 

How does that mean foo*.c would match foo/bar/quux.c?  That's probably a 
bad thing.

I do like the (sadly, rarely used) convention that ** matches / whereas 
* doesn't.

	-hpa

```

## Matthias Urlichs, 2005-05-12 07:54

Subject: Re: [PATCH Cogito] match pathnames in exclude handling
Message-ID: <20050512075415.GA27670@kiste.smurf.noris.de>
URL: https://gitlist.dev/e/20050512075415.GA27670%40kiste.smurf.noris.de
In-Reply-To: <4282797A.5020001@zytor.com>

```
Hi,

H. Peter Anvin:
> How does that mean foo*.c would match foo/bar/quux.c?  That's probably a 
> bad thing.
> 
No, of course not -- that was a thinko on my part when I typed the
examples.  :-/

> I do like the (sadly, rarely used) convention that ** matches / whereas 
> * doesn't.
> 
fnmatch() doesn't support that. Of course, if there's demand for it,
it should be reasonably easy to have our own extended copy.

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de

```

## Petr Baudis, 2005-05-12 18:53

Subject: Re: [PATCH Cogito] cg-init breaks if . contains sub-dir
Message-ID: <20050512185358.GB324@pasky.ji.cz>
URL: https://gitlist.dev/e/20050512185358.GB324%40pasky.ji.cz
In-Reply-To: <20050510075227.GA8176@lug-owl.de>

```
Dear diary, on Tue, May 10, 2005 at 09:52:27AM CEST, I got a letter
where Jan-Benedict Glaw <jbglaw@lug-owl.de> told me that...
> On Tue, 2005-05-10 01:17:31 -0400, Brian Gerst <bgerst@didntduck.org> wrote:
> > But it can handle symlinks:
> > 
> > 	find * -type f -o -type l -print0 | xargs -0r cg-add
> 
> This won't work because the explicit OR (-o) lower precedence compared
> to the implicit AND between "-type l" and "-print0", thus this find
> command will do print0 IFF the matched entry is a symlink. Use something
> like this instead:
> 
> 	find * \( -type f -o tyle l \) -print0 | ...

Thanks to all the four co-authors, applied.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor

```
