Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Wed, 19 Mar 2003 17:10:23 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Wed, 19 Mar 2003 17:10:23 -0500 Received: from ns0.cobite.com ([208.222.80.10]:35335 "EHLO ns0.cobite.com") by vger.kernel.org with ESMTP id ; Wed, 19 Mar 2003 17:10:20 -0500 Date: Wed, 19 Mar 2003 17:21:12 -0500 (EST) From: David Mansfield X-X-Sender: david@admin To: Andrea Arcangeli cc: linux-kernel@vger.kernel.org Subject: Re: [ANNOUNCE] cvsps support for parsing BK->CVS kernel tree logs In-Reply-To: <20030319213738.GR30541@dualathlon.random> Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-556791216-1329757273-1048112472=:19298" Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5805 Lines: 119 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---556791216-1329757273-1048112472=:19298 Content-Type: TEXT/PLAIN; charset=US-ASCII On Wed, 19 Mar 2003, Andrea Arcangeli wrote: > I'm downloading the new version now... ;) thanks > > > The file is actualy a substring match. If the -f argument matches as a > > so it doesn't sound a regex. Being able to specify more than 1 -f would > be very useful. Either that or regex would do it fine too with > '^net/core', so as far as I can write stuff like -f > '^net/core|^net/ipv4' I'm fine. > > I also think using match by default in the regex is cleaner. So I can > write -f 'net/core|net/ipv4' w/o bothering about the ^ because it become > implicit. And I can still use '.*net/core.*' if I want a substring > regex. I think substring search will be not common. > > But really, any kind of way you implement the 'multiple file' thing is > fine as far as I can specify more than 1 file ;). > Attached is a patch (on top of previous which is on top of 2.0b5) changes the -f to regex match. The regex is of course slightly slower than 'strstr' but I agree the advantage is worth it. It differs slightly in syntax (c library regex just works this way): cvsps -f '^net/core\|^net/ipv4' ^ You must escape the | symbol to separate the regex. Try it out! David -- /==============================\ | David Mansfield | | lkml@dm.cobite.com | \==============================/ ---556791216-1329757273-1048112472=:19298 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="cvsps-regex-filematch.patch" Content-Transfer-Encoding: BASE64 Content-Description: Content-Disposition: attachment; filename="cvsps-regex-filematch.patch" PyBwMQ0KSW5kZXg6IGN2c3BzLmMNCj09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0N ClJDUyBmaWxlOiAvc3VsdS9jdnNfbWFzdGVyL2N2c3BzL2N2c3BzLmMsdg0K cmV0cmlldmluZyByZXZpc2lvbiA0LjcxDQpkaWZmIC1iIC11IC1yNC43MSBj dnNwcy5jDQotLS0gY3ZzcHMuYwkxOSBNYXIgMjAwMyAyMjoxMTowOSAtMDAw MAk0LjcxDQorKysgY3ZzcHMuYwkxOSBNYXIgMjAwMyAyMjoxNToyNiAtMDAw MA0KQEAgLTc4LDcgKzc4LDggQEANCiBzdGF0aWMgY29uc3QgY2hhciAqIHJl c3RyaWN0X2F1dGhvcjsNCiBzdGF0aWMgaW50IGhhdmVfcmVzdHJpY3RfbG9n Ow0KIHN0YXRpYyByZWdleF90IHJlc3RyaWN0X2xvZzsNCi1zdGF0aWMgY29u c3QgY2hhciAqIHJlc3RyaWN0X2ZpbGU7DQorc3RhdGljIGludCBoYXZlX3Jl c3RyaWN0X2ZpbGU7DQorc3RhdGljIHJlZ2V4X3QgcmVzdHJpY3RfZmlsZTsN CiBzdGF0aWMgdGltZV90IHJlc3RyaWN0X2RhdGVfc3RhcnQ7DQogc3RhdGlj IHRpbWVfdCByZXN0cmljdF9kYXRlX2VuZDsNCiBzdGF0aWMgY29uc3QgY2hh ciAqIHJlc3RyaWN0X2JyYW5jaDsNCkBAIC0xMDgsNyArMTA5LDEwIEBADQog c3RhdGljIGludCBjb21wYXJlX3BhdGNoX3NldHMoY29uc3Qgdm9pZCAqLCBj b25zdCB2b2lkICopOw0KIHN0YXRpYyBpb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yBpbnQgcGF0Y2hfc2V0X21lbWJl cl9yZWdleChQYXRjaFNldCAqIHBzLCByZWdleF90ICogcmVnKQ0KK3sNCisg ICAgc3RydWN0IGxpc3RfaGVhZCAqIG5leHQgPSBwcy0+bWVtYmVycy5uZXh0 Ow0KKw0KKyAgICB3aGlsZSAobmV4dCAhPSAmcHMtPm1lbWJlcnMpDQorICAg IHsNCisJUGF0Y2hTZXRNZW1iZXIgKiBwc20gPSBsaXN0X2VudHJ5KG5leHQs IFBhdGNoU2V0TWVtYmVyLCBsaW5rKTsNCisJDQorCWlmIChyZWdleGVjKCZy ZXN0cmljdF9maWxlLCBwc20tPmZpbGUtPmZpbGVuYW1lLCAwLCBOVUxMLCAw KSA9PSAwKQ0KIAkgICAgcmV0dXJuIDE7DQogDQogCW5leHQgPSBuZXh0LT5u ZXh0Ow0K ---556791216-1329757273-1048112472=:19298-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/