{"thread":{"id":"555","subject":"[PATCH Cogito] cg-init breaks if . contains sub-dir","startedAt":"2005-05-09T23:39:05Z","lastAt":"2005-05-12T18:53:58Z","messageCount":22,"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"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"2925","messageId":"20050509233904.GB878@osuosl.org","threadId":"555","inReplyTo":null,"subject":"[PATCH Cogito] cg-init breaks if . contains sub-dir","fromName":"Brandon Philips","fromEmail":"brandon@ifup.org","sentAt":"2005-05-09T23:39:05Z","receivedAt":"2005-05-09T23:39:05Z","isPatch":true,"sender":{"key":"brandon@ifup.org","avatar":"https://gravatar.com/avatar/a7bc9e3dda4b1f20d348289a89091d01c28589aee8b5165e9e1ed0d1c7b6211d?d=mp&s=160"},"body":"Hi Petr,\n\ncg-init has the ability to cg-add all files in the current directory.\n\nBut if the current directory has a sub directory cg-init breaks because\nthe `find *` command on line 34 returns directories which cg-add doesn't\naccept.\n\nRegards\n\nBrandon Philips\n\nShameless plug: cogito-0.10 available in Gentoo\n\n--\nhttp://ifup.org\n\n---\n\ncg-init: needs update\nIndex: cg-init\n===================================================================\n--- 972d8624458936868e6f392b40858b7c362af8cd/cg-init  (mode:100755)\n+++ uncommitted/cg-init  (mode:100755)\n@@ -31,7 +31,7 @@\n \techo \"Cloned (origin $uri available as branch \\\"origin\\\")\"\n else\n \tgit-read-tree # Seed the dircache\n-\tfind * | xargs cg-add\n+\tfind * ! -type d | xargs cg-add \n \tcg-commit -C -m\"Initial commit\" -e\n fi\n exit 0\n"},{"id":"2940","messageId":"118833cc05050918367319d740@mail.gmail.com","threadId":"555","inReplyTo":"20050509233904.GB878@osuosl.org","subject":"Re: [PATCH Cogito] cg-init breaks if . contains sub-dir","fromName":"Morten Welinder","fromEmail":"mwelinder@gmail.com","sentAt":"2005-05-10T01:36:26Z","receivedAt":"2005-05-10T01:36:26Z","isPatch":true,"sender":{"key":"mwelinder@gmail.com","avatar":null},"body":"And it is also unhappy when the directory is empty or contains dotfiles only.\n\nMorten\n"},{"id":"2947","messageId":"pan.2005.05.10.03.41.15.683163@smurf.noris.de","threadId":"555","inReplyTo":"20050509233904.GB878@osuosl.org","subject":"Re: [PATCH Cogito] cg-init breaks if . contains sub-dir","fromName":"Matthias Urlichs","fromEmail":"smurf@smurf.noris.de","sentAt":"2005-05-10T03:41:16Z","receivedAt":"2005-05-10T03:41:16Z","isPatch":true,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"Hi, Brandon Philips wrote:\n\n> -\tfind * | xargs cg-add\n> +\tfind * ! -type d | xargs cg-add\n\nActually, (almost) every use of \"find | xargs\" which is not a subset of\n\"find -print0 | xargs -0r\" is a bug.\n\nSo please don't do that. Special files aren't liked by git either, thus:\n\n        find * -type f -print0 | xargs -0r cg-add\n\n-- \nMatthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de\n\n\n"},{"id":"2952","messageId":"428043EB.7010004@didntduck.org","threadId":"555","inReplyTo":"pan.2005.05.10.03.41.15.683163@smurf.noris.de","subject":"Re: [PATCH Cogito] cg-init breaks if . contains sub-dir","fromName":"Brian Gerst","fromEmail":"bgerst@didntduck.org","sentAt":"2005-05-10T05:17:31Z","receivedAt":"2005-05-10T05:17:31Z","isPatch":true,"sender":{"key":"bgerst@didntduck.org","avatar":null},"body":"Matthias Urlichs wrote:\n> Hi, Brandon Philips wrote:\n> \n> \n>>-\tfind * | xargs cg-add\n>>+\tfind * ! -type d | xargs cg-add\n> \n> \n> Actually, (almost) every use of \"find | xargs\" which is not a subset of\n> \"find -print0 | xargs -0r\" is a bug.\n> \n> So please don't do that. Special files aren't liked by git either, thus:\n> \n>         find * -type f -print0 | xargs -0r cg-add\n> \n\nBut it can handle symlinks:\n\n\tfind * -type f -o -type l -print0 | xargs -0r cg-add\n\n--\n\t\t\t\tBrian Gerst\n"},{"id":"2960","messageId":"20050510075227.GA8176@lug-owl.de","threadId":"555","inReplyTo":"428043EB.7010004@didntduck.org","subject":"Re: [PATCH Cogito] cg-init breaks if . contains sub-dir","fromName":"Jan-Benedict Glaw","fromEmail":"jbglaw@lug-owl.de","sentAt":"2005-05-10T07:52:27Z","receivedAt":"2005-05-10T07:52:27Z","isPatch":true,"sender":{"key":"jbglaw@lug-owl.de","avatar":null},"body":"On Tue, 2005-05-10 01:17:31 -0400, Brian Gerst <bgerst@didntduck.org> wrote:\n> But it can handle symlinks:\n> \n> \tfind * -type f -o -type l -print0 | xargs -0r cg-add\n\nThis won't work because the explicit OR (-o) lower precedence compared\nto the implicit AND between \"-type l\" and \"-print0\", thus this find\ncommand will do print0 IFF the matched entry is a symlink. Use something\nlike this instead:\n\n\tfind * \\( -type f -o tyle l \\) -print0 | ...\n\nMfG, JBG\n\n-- \nJan-Benedict Glaw       jbglaw@lug-owl.de    . +49-172-7608481             _ O _\n\"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O\n fuer einen Freien Staat voll Freier Bürger\" | im Internet! |   im Irak!   O O O\nret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));\n"},{"id":"2961","messageId":"20050510080445.GB8176@lug-owl.de","threadId":"555","inReplyTo":"20050510075227.GA8176@lug-owl.de","subject":"Re: [PATCH Cogito] cg-init breaks if . contains sub-dir","fromName":"Jan-Benedict Glaw","fromEmail":"jbglaw@lug-owl.de","sentAt":"2005-05-10T08:04:45Z","receivedAt":"2005-05-10T08:04:45Z","isPatch":true,"sender":{"key":"jbglaw@lug-owl.de","avatar":null},"body":"On Tue, 2005-05-10 09:52:27 +0200, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:\n> On Tue, 2005-05-10 01:17:31 -0400, Brian Gerst <bgerst@didntduck.org> wrote:\n> > But it can handle symlinks:\n> > \n> > \tfind * -type f -o -type l -print0 | xargs -0r cg-add\n> \n> This won't work because the explicit OR (-o) lower precedence compared\n> to the implicit AND between \"-type l\" and \"-print0\", thus this find\n> command will do print0 IFF the matched entry is a symlink. Use something\n> like this instead:\n> \n> \tfind * \\( -type f -o tyle l \\) -print0 | ...\n\nBtw, this won't find dot files, so using \".\" as the path list (instead\nof \"*\") might be wise...\n\nMfG, JBG\n\n-- \nJan-Benedict Glaw       jbglaw@lug-owl.de    . +49-172-7608481             _ O _\n\"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O\n fuer einen Freien Staat voll Freier Bürger\" | im Internet! |   im Irak!   O O O\nret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));\n"},{"id":"2962","messageId":"20050510083609.GF11221@kiste.smurf.noris.de","threadId":"555","inReplyTo":"20050510080445.GB8176@lug-owl.de","subject":"Re: [PATCH Cogito] cg-init breaks if . contains sub-dir","fromName":"Matthias Urlichs","fromEmail":"smurf@smurf.noris.de","sentAt":"2005-05-10T08:36:09Z","receivedAt":"2005-05-10T08:36:09Z","isPatch":true,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"Hi,\n\nJan-Benedict Glaw:\n> > \tfind * \\( -type f -o tyle l \\) -print0 | ...\n> \n> Btw, this won't find dot files, so using \".\" as the path list (instead\n> of \"*\") might be wise...\n> \ngit doesn't want to handle dot files anyway.\n\n-- \nMatthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de\n"},{"id":"2963","messageId":"428073EF.4090407@dgreaves.com","threadId":"555","inReplyTo":"20050510080445.GB8176@lug-owl.de","subject":"Re: [PATCH Cogito] cg-init breaks if . contains sub-dir","fromName":"David Greaves","fromEmail":"david@dgreaves.com","sentAt":"2005-05-10T08:42:23Z","receivedAt":"2005-05-10T08:42:23Z","isPatch":true,"sender":{"key":"david@dgreaves.com","avatar":"https://gravatar.com/avatar/ca67bad50999edcdd137c9a65da2381557d175bea99ae956afdabc5785e42b79?d=mp&s=160"},"body":"Jan-Benedict Glaw wrote:\n\n>On Tue, 2005-05-10 09:52:27 +0200, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:\n>  \n>\n>>On Tue, 2005-05-10 01:17:31 -0400, Brian Gerst <bgerst@didntduck.org> wrote:\n>>    \n>>\n>>>But it can handle symlinks:\n>>>\n>>>\tfind * -type f -o -type l -print0 | xargs -0r cg-add\n>>>      \n>>>\n>>This won't work because the explicit OR (-o) lower precedence compared\n>>to the implicit AND between \"-type l\" and \"-print0\", thus this find\n>>command will do print0 IFF the matched entry is a symlink. Use something\n>>like this instead:\n>>\n>>\tfind * \\( -type f -o tyle l \\) -print0 | ...\n>>    \n>>\n>\n>Btw, this won't find dot files, so using \".\" as the path list (instead\n>of \"*\") might be wise...\n>  \n>\nThis is a good thing - git ignores dot-files. see:\n  http://www.dgreaves.com/git/git-update-cache.html\n*\n<file> *\n    Files to act on. Note that files begining with *.* are discarded.\n    This includes ./file and dir/./file. If you don't want this, then\n    use cleaner names. The same applies to directories ending */* and\n    paths with *//* \n\nCogito should eventually spot and remove these since find * will\nobviously find files beginning with a dot in subdirectories.\n\nDavid\n\n-- \n\n"},{"id":"2964","messageId":"20050510085604.GV3562@admingilde.org","threadId":"555","inReplyTo":"20050510083609.GF11221@kiste.smurf.noris.de","subject":"Re: [PATCH Cogito] cg-init breaks if . contains sub-dir","fromName":"Martin Waitz","fromEmail":"tali@admingilde.org","sentAt":"2005-05-10T08:56:04Z","receivedAt":"2005-05-10T08:56:04Z","isPatch":true,"sender":{"key":"tali@admingilde.org","avatar":"https://gravatar.com/avatar/3f89b03eee362187effabe257898735b475673a12265c398ea9161259ae91553?d=mp&s=160"},"body":"hoi :)\n\nOn Tue, May 10, 2005 at 10:36:09AM +0200, Matthias Urlichs wrote:\n> Jan-Benedict Glaw:\n> > > \tfind * \\( -type f -o tyle l \\) -print0 | ...\n> > \n> > Btw, this won't find dot files, so using \".\" as the path list (instead\n> > of \"*\") might be wise...\n> > \n> git doesn't want to handle dot files anyway.\n\nbut find will output dotfiles in subdirectories.\nSo you have to prune the list anyway.\n\n-- \nMartin Waitz\n"},{"id":"2965","messageId":"20050510085626.GC8176@lug-owl.de","threadId":"555","inReplyTo":"20050510083609.GF11221@kiste.smurf.noris.de","subject":"Re: [PATCH Cogito] cg-init breaks if . contains sub-dir","fromName":"Jan-Benedict Glaw","fromEmail":"jbglaw@lug-owl.de","sentAt":"2005-05-10T08:56:26Z","receivedAt":"2005-05-10T08:56:26Z","isPatch":true,"sender":{"key":"jbglaw@lug-owl.de","avatar":null},"body":"On Tue, 2005-05-10 10:36:09 +0200, Matthias Urlichs <smurf@smurf.noris.de> wrote:\n> Jan-Benedict Glaw:\n> > > \tfind * \\( -type f -o tyle l \\) -print0 | ...\n> > \n> > Btw, this won't find dot files, so using \".\" as the path list (instead\n> > of \"*\") might be wise...\n> > \n> git doesn't want to handle dot files anyway.\n\n...which I actually consider to be a bug. Why should git care about the\nfilename, as long as it doesn't clash with \".git\"?  After all, it's just\na plumbing mechanism designed to locate file contents by SHA-1 hashes.\nIt shouldn't deal with file names at all, really:-)\n\nMfG, JBG\n\n-- \nJan-Benedict Glaw       jbglaw@lug-owl.de    . +49-172-7608481             _ O _\n\"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O\n fuer einen Freien Staat voll Freier Bürger\" | im Internet! |   im Irak!   O O O\nret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));\n"},{"id":"2966","messageId":"7vis1rpi8a.fsf@assigned-by-dhcp.cox.net","threadId":"555","inReplyTo":"20050510080445.GB8176@lug-owl.de","subject":"Re: [PATCH Cogito] cg-init breaks if . contains sub-dir","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-05-10T09:01:41Z","receivedAt":"2005-05-10T09:01:41Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":">>>>> \"JBG\" == Jan-Benedict Glaw <jbglaw@lug-owl.de> writes:\n\n>> find * \\( -type f -o tyle l \\) -print0 | ...\n\nJBG> Btw, this won't find dot files, so using \".\" as the path list (instead\nJBG> of \"*\") might be wise...\n\nHuh?  Since when GIT started managing paths whose _any_ of their\npath component starts with a dot?\n\n"},{"id":"2967","messageId":"20050510093212.GD8176@lug-owl.de","threadId":"555","inReplyTo":"7vis1rpi8a.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH Cogito] cg-init breaks if . contains sub-dir","fromName":"Jan-Benedict Glaw","fromEmail":"jbglaw@lug-owl.de","sentAt":"2005-05-10T09:32:12Z","receivedAt":"2005-05-10T09:32:12Z","isPatch":true,"sender":{"key":"jbglaw@lug-owl.de","avatar":null},"body":"On Tue, 2005-05-10 02:01:41 -0700, Junio C Hamano <junkio@cox.net> wrote:\n> >>>>> \"JBG\" == Jan-Benedict Glaw <jbglaw@lug-owl.de> writes:\n> \n> >> find * \\( -type f -o tyle l \\) -print0 | ...\n> \n> JBG> Btw, this won't find dot files, so using \".\" as the path list (instead\n> JBG> of \"*\") might be wise...\n> \n> Huh?  Since when GIT started managing paths whose _any_ of their\n> path component starts with a dot?\n\nThe Catholic Church never ever had female priests, so how could this\nbe a good thing?\n\nEver thought about keeping some important files (of your $HOME) in some\nSCM? For sure, some of those are dot files:-)\n\nMfG, JBG\n\n-- \nJan-Benedict Glaw       jbglaw@lug-owl.de    . +49-172-7608481             _ O _\n\"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O\n fuer einen Freien Staat voll Freier Bürger\" | im Internet! |   im Irak!   O O O\nret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));\n"},{"id":"2968","messageId":"20050510093924.GH11221@kiste.smurf.noris.de","threadId":"555","inReplyTo":"20050510093212.GD8176@lug-owl.de","subject":"Re: [PATCH Cogito] cg-init breaks if . contains sub-dir","fromName":"Matthias Urlichs","fromEmail":"smurf@smurf.noris.de","sentAt":"2005-05-10T09:39:24Z","receivedAt":"2005-05-10T09:39:24Z","isPatch":true,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"Hi,\n\nJan-Benedict Glaw:\n> Ever thought about keeping some important files (of your $HOME) in some\n> SCM? For sure, some of those are dot files:-)\n> \nYeah, but so are various local temporary files.\n\nPlease don't change that without talking to Linus.\n\n\nFWIW, I keep important files backed up (backuppc is your friend).\nNo need to bother with an SCM for that.\n\n-- \nMatthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de\n"},{"id":"2969","messageId":"20050510094538.GE8176@lug-owl.de","threadId":"555","inReplyTo":"20050510093924.GH11221@kiste.smurf.noris.de","subject":"Re: [PATCH Cogito] cg-init breaks if . contains sub-dir","fromName":"Jan-Benedict Glaw","fromEmail":"jbglaw@lug-owl.de","sentAt":"2005-05-10T09:45:38Z","receivedAt":"2005-05-10T09:45:38Z","isPatch":true,"sender":{"key":"jbglaw@lug-owl.de","avatar":null},"body":"On Tue, 2005-05-10 11:39:24 +0200, Matthias Urlichs <smurf@smurf.noris.de> wrote:\n> Jan-Benedict Glaw:\n> > Ever thought about keeping some important files (of your $HOME) in some\n> > SCM? For sure, some of those are dot files:-)\n>\n> Yeah, but so are various local temporary files.\n> \n> Please don't change that without talking to Linus.\n\nI won't.  You haven't seen a patch from me \"fixing\" this, too.  *I*\nconsider this as a defect, but that doesn't mean that I'll force others\nto take this view, too.  But maybe I'll talk Linus into this when he's\nback from his trip.\n\nMfG, JBG\n\n-- \nJan-Benedict Glaw       jbglaw@lug-owl.de    . +49-172-7608481             _ O _\n\"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O\n fuer einen Freien Staat voll Freier Bürger\" | im Internet! |   im Irak!   O O O\nret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));\n"},{"id":"2970","messageId":"4280833E.2020300@dgreaves.com","threadId":"555","inReplyTo":"20050510085626.GC8176@lug-owl.de","subject":"Re: [PATCH Cogito] cg-init breaks if . contains sub-dir","fromName":"David Greaves","fromEmail":"david@dgreaves.com","sentAt":"2005-05-10T09:47:42Z","receivedAt":"2005-05-10T09:47:42Z","isPatch":true,"sender":{"key":"david@dgreaves.com","avatar":"https://gravatar.com/avatar/ca67bad50999edcdd137c9a65da2381557d175bea99ae956afdabc5785e42b79?d=mp&s=160"},"body":"Jan-Benedict Glaw wrote:\n\n>On Tue, 2005-05-10 10:36:09 +0200, Matthias Urlichs <smurf@smurf.noris.de> wrote:\n>  \n>\n>>Jan-Benedict Glaw:\n>>    \n>>\n>>>>\tfind * \\( -type f -o tyle l \\) -print0 | ...\n>>>>        \n>>>>\n>>>Btw, this won't find dot files, so using \".\" as the path list (instead\n>>>of \"*\") might be wise...\n>>>\n>>>      \n>>>\n>>git doesn't want to handle dot files anyway.\n>>    \n>>\n>\n>...which I actually consider to be a bug. Why should git care about the\n>filename, as long as it doesn't clash with \".git\"?  After all, it's just\n>a plumbing mechanism designed to locate file contents by SHA-1 hashes.\n>It shouldn't deal with file names at all, really:-)\n>  \n>\nI tend to agree that a generic 'content tracking system' shouldn't\nimpose this kind of rule.\nRequiring well formed filenames (eg no //, no trailing /s) is fine - but\ndot-file-discrimination?\n\nWhen I first saw it, I expected this kind of rule to (eventually) be\nlifted from the plumbing to the porcelain. The minor problem is that\nLinus seems to like getting his hands dirty and keeps using the plumbing ;)\n(eek - these analogies...)\n\nDavid\n\n-- \n\n"},{"id":"2971","messageId":"20050510095825.GI11221@kiste.smurf.noris.de","threadId":"555","inReplyTo":"20050510094538.GE8176@lug-owl.de","subject":"Re: [PATCH Cogito] cg-init breaks if . contains sub-dir","fromName":"Matthias Urlichs","fromEmail":"smurf@smurf.noris.de","sentAt":"2005-05-10T09:58:25Z","receivedAt":"2005-05-10T09:58:25Z","isPatch":true,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"Hi,\n\nJan-Benedict Glaw:\n> > Please don't change that without talking to Linus.\n> \n> I won't.  You haven't seen a patch from me \"fixing\" this, too.  *I*\n> consider this as a defect, but that doesn't mean that I'll force others\n> to take this view, too.  But maybe I'll talk Linus into this when he's\n> back from his trip.\n\nThat would be a good idea; I do support dropping (or at least relaxing)\nthat rule. For excluding unwanted files, I'd suggest using a .git/ignore\nfile with nice shiny patterns (*.a *.o *.swp ...) inside -- git already\nsupports that anyway.\n\n-- \nMatthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de\n"},{"id":"2977","messageId":"4280CFBE.6010904@zytor.com","threadId":"555","inReplyTo":"20050510094538.GE8176@lug-owl.de","subject":"Re: [PATCH Cogito] cg-init breaks if . contains sub-dir","fromName":"H. Peter Anvin","fromEmail":"hpa@zytor.com","sentAt":"2005-05-10T15:14:06Z","receivedAt":"2005-05-10T15:14:06Z","isPatch":true,"sender":{"key":"hpa@zytor.com","avatar":null},"body":"Jan-Benedict Glaw wrote:\n> On Tue, 2005-05-10 11:39:24 +0200, Matthias Urlichs <smurf@smurf.noris.de> wrote:\n> \n>>Jan-Benedict Glaw:\n>>\n>>>Ever thought about keeping some important files (of your $HOME) in some\n>>>SCM? For sure, some of those are dot files:-)\n>>\n>>Yeah, but so are various local temporary files.\n>>\n>>Please don't change that without talking to Linus.\n> \n> \n> I won't.  You haven't seen a patch from me \"fixing\" this, too.  *I*\n> consider this as a defect, but that doesn't mean that I'll force others\n> to take this view, too.  But maybe I'll talk Linus into this when he's\n> back from his trip.\n> \n\nAnother vote for fixing this!\n\n\t-hpa\n"},{"id":"2996","messageId":"4281281F.6000101@cobite.com","threadId":"555","inReplyTo":"20050510095825.GI11221@kiste.smurf.noris.de","subject":"Re: [PATCH Cogito] cg-init breaks if . contains sub-dir","fromName":"David Mansfield","fromEmail":"david@cobite.com","sentAt":"2005-05-10T21:31:11Z","receivedAt":"2005-05-10T21:31:11Z","isPatch":true,"sender":{"key":"david@cobite.com","avatar":null},"body":"Matthias Urlichs wrote:\n> Hi,\n> \n> Jan-Benedict Glaw:\n> \n>>>Please don't change that without talking to Linus.\n>>\n>>I won't.  You haven't seen a patch from me \"fixing\" this, too.  *I*\n>>consider this as a defect, but that doesn't mean that I'll force others\n>>to take this view, too.  But maybe I'll talk Linus into this when he's\n>>back from his trip.\n> \n> \n> That would be a good idea; I do support dropping (or at least relaxing)\n> that rule. For excluding unwanted files, I'd suggest using a .git/ignore\n> file with nice shiny patterns (*.a *.o *.swp ...) inside -- git already\n> supports that anyway.\n> \n\nSpeaking of which, for a large project, (such as the kernel) it is a \npain in the butt if exclude lists only consider the 'basename' of the \nfile, and cannot include any path matching information.\n\nFor a long time there were generated files in the kernel which had the \nsame names as non-generated files somewhere else in the kernel tree \n(under a different path).  Making an automated 'take latest patch from \nLinus, apply, commit' was really a pain because of this.\n\nIs there/will there be support for path matching in the ignore files?\n\nIf the answer is no, but people like the idea, I could look into it.\n\nDavid\n\n\n\n\n"},{"id":"3031","messageId":"20050511052546.GC11192@kiste.smurf.noris.de","threadId":"555","inReplyTo":"4281281F.6000101@cobite.com","subject":"[PATCH Cogito] match pathnames in exclude handling","fromName":"Matthias Urlichs","fromEmail":"smurf@smurf.noris.de","sentAt":"2005-05-11T05:25:46Z","receivedAt":"2005-05-11T05:25:46Z","isPatch":true,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"Hi,\n\nDavid Mansfield:\n> Is there/will there be support for path matching in the ignore files?\n> \n> If the answer is no, but people like the idea, I could look into it.\n> \nI already did, last week. (I do need to cleanup my changes...)\n\nThe idea is that \"foo\" matches anywhere, \"foo/bar\" the exact pathname.\nAs a special case, \"./foo\" matches in the root directory only.\n\nNB: \"*\" can cross subdirectory paths, so \"*/foo/bar\" does match\n\"a/b/c/foo/bar\".\n\nSigned-Off-By: Matthias Urlichs <smurf@smurf.noris.de>\n\n---\nIndex: ls-files.c\n===================================================================\n--- 972d8624458936868e6f392b40858b7c362af8cd/ls-files.c  (mode:100644)\n+++ 12deb13b12cdb338fe3fdc2e77a024490d6c39ea/ls-files.c  (mode:100644)\n@@ -80,9 +80,17 @@\n \tif (nr_excludes) {\n \t\tconst char *basename = strrchr(pathname, '/');\n \t\tbasename = (basename) ? basename+1 : pathname;\n-\t\tfor (i = 0; i < nr_excludes; i++)\n-\t\t\tif (fnmatch(excludes[i], basename, 0) == 0)\n-\t\t\t\treturn 1;\n+\t\tfor (i = 0; i < nr_excludes; i++) {\n+\t\t\tif (excludes[i][0] != '.' || excludes[i][1] != '/') {\n+\t\t\t\tif (fnmatch(excludes[i], pathname, 0) == 0)\n+\t\t\t\t\treturn 1;\n+\t\t\t\tif (basename != pathname && fnmatch(excludes[i], pathname, 0) == 0)\n+\t\t\t\t\treturn 1;\n+\t\t\t} else {\n+\t\t\t\tif (fnmatch(excludes[i]+2, pathname, 0) == 0)\n+\t\t\t\t\treturn 1;\n+\t\t\t}\n+\t\t}\n \t}\n \treturn 0;\n }\n@@ -129,10 +137,10 @@\n \n \t\t\tif (de->d_name[0] == '.')\n \t\t\t\tcontinue;\n-\t\t\tif (excluded(de->d_name) != show_ignored)\n-\t\t\t\tcontinue;\n \t\t\tlen = strlen(de->d_name);\n \t\t\tmemcpy(fullname + baselen, de->d_name, len+1);\n+\t\t\tif (excluded(fullname) != show_ignored)\n+\t\t\t\tcontinue;\n \n \t\t\tswitch (DTYPE(de)) {\n \t\t\tstruct stat st;\n-- \nMatthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de\n"},{"id":"3063","messageId":"4282797A.5020001@zytor.com","threadId":"555","inReplyTo":"20050511052546.GC11192@kiste.smurf.noris.de","subject":"Re: [PATCH Cogito] match pathnames in exclude handling","fromName":"H. Peter Anvin","fromEmail":"hpa@zytor.com","sentAt":"2005-05-11T21:30:34Z","receivedAt":"2005-05-11T21:30:34Z","isPatch":true,"sender":{"key":"hpa@zytor.com","avatar":null},"body":"Matthias Urlichs wrote:\n> \n> I already did, last week. (I do need to cleanup my changes...)\n> \n> The idea is that \"foo\" matches anywhere, \"foo/bar\" the exact pathname.\n> As a special case, \"./foo\" matches in the root directory only.\n> \n> NB: \"*\" can cross subdirectory paths, so \"*/foo/bar\" does match\n> \"a/b/c/foo/bar\".\n> \n\nHow does that mean foo*.c would match foo/bar/quux.c?  That's probably a \nbad thing.\n\nI do like the (sadly, rarely used) convention that ** matches / whereas \n* doesn't.\n\n\t-hpa\n"},{"id":"3122","messageId":"20050512075415.GA27670@kiste.smurf.noris.de","threadId":"555","inReplyTo":"4282797A.5020001@zytor.com","subject":"Re: [PATCH Cogito] match pathnames in exclude handling","fromName":"Matthias Urlichs","fromEmail":"smurf@smurf.noris.de","sentAt":"2005-05-12T07:54:16Z","receivedAt":"2005-05-12T07:54:16Z","isPatch":true,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"Hi,\n\nH. Peter Anvin:\n> How does that mean foo*.c would match foo/bar/quux.c?  That's probably a \n> bad thing.\n> \nNo, of course not -- that was a thinko on my part when I typed the\nexamples.  :-/\n\n> I do like the (sadly, rarely used) convention that ** matches / whereas \n> * doesn't.\n> \nfnmatch() doesn't support that. Of course, if there's demand for it,\nit should be reasonably easy to have our own extended copy.\n\n-- \nMatthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de\n"},{"id":"3174","messageId":"20050512185358.GB324@pasky.ji.cz","threadId":"555","inReplyTo":"20050510075227.GA8176@lug-owl.de","subject":"Re: [PATCH Cogito] cg-init breaks if . contains sub-dir","fromName":"Petr Baudis","fromEmail":"pasky@ucw.cz","sentAt":"2005-05-12T18:53:58Z","receivedAt":"2005-05-12T18:53:58Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Tue, May 10, 2005 at 09:52:27AM CEST, I got a letter\nwhere Jan-Benedict Glaw <jbglaw@lug-owl.de> told me that...\n> On Tue, 2005-05-10 01:17:31 -0400, Brian Gerst <bgerst@didntduck.org> wrote:\n> > But it can handle symlinks:\n> > \n> > \tfind * -type f -o -type l -print0 | xargs -0r cg-add\n> \n> This won't work because the explicit OR (-o) lower precedence compared\n> to the implicit AND between \"-type l\" and \"-print0\", thus this find\n> command will do print0 IFF the matched entry is a symlink. Use something\n> like this instead:\n> \n> \tfind * \\( -type f -o tyle l \\) -print0 | ...\n\nThanks to all the four co-authors, applied.\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"}]}