[PATCH] refs: do not use cached refs in repack_without_ref

2012-12-21 Thread Jeff King
When we delete a ref that is packed, we rewrite the whole packed-refs file and simply omit the ref that no longer exists. However, we base the rewrite on whatever happens to be in our refs cache, not what is necessarily on disk. That opens us up to a race condition if another process is

Re: Change in cvsps maintainership, abd a --fast-export option

2012-12-21 Thread Michael Haggerty
On 12/20/2012 10:56 PM, Eric S. Raymond wrote: Earlier today David Mansfield handed off to me the cvsps project. This is the code used as an engine for reading CVS repositories by git-cvsimport. [...] I have added a --fast-export option to cvsps-3.0 that emits a git fast-import stream

Re: [PATCH v7 0/7] coloring test output after traffic signal

2012-12-21 Thread Jeff King
On Thu, Dec 20, 2012 at 07:12:31PM -0800, Junio C Hamano wrote: To conclude the bikeshedding discussion we had today, here is what I queued by squashing stuff into relevant patches, so that people can eyeball the result for the last time. Thanks, this looks OK to me. And thank you, Adam, for

Re: [PATCH v8 0/3] submodule update: add --remote for submodule's upstream changes

2012-12-21 Thread Heiko Voigt
Hi, On Wed, Dec 19, 2012 at 11:03:30AM -0500, wk...@tremily.us wrote: From: W. Trevor King wk...@tremily.us Comments on v7 seem to have petered out, so here's v8. Changes since v7: * Series based on gitster/master instead of v1.8.0. * In Documentation/config.txt, restored trailing line

Re: [PATCH v8 1/3] submodule: add get_submodule_config helper funtion

2012-12-21 Thread Heiko Voigt
On Wed, Dec 19, 2012 at 11:03:31AM -0500, wk...@tremily.us wrote: diff --git a/git-submodule.sh b/git-submodule.sh index 2365149..263a60c 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -153,6 +153,32 @@ die_if_unmatched () [...] +get_submodule_config () { + name=$1 +

Re: [PATCH v7 2/7] tests: paint known breakages in yellow

2012-12-21 Thread Stefano Lattarini
On 12/21/2012 04:12 AM, Junio C Hamano wrote: From: Adam Spiers g...@adamspiers.org Yellow seems a more appropriate color than bold green when considering the universal traffic lights coloring scheme, where green conveys the impression that everything's OK, and amber that something's not

Re: [PATCH v7 0/7] coloring test output after traffic signal

2012-12-21 Thread Adam Spiers
On Fri, Dec 21, 2012 at 8:15 AM, Jeff King p...@peff.net wrote: On Thu, Dec 20, 2012 at 07:12:31PM -0800, Junio C Hamano wrote: To conclude the bikeshedding discussion we had today, here is what I queued by squashing stuff into relevant patches, so that people can eyeball the result for the

Re: Change in cvsps maintainership, abd a --fast-export option

2012-12-21 Thread Eric S. Raymond
Michael Haggerty mhag...@alum.mit.edu: In 2009 I added tests demonstrating some of the erroneous behavior of git-cvsimport. The failing tests in t9601-t9603 are concrete examples of the problems mentioned in the manpage. Thanks, that will be extremely useful. One of the things I'm putting

Re: [PATCH v8 1/3] submodule: add get_submodule_config helper funtion

2012-12-21 Thread W. Trevor King
On Fri, Dec 21, 2012 at 09:20:33AM +0100, Heiko Voigt wrote: On Wed, Dec 19, 2012 at 11:03:31AM -0500, wk...@tremily.us wrote: diff --git a/git-submodule.sh b/git-submodule.sh index 2365149..263a60c 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -153,6 +153,32 @@

Re: Opera release Git-splitter, a sub-modularizing tool for Git

2012-12-21 Thread Michael J Gruber
Yngve N. Pettersen (Developer Opera Software ASA) venit, vidit, dixit 18.12.2012 15:51: Hello all, Today Opera Software released the Git-splitter, a small tool for sub-modularizing code in a git repo, with complete commit history, under the Apache 2.0 license. It's functionality is

Re: [PATCH] builtin/clean.c: Fix some sparse warnings

2012-12-21 Thread Zoltan Klinger
Thanks, Ramsay. I am rewriting the whole patch to do things a better way (as kindly suggested by Junio). So the print_filtered() function is going to disappear, but thanks for pointing out the problems with the existing code. Cheers, Zoltan On 21 December 2012 05:33, Ramsay Jones

Re: Opera release Git-splitter, a sub-modularizing tool for Git

2012-12-21 Thread Yngve Nysaeter Pettersen
Hi, On Fri, 21 Dec 2012 13:23:46 +0100, Michael J Gruber g...@drmicha.warpmail.net wrote: Yngve N. Pettersen (Developer Opera Software ASA) venit, vidit, dixit 18.12.2012 15:51: Hello all, Today Opera Software released the Git-splitter, a small tool for sub-modularizing code in a git repo,

Re: [BUG] Cannot push some grafted branches

2012-12-21 Thread Michael J Gruber
While replace refs are much more general than grafts, it seems the two main uses are: - grafts (change the recorded parents for a commit) - svn cleanup (convert tagging commits into tag objects) The latter one being quite a special case already. The script below has helped me move from grafts

Re: Opera release Git-splitter, a sub-modularizing tool for Git

2012-12-21 Thread Michael J Gruber
Yngve Nysaeter Pettersen venit, vidit, dixit 21.12.2012 13:43: Hi, On Fri, 21 Dec 2012 13:23:46 +0100, Michael J Gruber g...@drmicha.warpmail.net wrote: Yngve N. Pettersen (Developer Opera Software ASA) venit, vidit, dixit 18.12.2012 15:51: Hello all, Today Opera Software released the

Re: Noob Question

2012-12-21 Thread W T Riker
Hi Andrew, Thank you for a great explanation. It clears up a number of things but also creates some new questions. However, armed with this I am going to run through the documentation again and perhaps it will make more sense to me. One basic question, since I don't make changes from the Linux

recommendation for patch maintenance

2012-12-21 Thread Manlio Perillo
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi. I would like to have advices about some possible workflows to use when maintaining a patch, that can evolve over the time (fixing bugs, and applying advices from reviewers). In my case I have a single commit to maintain. The workflow I use now

Installation Plan

2012-12-21 Thread Dennis Putnam
After re-reading the git documentation and with Andrew's input I have changed my thinking on how to set this up and want a central repository. If I understand correctly, I am doing builds while I am developing new code so I need to clone my repository for Eclipse (I'm assuming the git plugin

Re: Opera release Git-splitter, a sub-modularizing tool for Git

2012-12-21 Thread Yngve Nysaeter Pettersen
On Fri, 21 Dec 2012 14:49:26 +0100, Michael J Gruber g...@drmicha.warpmail.net wrote: Yngve Nysaeter Pettersen venit, vidit, dixit 21.12.2012 13:43: Hi, On Fri, 21 Dec 2012 13:23:46 +0100, Michael J Gruber g...@drmicha.warpmail.net wrote: Yngve N. Pettersen (Developer Opera Software ASA)

git diff --ignore-space-at-eol issue

2012-12-21 Thread John Moon
Hi all, The --ignore-space-at-eol option is ignored when used in conjunction with --name-status. It works fine otherwise. $ git init Initialized empty Git repository in /tmp/test/.git/ $ printf hello\r\n test.txt $git -c core.autocrlf=false add test.txt $git commit -m. [master (root-commit)

Re: [PATCH v7 2/7] tests: paint known breakages in yellow

2012-12-21 Thread Junio C Hamano
Stefano Lattarini stefano.lattar...@gmail.com writes: On 12/21/2012 04:12 AM, Junio C Hamano wrote: From: Adam Spiers g...@adamspiers.org Yellow seems a more appropriate color than bold green when considering the universal traffic lights coloring scheme, where green conveys the impression

Re: Opera release Git-splitter, a sub-modularizing tool for Git

2012-12-21 Thread Matthieu Moy
Yngve Nysaeter Pettersen yn...@opera.com writes: The split command will create a new repository for all files foo in a folder (path/foo) and their commit history. The replant command reverses that process, re-adding the path prefix for each file. It may be possible to extend that process

[RFC/FR] Should git checkout (-B|-b) branch master...branch work?

2012-12-21 Thread Junio C Hamano
When you want to redo a branch forked from another branch (say 'master'), a handy way to work is to first detach HEAD at the previous fork point: $ git checkout master...branch and build an updated history on top of this state. Once you are done, you can verify your results with commands

Re: [PATCH] Python scripts audited for minimum compatible version and checks added.

2012-12-21 Thread Manlio Perillo
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Il 20/12/2012 15:13, Eric S. Raymond ha scritto: Signed-off-by: Eric S. Raymond e...@thyrsus.com --- Just my two cents. Isn't it better to have some core Python support inside a python/ directory in the git source tree (e.g. e simple

Re: [PATCH v2] mergetools/p4merge: Honor $TMPDIR for the /dev/null placeholder

2012-12-21 Thread Junio C Hamano
David Aguilar dav...@gmail.com writes: Use $TMPDIR when creating the /dev/null placeholder for p4merge. This keeps it out of the current directory. The usual $REMOTE this is theirs and $LOCAL this is ours are still created in the current directory, no? It is unclear why this this side does

Right way to import a repo

2012-12-21 Thread Florian Lindner
Hello, I have two repositories. tools and flof. I want to merge flof into tools (and flof will be deleted after that) while keeping history intact. Of course I've googled that and found a number of different solution which all seem to be pretty komplex, so I just tried it myself. It seems to

Fwd: [RFC/FR] Should git checkout (-B|-b) branch master...branch work?

2012-12-21 Thread Martin von Zweigbergk
Oops, meant for all of you. -- Forwarded message -- From: Martin von Zweigbergk martinv...@gmail.com Date: Fri, Dec 21, 2012 at 8:45 AM Subject: Re: [RFC/FR] Should git checkout (-B|-b) branch master...branch work? To: Junio C Hamano gits...@pobox.com On Fri, Dec 21, 2012 at

Re: [BUG] Cannot push some grafted branches

2012-12-21 Thread Junio C Hamano
Michael J Gruber g...@drmicha.warpmail.net writes: While replace refs are much more general than grafts, it seems the two main uses are: - grafts (change the recorded parents for a commit) - svn cleanup (convert tagging commits into tag objects) The latter one being quite a special case

Re: [PATCH v7 2/7] tests: paint known breakages in yellow

2012-12-21 Thread Stefano Lattarini
On 12/21/2012 04:46 PM, Junio C Hamano wrote: [SNIP] The only thing the additional knowledge adds seems to be to give rationale for the old choice of bold green---it was not chosen from thin-air but can be viewed as following the automake/autotest scheme, and other systems cannot agree on

Re: recommendation for patch maintenance

2012-12-21 Thread Junio C Hamano
Manlio Perillo manlio.peri...@gmail.com writes: I would like to have advices about some possible workflows to use when maintaining a patch, that can evolve over the time (fixing bugs, and applying advices from reviewers). In my case I have a single commit to maintain. The workflow I use

Re: [PATCH] http.c: Avoid username prompt for certifcate credentials

2012-12-21 Thread Jeff King
On Fri, Dec 21, 2012 at 05:31:19PM +0100, Rene Bredlau wrote: If sslCertPasswordProtected is set to true do not ask for username to decrypt rsa key. This question is pointless, the key is only protected by a password. Internaly the username is simply set to . Yeah, that makes sense. I suspect

Re: [PATCH] Documentation/git-clean: Document --force --force

2012-12-21 Thread Soren Brinkmann
On Thu, Dec 20, 2012 at 07:01:41PM -0800, Junio C Hamano wrote: Soren Brinkmann soren.brinkm...@xilinx.com writes: Ping? I *think* it is a mistake for the command to remove a separate project repository within, with any number of -f, so I'd rather see a patch to fix it, instead of

Re: Fwd: [RFC/FR] Should git checkout (-B|-b) branch master...branch work?

2012-12-21 Thread Junio C Hamano
Martin von Zweigbergk martinv...@gmail.com writes: I keep forgetting what git diff A..B does. diff is always about two endpoints, not the path that connects these two endpoints (aka range), and when you want to diff between two commits, you say diff A B. A..B happens to be accepted as such

Re: recommendation for patch maintenance

2012-12-21 Thread Manlio Perillo
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Il 21/12/2012 18:01, Junio C Hamano ha scritto: Manlio Perillo manlio.peri...@gmail.com writes: I would like to have advices about some possible workflows to use when maintaining a patch, that can evolve over the time (fixing bugs, and applying

[PATCH] http.c: Avoid username prompt for certifcate credentials

2012-12-21 Thread Rene Bredlau
If sslCertPasswordProtected is set to true do not ask for username to decrypt rsa key. This question is pointless, the key is only protected by a password. Internaly the username is simply set to . Signed-off-by: Rene Bredlau g...@unrelated.de --- http.c |1 + 1 files changed, 1

Re: [PATCH v4] git-completion.bash: add support for path completion

2012-12-21 Thread Junio C Hamano
Manlio Perillo manlio.peri...@gmail.com writes: + case $path in + ?*/*) echo ${path%%/*}/ ;; + *) echo $path ;; $path unquoted??? +# __git_index_files accepts 1 or 2 arguments: +# 1: Options to pass to ls-files (required). +#Supported options are

[PATCH 0/3] Move api-command.txt from ./technical/ to ./howto

2012-12-21 Thread Thomas Ackermann
api-command.txt describes a different kind of API than the other api-* documents. So better move it to the howto documents in ./Documentation/howto and rename to new-command.txt. [PATCH 1/3] Move ./technical/api-command.txt to ./howto/new-command.txt [PATCH 2/3] Add new-command.txt to

[PATCH 1/3] Move ./technical/api-command.txt to ./howto/new-command.txt

2012-12-21 Thread Thomas Ackermann
Signed-off-by: Thomas Ackermann th.ac...@arcor.de --- Documentation/{technical/api-command.txt = howto/new-command.txt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Documentation/{technical/api-command.txt = howto/new-command.txt} (100%) diff --git

[PATCH 2/3] Add new-command.txt to ./Documentation/Makefile

2012-12-21 Thread Thomas Ackermann
Signed-off-by: Thomas Ackermann th.ac...@arcor.de --- Documentation/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/Makefile b/Documentation/Makefile index 7df75d0..f3afcb6 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -21,6 +21,7 @@ ARTICLES +=

[PATCH 3/3] Amend new-command.txt to be processed correctly by howto-index.sh

2012-12-21 Thread Thomas Ackermann
Signed-off-by: Thomas Ackermann th.ac...@arcor.de --- Documentation/howto/new-command.txt | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Documentation/howto/new-command.txt b/Documentation/howto/new-command.txt index d3b9781..36502f6 100644 ---

Re: recommendation for patch maintenance

2012-12-21 Thread Junio C Hamano
Manlio Perillo manlio.peri...@gmail.com writes: I lose the history of all the changes I have made to produce the final version of a patch. Since for every new version of a patch I do a commit --amend, I can not see, as an example, the changes I have made between x and y versions of a patch.

Re: Python version auditing followup

2012-12-21 Thread Junio C Hamano
Joachim Schmitz j...@schmitz-digital.de writes: We have a working 2.4.2 for HP-NonStop and some major problems getting 2.7.3 to work. I do not think a platform that stops at 2.4.2 instead of going to higher 2.4.X series deserves to be called long term maintained by their vendors. It

Re: [PATCH 0/3] Move api-command.txt from ./technical/ to ./howto

2012-12-21 Thread Junio C Hamano
Thomas Ackermann th.ac...@arcor.de writes: api-command.txt describes a different kind of API than the other api-* documents. So better move it to the howto documents in ./Documentation/howto and rename to new-command.txt. [PATCH 1/3] Move ./technical/api-command.txt to

RE: Python version auditing followup

2012-12-21 Thread Joachim Schmitz
From: Junio C Hamano [mailto:gits...@pobox.com] Sent: Friday, December 21, 2012 7:28 PM To: Joachim Schmitz Cc: git@vger.kernel.org Subject: Re: Python version auditing followup Joachim Schmitz j...@schmitz-digital.de writes: We have a working 2.4.2 for HP-NonStop and some major

Re: [PATCH v4] git-completion.bash: add support for path completion

2012-12-21 Thread Manlio Perillo
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Il 21/12/2012 18:59, Junio C Hamano ha scritto: Manlio Perillo manlio.peri...@gmail.com writes: +case $path in +?*/*) echo ${path%%/*}/ ;; +*) echo $path ;; $path unquoted??? Missed again, thanks. I hope

[PATCH 1/2] tests: move test_cmp_rev to test-lib-functions

2012-12-21 Thread Martin von Zweigbergk
A function for checking that two given parameters refer to the same revision was defined in several places, so move the definition to test-lib-functions.sh instead. Signed-off-by: Martin von Zweigbergk martinv...@gmail.com --- t/t1505-rev-parse-last.sh | 18 +-

Re: Change in cvsps maintainership, abd a --fast-export option

2012-12-21 Thread Michael Haggerty
On 12/21/2012 11:44 AM, Eric S. Raymond wrote: Michael Haggerty mhag...@alum.mit.edu: If you haven't yet seen it, there is a writeup of the algorithm used by cvs2git to infer the history of a CVS repository [1]. If your goal is to make cvsps more robust, you might want to consider the ideas

[PATCH 2/2] learn to pick/revert into unborn branch

2012-12-21 Thread Martin von Zweigbergk
From the user's point of view, it seems natural to think that cherry-picking into an unborn branch should work, so make it work, with or without --ff. Cherry-picking anything other than a commit that only adds files, will naturally result in conflicts. Similarly, revert also works, but will

Re: Fwd: [RFC/FR] Should git checkout (-B|-b) branch master...branch work?

2012-12-21 Thread Michael Haggerty
On 12/21/2012 06:12 PM, Junio C Hamano wrote: diff is always about two endpoints, not the path that connects these two endpoints (aka range), and when you want to diff between two commits, you say diff A B. A..B happens to be accepted as such only by accident (e.g. the old command line parser

Re: Opera release Git-splitter, a sub-modularizing tool for Git

2012-12-21 Thread Yngve Nysaeter Pettersen
On Fri, 21 Dec 2012 16:49:21 +0100, Matthieu Moy matthieu@grenoble-inp.fr wrote: Yngve Nysaeter Pettersen yn...@opera.com writes: The split command will create a new repository for all files foo in a folder (path/foo) and their commit history. The replant command reverses that process,

Re: recommendation for patch maintenance

2012-12-21 Thread Manlio Perillo
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Il 21/12/2012 19:17, Junio C Hamano ha scritto: [...] Of course you can plan ahead (this is what I usually do when working on a series that is not how about this throw-away patch I send to this list all the time) and name the topic topic-v1, fork

Re: Fwd: [RFC/FR] Should git checkout (-B|-b) branch master...branch work?

2012-12-21 Thread Junio C Hamano
Off topic: I also find it hard to wrap my head around what diffing against a negative revision would mean. Looking at the result of running it, it seems to be the same as diffing against a positive one. That is not an off-topic at all, but is the crux of diff A..B being a hysterical raisins.

Re: Pushing symbolic references to remote repositories?

2012-12-21 Thread Shawn Pearce
On Fri, Dec 21, 2012 at 11:53 AM, Dun Peal dunpea...@gmail.com wrote: I need to share a symbolic reference - essentially, a named pointer to another reference - among multiple repositories. As shown in the code below, I can successfully create a local symbolic-ref `foo_ptr` to branch `foo`,

Re: Fwd: [RFC/FR] Should git checkout (-B|-b) branch master...branch work?

2012-12-21 Thread Michael Haggerty
On 12/21/2012 10:31 PM, Martin von Zweigbergk wrote: On Fri, Dec 21, 2012 at 11:43 AM, Michael Haggerty mhag...@alum.mit.edu wrote: On 12/21/2012 06:12 PM, Junio C Hamano wrote: side note: incidentally, now we have rev_cmdline_info support, we could start deprecating diff A..B

Re: Change in cvsps maintainership, abd a --fast-export option

2012-12-21 Thread Michael Haggerty
On 12/21/2012 10:43 PM, Eric S. Raymond wrote: Michael Haggerty mhag...@alum.mit.edu: Perhaps your experience is with an older version of cvs2svn? Well, it has been at least four years since I ran it on anything. Maybe that counts as old. cvs2svn version 2.0 (Aug 2007) totally changed how

Re: recommendation for patch maintenance

2012-12-21 Thread Junio C Hamano
On Fri, Dec 21, 2012 at 1:30 PM, Manlio Perillo manlio.peri...@gmail.com wrote: By the way, I would also like to be able to set the default value for the --output option in config file; something like: [format] output = +mp/$(git symbolic-ref --short HEAD) where the string will be

Re: Pushing symbolic references to remote repositories?

2012-12-21 Thread Junio C Hamano
Shawn Pearce spea...@spearce.org writes: On Fri, Dec 21, 2012 at 11:53 AM, Dun Peal dunpea...@gmail.com wrote: Is there a clean and reliable way to do that, or are symbolic references just not meant to be shared? There is no support for symbolic references in the network protocol, so they

What's cooking in git.git (Dec 2012, #06; Fri, 21)

2012-12-21 Thread Junio C Hamano
Here are the topics that have been cooking. Commits prefixed with '-' are only in 'pu' (proposed updates) while commits prefixed with '+' are in 'next'. I'll do another rc (hopefully final) for this cycle tomorrow, with documentation updates that are already in 'master'. The toolchain to

Re: [PATCH v2] mergetools/p4merge: Honor $TMPDIR for the /dev/null placeholder

2012-12-21 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: By the way, who is going to remove this temporary file once the command is done? Nevermind; I can see that once the backend returns it is removed in the same function. -- To unsubscribe from this list: send the line unsubscribe git in the body of a

Re: Re: Change in cvsps maintainership, abd a --fast-export option

2012-12-21 Thread Heiko Voigt
Hi, On Fri, Dec 21, 2012 at 05:44:37AM -0500, Eric S. Raymond wrote: Michael Haggerty mhag...@alum.mit.edu: In 2009 I added tests demonstrating some of the erroneous behavior of git-cvsimport. The failing tests in t9601-t9603 are concrete examples of the problems mentioned in the manpage.

Re: Re: Change in cvsps maintainership, abd a --fast-export option

2012-12-21 Thread Eric S. Raymond
Heiko Voigt hvo...@hvoigt.net: Back then when I was converting some repositories to git and I also wrote a quick testsuite for cvsps in an attempt to fix the bugs but gave up. That was the point when I wrote about cvsimports limitations in the documentation. My commits can be found here:

[PATCH 0/8] fnmatch replacement step 1

2012-12-21 Thread Nguyễn Thái Ngọc Duy
This series makes wildmatch compatible with fnmatch, at least for FNM_CASEFOLD and FNM_PATHNAME. This makes it possible to use wildmatch as a fnmatch replacement. The replacement is optional and turned on via USE_WILDMATCH. Step 2 would be turn USE_WILDMATCH by default and remove compat/fnmatch.

[PATCH 1/8] compat/fnmatch: respect NO_FNMATCH* even on glibc

2012-12-21 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- compat/fnmatch/fnmatch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compat/fnmatch/fnmatch.c b/compat/fnmatch/fnmatch.c index 9473aed..6f7387d 100644 --- a/compat/fnmatch/fnmatch.c +++ b/compat/fnmatch/fnmatch.c

[PATCH 3/8] wildmatch: make dowild() take arbitrary flags

2012-12-21 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- wildmatch.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/wildmatch.c b/wildmatch.c index 6ee1b09..a79f97e 100644 --- a/wildmatch.c +++ b/wildmatch.c @@ -52,7 +52,7 @@ typedef unsigned char uchar;

[PATCH 2/8] wildmatch: rename constants and update prototype

2012-12-21 Thread Nguyễn Thái Ngọc Duy
- All exported constants now have a prefix WM_ - Do not rely on FNM_* constants, use the WM_ counterparts - Remove TRUE and FALSE to follow Git's coding style - While at it, turn flags type from int to unsigned int - Add an (unused yet) argument to carry extra information so that we don't have

[PATCH 4/8] wildmatch: support no FNM_PATHNAME mode

2012-12-21 Thread Nguyễn Thái Ngọc Duy
So far, wildmatch() has always honoured directory boundary and there was no way to turn it off. Make it behave more like fnmatch() by requiring all callers that want the FNM_PATHNAME behaviour to pass that in the equivalent flag WM_PATHNAME. Callers that do not specify WM_PATHNAME will get

[PATCH 5/8] test-wildmatch: add perf command to compare wildmatch and fnmatch

2012-12-21 Thread Nguyễn Thái Ngọc Duy
It takes a text file, a pattern, a number n and pathname flag. Each line in the text file is matched against the pattern n times. If pathname is given, FNM_PATHNAME is used. test-wildmatch is built with -O2 and tested against glibc 2.14.1 (also -O2) and compat/fnmatch. The input file is

[PATCH 6/8] Makefile: add USE_WILDMATCH to use wildmatch as fnmatch

2012-12-21 Thread Nguyễn Thái Ngọc Duy
This is similar to NO_FNMATCH but it uses wildmatch instead of compat/fnmatch. This is an intermediate step to let wildmatch be used as fnmatch replacement for wider audience before it replaces fnmatch completely and compat/fnmatch is removed. fnmatch in test-wildmatch is not impacted by this and

[PATCH 7/8] wildmatch: make a special case for */ with FNM_PATHNAME

2012-12-21 Thread Nguyễn Thái Ngọc Duy
Normally we need recursion for *. In this case we know that it matches everything until / so we can skip the recursion. glibc, '*/*/*' on linux-2.6.git file list 2000 times before: wildmatch 8s 74513us fnmatch 1s 97042us or 13.59% faster after: wildmatch 3s 521862us fnmatch 3s 488616us or

[PATCH 8/8] wildmatch: advance faster in asterisk + literal patterns

2012-12-21 Thread Nguyễn Thái Ngọc Duy
compat, '*/*/*' on linux-2.6.git file list 2000 times, before: wildmatch 7s 985049us fnmatch 2s 735541us or 34.26% faster and after: wildmatch 4s 492549us fnmatch 0s 888263us or 19.77% slower Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- wildmatch.c | 21 + 1