[PATCH 12/12] Add git-check-ignore sub-command

2012-10-14 Thread Nguyễn Thái Ngọc Duy
From: Adam Spiers This works in a similar manner to git-check-attr. Some code was reused from add.c by refactoring out into pathspec.c. Thanks to Jeff King and Junio C Hamano for the idea: http://thread.gmane.org/gmane.comp.version-control.git/108671/focus=108815 Signed-off-by: Adam Spiers Si

[PATCH 11/12] dir.c: provide free_directory() for reclaiming dir_struct memory

2012-10-14 Thread Nguyễn Thái Ngọc Duy
From: Adam Spiers Signed-off-by: Adam Spiers Signed-off-by: Junio C Hamano Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/technical/api-directory-listing.txt | 2 ++ dir.c | 28 +-- dir.h

[PATCH 10/12] pathspec.c: move reusable code from builtin/add.c

2012-10-14 Thread Nguyễn Thái Ngọc Duy
From: Adam Spiers This is in preparation for reuse by a new git check-ignore command. Signed-off-by: Adam Spiers Signed-off-by: Junio C Hamano Signed-off-by: Nguyễn Thái Ngọc Duy --- Makefile | 2 ++ builtin/add.c | 95 ++--- pathspec

[PATCH 09/12] dir.c: refactor treat_gitlinks()

2012-10-14 Thread Nguyễn Thái Ngọc Duy
From: Adam Spiers Extract the body of the for loop in treat_gitlinks() into a separate treat_gitlink() function so that it can be reused elsewhere. This paves the way for a new check-ignore sub-command. Signed-off-by: Adam Spiers Signed-off-by: Junio C Hamano Signed-off-by: Nguyễn Thái Ngọc D

[PATCH 08/12] dir.c: keep track of where patterns came from

2012-10-14 Thread Nguyễn Thái Ngọc Duy
From: Adam Spiers For exclude patterns read in from files, the filename is stored together with the corresponding line number (counting starting at 1). For exclude patterns provided on the command line, the sequence number is negative, with counting starting at -1, so for example the 2nd pattern

[PATCH 07/12] dir.c: refactor is_path_excluded()

2012-10-14 Thread Nguyễn Thái Ngọc Duy
From: Adam Spiers In a similar way to the previous commit, this extracts a new helper function last_exclude_matching_path() which return the last exclude_list element which matched, or NULL if no match was found. is_path_excluded() becomes a wrapper around this, and just returns 0 or 1 depending

[PATCH 06/12] dir.c: refactor is_excluded()

2012-10-14 Thread Nguyễn Thái Ngọc Duy
From: Adam Spiers In a similar way to the previous commit, this extracts a new helper function last_exclude_matching() which returns the last exclude_list element which matched, or NULL if no match was found. is_excluded() becomes a wrapper around this, and just returns 0 or 1 depending on wheth

[PATCH 05/12] dir.c: refactor is_excluded_from_list()

2012-10-14 Thread Nguyễn Thái Ngọc Duy
From: Adam Spiers The excluded function uses a new helper function called last_exclude_matching_from_list() to perform the inner loop over all of the exclude patterns. The helper just tells us whether the path is included, excluded, or undecided. However, it may be useful to know _which_ patter

[PATCH 04/12] dir.c: rename excluded() to is_excluded()

2012-10-14 Thread Nguyễn Thái Ngọc Duy
From: Adam Spiers Continue adopting clearer names for exclude functions. This is_* naming pattern for functions returning booleans was discussed here: http://thread.gmane.org/gmane.comp.version-control.git/204661/focus=204924 Signed-off-by: Adam Spiers Signed-off-by: Junio C Hamano Signed-of

[PATCH 03/12] dir.c: rename excluded_from_list() to is_excluded_from_list()

2012-10-14 Thread Nguyễn Thái Ngọc Duy
From: Adam Spiers Continue adopting clearer names for exclude functions. This 'is_*' naming pattern for functions returning booleans was discussed here: http://thread.gmane.org/gmane.comp.version-control.git/204661/focus=204924 Also adjust their callers as necessary. Signed-off-by: Adam Spier

[PATCH 02/12] dir.c: rename path_excluded() to is_path_excluded()

2012-10-14 Thread Nguyễn Thái Ngọc Duy
From: Adam Spiers Start adopting clearer names for exclude functions. This 'is_*' naming pattern for functions returning booleans was agreed here: http://thread.gmane.org/gmane.comp.version-control.git/204661/focus=204924 Signed-off-by: Adam Spiers Signed-off-by: Junio C Hamano Signed-off-by

[PATCH 01/12] dir.c: rename cryptic 'which' variable to more consistent name

2012-10-14 Thread Nguyễn Thái Ngọc Duy
From: Adam Spiers 'el' is only *slightly* less cryptic, but is already used as the variable name for a struct exclude_list pointer in numerous other places, so this reduces the number of cryptic variable names in use by one :-) Signed-off-by: Adam Spiers Signed-off-by: Junio C Hamano Signed-of

[PATCH 13/13] Support "**" wildcard in .gitignore and .gitattributes

2012-10-14 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/gitignore.txt| 19 +++ dir.c | 4 +++- t/t0003-attributes.sh | 37 + t/t3001-ls-files-others-exclude.sh | 18 ++ 4 files ch

[PATCH 12/13] wildmatch: make /**/ match zero or more directories

2012-10-14 Thread Nguyễn Thái Ngọc Duy
"foo/**/bar" matches "foo/x/bar", "foo/x/y/bar"... but not "foo/bar". We make a special case, when foo/**/ is detected (and "foo/" part is already matched), try matching "bar" with the rest of the string. "Match one or more directories" semantics can be easily achieved using "foo/*/**/bar". This

[PATCH 11/13] wildmatch: adjust "**" behavior

2012-10-14 Thread Nguyễn Thái Ngọc Duy
Standard wildmatch() sees consecutive asterisks as "*" that can also match slashes. But that may be hard to explain to users as "abc/**/def" can match "abcdef", "abcxyzdef", "abc/def", "abc/x/def", "abc/x/y/def"... This patch changes wildmatch so that users can do - "**/def" -> all paths ending w

[PATCH 10/13] wildmatch: fix case-insensitive matching

2012-10-14 Thread Nguyễn Thái Ngọc Duy
dowild() does case insensitive matching by lower-casing the text. That means lower case letters in patterns imply case-insensitive matching, but upper case means exact matching. We do not want that subtlety. Lower case pattern too so iwildmatch() always does what we expect it to do. Signed-off-by

[PATCH 09/13] wildmatch: remove static variable force_lower_case

2012-10-14 Thread Nguyễn Thái Ngọc Duy
One place less to worry about thread safety. Also combine wildmatch and iwildmatch into one. Signed-off-by: Nguyễn Thái Ngọc Duy --- test-wildmatch.c | 4 ++-- wildmatch.c | 21 + wildmatch.h | 3 +-- 3 files changed, 8 insertions(+), 20 deletions(-) diff --git a

[PATCH 08/13] wildmatch: make wildmatch's return value compatible with fnmatch

2012-10-14 Thread Nguyễn Thái Ngọc Duy
wildmatch returns non-zero if matched, zero otherwise. This patch makes it return zero if matches, non-zero otherwise, like fnmatch(). Signed-off-by: Nguyễn Thái Ngọc Duy --- test-wildmatch.c | 4 ++-- wildmatch.c | 21 - 2 files changed, 14 insertions(+), 11 deletions(

[PATCH 07/13] t3070: disable unreliable fnmatch tests

2012-10-14 Thread Nguyễn Thái Ngọc Duy
These tests show different results on different fnmatch() versions. We don't want to test fnmatch here. We want to make sure wildmatch behavior matches fnmatch and that only makes sense in cases when fnmatch() behaves consistently. Signed-off-by: Nguyễn Thái Ngọc Duy --- t/t3070-wildmatch.sh | 8

[PATCH 06/13] Integrate wildmatch to git

2012-10-14 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- .gitignore | 1 + Makefile | 3 + t/t3070-wildmatch.sh | 188 +++ t/t3070/wildtest.txt | 165 test-wildmatch.c | 14 wildmatch.c

[PATCH 05/13] wildmatch: follow Git's coding convention

2012-10-14 Thread Nguyễn Thái Ngọc Duy
wildmatch's coding style is pretty close to Git's except the use of 4 space indentation instead of 8. This patch should produce empty diff with "git diff -b" Signed-off-by: Nguyễn Thái Ngọc Duy --- wildmatch.c | 292 ++-- 1 file changed, 14

[PATCH 04/13] wildmatch: remove unnecessary functions

2012-10-14 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- wildmatch.c | 164 wildmatch.h | 2 - 2 files changed, 10 insertions(+), 156 deletions(-) diff --git a/wildmatch.c b/wildmatch.c index f3a1731..fae7397 100644 --- a/wildmatch.c +++ b/wildmatch

[PATCH 03/13] Import wildmatch from rsync

2012-10-14 Thread Nguyễn Thái Ngọc Duy
These files are from rsync.git commit f92f5b166e3019db42bc7fe1aa2f1a9178cd215d, which was the last commit before rsync turned GPL-3. All files are imported as-is and no-op. Adaptation is done in a separate patch. rsync.git -> git.git lib/wildmatch.[ch] wildmatch.[ch] wildtest.txt

[PATCH 02/13] ctype: support iscntrl, ispunct, isxdigit and isprint

2012-10-14 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- ctype.c | 13 - git-compat-util.h | 13 + 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/ctype.c b/ctype.c index faeaf34..0bfebb4 100644 --- a/ctype.c +++ b/ctype.c @@ -11,18 +11,21 @@ enum { D = G

[PATCH 01/13] ctype: make sane_ctype[] const array

2012-10-14 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- ctype.c | 2 +- git-compat-util.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ctype.c b/ctype.c index 9353271..faeaf34 100644 --- a/ctype.c +++ b/ctype.c @@ -14,7 +14,7 @@ enum { P = GIT_PATHSPEC_MAGIC /* other

[PATCH 6/6] attr: more matching optimizations from .gitignore

2012-10-14 Thread Nguyễn Thái Ngọc Duy
.gitattributes and .gitignore share the same pattern syntax but has separate matching implementation. Over the years, ignore's implementation accumulates more optimizations while attr's stays the same. This patch reuses the core matching functions that are also used by excluded_from_list. excluded

[PATCH 5/6] gitignore: make pattern parsing code a separate function

2012-10-14 Thread Nguyễn Thái Ngọc Duy
This function can later be reused by attr.c. Also turn to_exclude field into a flag. Signed-off-by: Junio C Hamano Signed-off-by: Nguyễn Thái Ngọc Duy --- dir.c | 71 ++- dir.h | 2 +- 2 files changed, 50 insertions(+), 23 deletio

[PATCH 4/6] exclude: split pathname matching code into a separate function

2012-10-14 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- dir.c | 85 ++- 1 file changed, 53 insertions(+), 32 deletions(-) diff --git a/dir.c b/dir.c index 22d0b7b..32d1c90 100644 --- a/dir.c +++ b/dir.c @@ -522,6 +522,53 @@ static int match_basena

[PATCH 3/6] exclude: fix a bug in prefix compare optimization

2012-10-14 Thread Nguyễn Thái Ngọc Duy
When "namelen" becomes zero at this stage, we have matched the fixed part, but whether it actually matches the pattern still depends on the pattern in "exclude". As demonstrated in t3001, path "three/a.3" exists and it matches the "three/a.3" part in pattern "three/a.3[abc]", but that does not mean

[PATCH 2/6] exclude: split basename matching code into a separate function

2012-10-14 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- dir.c | 37 - 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/dir.c b/dir.c index b0ae417..d9b5561 100644 --- a/dir.c +++ b/dir.c @@ -503,6 +503,25 @@ static void prep_exclude(struct dir_struct *dir, cons

[PATCH 1/6] exclude: stricten a length check in EXC_FLAG_ENDSWITH case

2012-10-14 Thread Nguyễn Thái Ngọc Duy
This block of code deals with the "basename" part only, which has the length of "pathlen - (basename - pathname)". Stricten the length check and remove "pathname" from the main expression to avoid confusion. Signed-off-by: Nguyễn Thái Ngọc Duy --- dir.c | 5 +++-- 1 file changed, 3 insertions(+)

nd/attr-match-more-optim, nd/wildmatch and as/check-ignore

2012-10-14 Thread Nguyễn Thái Ngọc Duy
I promise I won't send anything dir.c-related till the end of this month :) These three series all touch the same code in dir.c and cause a bunch of conflicts. So I rebase nd/wildmatch and as/check-ignore on top of nd/attr-match-more-optim and resolve all conflicts. nd/attr-match-more-optim --

Re: [PATCH v2 2/2] grep: stop looking at random places for .gitattributes

2012-10-14 Thread Johannes Sixt
Am 10/14/2012 6:29, schrieb Junio C Hamano: > Johannes Sixt writes: > >> It might be worth it. We already have a similar special case in >> write_or_die.c:maybe_flush_or_die() for Windows, although it is not about >> a colon in a path name. >> >> Perhaps like this. > > Hrm, the "we already have"

Re: Planning to pass the baton to an interim maintainer

2012-10-14 Thread Jeff King
On Sun, Oct 14, 2012 at 11:23:07AM -0700, Junio C Hamano wrote: > I am planning to > > * tag 1.8.0 final on Oct 21st (Sun); > * go offline on Oct 22nd (Mon); and > * come back online on Nov 12th (Mon). > > Peff, could you be the interim maintainer as you've done in earlier > years while I was

Re: [PATCH] exclude: fix a bug in prefix comparison optimization

2012-10-14 Thread Junio C Hamano
Nguyen Thai Ngoc Duy writes: > On Mon, Oct 15, 2012 at 12:36 AM, Junio C Hamano wrote: >> With your "teach attr.c match the same optimization as dir.c" >> series, you would need something like this >> >> diff --git i/attr.c w/attr.c >> index 6d39406..528e935 100644 >> --- i/attr.c >> +++ w/attr.

Re: [PATCH] exclude: fix a bug in prefix comparison optimization

2012-10-14 Thread Nguyen Thai Ngoc Duy
On Mon, Oct 15, 2012 at 12:36 AM, Junio C Hamano wrote: > With your "teach attr.c match the same optimization as dir.c" > series, you would need something like this > > diff --git i/attr.c w/attr.c > index 6d39406..528e935 100644 > --- i/attr.c > +++ w/attr.c > @@ -710,7 +710,7 @@ static int path_

[PATCH v2] git-cvsimport: allow author-specific timezones

2012-10-14 Thread Chris Rorvick
CVS patchsets are imported with timestamps having an offset of + (UTC). The cvs-authors file is already used to translate the CVS username to full name and email in the corresponding commit. Extend this file to support an optional timezone for calculating a user- specific timestamp offset. S

[PATCH] git-cvsimport: allow author-specific timezones

2012-10-14 Thread Chris Rorvick
From: Chris Rorvick CVS patchsets are imported with timestamps having an offset of + (UTC). The cvs-authors file is already used to translate the CVS username to full name and email in the corresponding commit. Extend this file to support an optional timezone for calculating a user- specifi

Re: A design for subrepositories

2012-10-14 Thread Lauri Alanko
la@bq:~/tmp/super$ git mv sub movedsub fatal: source directory is empty, source=sub, destination=movedsub This error here indicates that we didn't teach git to properly move a submodule yet. It is one of my next goals to make "git [submodule] mv sub movedsub" do the right thing here. I'll digr

Re: [PATCH v2 2/2] git-cvsimport: allow local timezone for commits

2012-10-14 Thread Christopher Rorvick
On Sun, Oct 14, 2012 at 1:04 AM, Junio C Hamano wrote: > Chris Rorvick writes: > >> CVS patches are imported with the timezone offset of + (UTC). >> Allow timezone offsets to be calculated from the the local timezone by >> adding -l to the command line or specifying cvsimport.l in the config.

Re: A design for subrepositories

2012-10-14 Thread Jens Lehmann
Am 14.10.2012 20:04, schrieb Junio C Hamano: > Jens Lehmann writes: > >> Again, the user experience is currently suboptimal. > > You mentioned multiple things in your responses that you are > planning to address, but I am wondering if the first step before > doing anything else is to have a list

Re: [PATCH] exclude: fix a bug in prefix comparison optimization

2012-10-14 Thread Junio C Hamano
Junio C Hamano writes: > Comparing the corresponding code in dir.c, there is no "compare the > literal prefix part with strcmp() before doing the fnmatch()" > optimization. Intended? > > (warning: I haven't had my caffeine yet) And it turns out that at the point I wrote the response, I still ha

Planning to pass the baton to an interim maintainer

2012-10-14 Thread Junio C Hamano
I am planning to * tag 1.8.0 final on Oct 21st (Sun); * go offline on Oct 22nd (Mon); and * come back online on Nov 12th (Mon). Peff, could you be the interim maintainer as you've done in earlier years while I was away? Thanks. -- To unsubscribe from this list: send the line "unsubscribe git"

Re: [PATCH 3/4] exclude/attr: share basename matching code

2012-10-14 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > match_basename's declaration in dir.h does not have any description to > discourage the use of this function elsewhere as this function is > highly tied to how excluded_from_list and path_matches work. If you do want to discourage, please explicitly describe it as

Re: A design for subrepositories

2012-10-14 Thread Junio C Hamano
Jens Lehmann writes: > Again, the user experience is currently suboptimal. You mentioned multiple things in your responses that you are planning to address, but I am wondering if the first step before doing anything else is to have a list of known-to-be-suboptimal things and publish it somewhere

Re: [PATCH] exclude: fix a bug in prefix comparison optimization

2012-10-14 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > When "namelen" becomes zero at this stage, we have matched the fixed > part, but whether it actually matches the pattern still depends on the > pattern in "exclude". As demonstrated in t3001, path "three/a.3" > exists and it matches the "three/a.3" part in pattern "

Re: Why git shows staging area to users?

2012-10-14 Thread Matthieu Moy
David Aguilar writes: > On Sat, Oct 13, 2012 at 2:08 PM, Yi, EungJun wrote: >> Hi, all. >> >> Why git shows staging area to users, compared with the other scms hide >> it? What benefits users get? > > http://thkoch2001.github.com/whygitisbetter/#the-staging-area > http://tomayko.com/writings/the

Re: [PATCH 2/2] config: treat user and xdg config permission problems as errors

2012-10-14 Thread Jeff King
On Sun, Oct 14, 2012 at 01:42:44AM -0700, Jonathan Nieder wrote: > Jeff King wrote: > > > For example, servers may depend on /etc/gitconfig to enforce security > > policy (e.g., setting transfer.fsckObjects or receive.deny*). Perhaps > > our default should be safe, and people can use GIT_CONFIG_N

Re: A design for subrepositories

2012-10-14 Thread Jens Lehmann
Am 14.10.2012 17:27, schrieb Lauri Alanko: > Quoting "Jens Lehmann" : >> Did you notice that "git fetch" fetches all those submodules too which >> have been updated in the commits fetched for the superproject, no matter >> on what branch they are on? > > No. This would be great, but this is what I

Re: A design for subrepositories

2012-10-14 Thread Jens Lehmann
Am 14.10.2012 17:27, schrieb Lauri Alanko: > Quoting "Jens Lehmann" : >> What's wrong with making git clone all submodules together with the >> superproject (when the user said he wants to update all submodules on >> clone too by setting a - still to be added - config option)? > > Depends on how i

[PATCH] completion: add format-patch options to send-email

2012-10-14 Thread Felipe Contreras
Signed-off-by: Felipe Contreras --- contrib/completion/git-completion.bash | 35 +- t/t9902-completion.sh | 21 2 files changed, 39 insertions(+), 17 deletions(-) diff --git a/contrib/completion/git-completion.bash b/contrib/

Re: A design for subrepositories

2012-10-14 Thread Jens Lehmann
Am 14.10.2012 17:27, schrieb Lauri Alanko: > Quoting "Jens Lehmann" : > > If the > submodules ever get reorganized and foo is moved to ./bar, then it is > impossible to check out older versions or alternate branches, since > the submodule is no longer where it is expected to be at

[PATCH v5 3/3] completion: add new zsh completion

2012-10-14 Thread Felipe Contreras
It seems there's always issues with zsh's bash completion emulation. I've tried to fix as many as I could and most of the fixes are already in the latest version of zsh, but still, there are issues. There is no point in going through all that pain; the emulation is easy to achieve, and this patch

[PATCH v5 2/3] tests: use __gitcompadd to simplify completion tests

2012-10-14 Thread Felipe Contreras
Signed-off-by: Felipe Contreras --- t/t9902-completion.sh | 29 + 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh index 92d7eb4..49c6eb4 100755 --- a/t/t9902-completion.sh +++ b/t/t9902-completion.sh @@ -39,1

[PATCH v5 1/3] completion: add new __gitcompadd helper

2012-10-14 Thread Felipe Contreras
The idea is to never touch the COMPREPLY variable directly. This allows other completion systems override __gitcompadd, and do something different instead. Also, this allows the simplifcation of the completino tests (separate patch). There should be no functional changes. Signed-off-by: Felipe

[PATCH v5 0/3] completion: refactor and zsh wrapper

2012-10-14 Thread Felipe Contreras
Hi, Here's a bit of reorganition. I'm introducing a new __gitcompadd helper that is useful to wrapp all changes to COMPREPLY. 2nd and 3rd patches show how it's useful. The zsh wrapper is now very very simple, but I haven't received much feedback yet. I hope it will get in at some point in time.

Re: A design for subrepositories

2012-10-14 Thread Lauri Alanko
Quoting "Jens Lehmann" : If the submodules ever get reorganized and foo is moved to ./bar, then it is impossible to check out older versions or alternate branches, since the submodule is no longer where it is expected to be at the origin. Your initial statement is not correct. Please elabor

Re: [PATCH v5 02/12] ctype: support iscntrl, ispunct, isxdigit and isprint

2012-10-14 Thread Nguyen Thai Ngoc Duy
On Sun, Oct 14, 2012 at 03:59:31PM +0200, René Scharfe wrote: > Am 14.10.2012 15:25, schrieb Nguyen Thai Ngoc Duy: > > On Sun, Oct 14, 2012 at 7:59 PM, René Scharfe > > wrote: > >> With that, couldn't you squeeze the other two classes into the existing > >> sane_type? > > > > No there are still co

Re: [PATCH v5 02/12] ctype: support iscntrl, ispunct, isxdigit and isprint

2012-10-14 Thread René Scharfe
Am 14.10.2012 15:25, schrieb Nguyen Thai Ngoc Duy: On Sun, Oct 14, 2012 at 7:59 PM, René Scharfe wrote: With that, couldn't you squeeze the other two classes into the existing sane_type? No there are still conflicts: 9, 10 and 13 as spaces (vs controls) and 123, 124 and 126 as regex/pathspec

fixes of previous commit

2012-10-14 Thread Ralf Thielow
--- > Hi Ralf > Hi Thomas, thanks for your work! All your suggestions are very good. > I just realized that, unfortunately, your original message is far beyond > the message size limit on vger (10 bytes according to [1]). So > nobody outside of the Cc list has seen it... > Oops, I didn't

Re: A design for subrepositories

2012-10-14 Thread Jens Lehmann
Am 14.10.2012 12:19, schrieb Lauri Alanko: > Quoting "Junio C Hamano" : > >>> If the >>> submodules ever get reorganized and foo is moved to ./bar, then it is >>> impossible to check out older versions or alternate branches, since >>> the submodule is no longer where it is expected to be at the or

Re: [PATCH v5 02/12] ctype: support iscntrl, ispunct, isxdigit and isprint

2012-10-14 Thread Nguyen Thai Ngoc Duy
On Sun, Oct 14, 2012 at 7:59 PM, René Scharfe wrote: >> +const unsigned char sane_ctype2[256] = { >> + CN, CN, CN, CN, CN, CN, CN, CN, CN, CN, CN, CN, CN, CN, CN, CN, /* >> 0..15 */ >> + CN, CN, CN, CN, CN, CN, CN, CN, CN, CN, CN, CN, CN, CN, CN, CN, /* >> 16..31 */ >> + 0, PU,

Re: [PATCH v5 02/12] ctype: support iscntrl, ispunct, isxdigit and isprint

2012-10-14 Thread René Scharfe
Am 14.10.2012 04:35, schrieb Nguyễn Thái Ngọc Duy: Signed-off-by: Nguyễn Thái Ngọc Duy --- ctype.c | 18 ++ git-compat-util.h | 13 + 2 files changed, 31 insertions(+) diff --git a/ctype.c b/ctype.c index faeaf34..b4bf48a 100644 --- a/ctype.c +++ b/cty

[PATCH 4/4] exclude/attr: share full pathname matching code

2012-10-14 Thread Nguyễn Thái Ngọc Duy
match_pathname's declaration in dir.h does not have any description to discourage the use of this function elsewhere as this function is highly tied to how excluded_from_list and path_matches work. Signed-off-by: Nguyễn Thái Ngọc Duy --- attr.c | 35 +++ dir.c | 85 +

[PATCH 3/4] exclude/attr: share basename matching code

2012-10-14 Thread Nguyễn Thái Ngọc Duy
match_basename's declaration in dir.h does not have any description to discourage the use of this function elsewhere as this function is highly tied to how excluded_from_list and path_matches work. Signed-off-by: Nguyễn Thái Ngọc Duy --- attr.c | 15 --- dir.c | 37 +

[PATCH 2/4] exclude: fix a bug in prefix compare optimization

2012-10-14 Thread Nguyễn Thái Ngọc Duy
When "namelen" becomes zero at this stage, we have matched the fixed part, but whether it actually matches the pattern still depends on the pattern in "exclude". As demonstrated in t3001, path "three/a.3" exists and it matches the "three/a.3" part in pattern "three/a.3[abc]", but that does not mean

[PATCH 1/4] exclude: stricten a length check in EXC_FLAG_ENDSWITH case

2012-10-14 Thread Nguyễn Thái Ngọc Duy
This block of code deals with the "basename" part only, which has the length of "pathlen - (basename - pathname)". Stricten the length check and remove "pathname" from the main expression to avoid confusion. Signed-off-by: Nguyễn Thái Ngọc Duy --- dir.c | 5 +++-- 1 file changed, 3 insertions(+)

[PATCH 0/4] nd/attr-match-optim-more updates

2012-10-14 Thread Nguyễn Thái Ngọc Duy
This is on top of nd/attr-match-optim-more to fix the bug I sent recently [1] sharing the code, thus sharing any fixes. [1] http://thread.gmane.org/gmane.comp.version-control.git/207652 Nguyễn Thái Ngọc Duy (4): exclude: stricten a length check in EXC_FLAG_ENDSWITH case exclude: fix a bug in

[PATCH 2/2] git svn: canonicalize_url(): use svn_path_canonicalize when available

2012-10-14 Thread Jonathan Nieder
Until Subversion 1.7 (more precisely r873487), the standard way to canonicalize a URI was to call svn_path_canonicalize(). Use it. This saves "git svn" from having to rely on our imperfect reimplementation of the same. If the function doesn't exist or returns undef, though, it can use the fallba

[PATCH 1/2] git svn: do not overescape URLs (fallback case)

2012-10-14 Thread Jonathan Nieder
Subversion's canonical URLs are intended to make URL comparison easy and therefore have strict rules about what characters are special enough to urlencode and what characters should be left alone. When in the fallback codepath because unable to use libsvn's own canonicalization function for some r

[PATCH/RFC 0/2] Re: [PATCH 2/7] Change canonicalize_url() to use the SVN 1.7 API when available.

2012-10-14 Thread Jonathan Nieder
Hi Eric, Michael G Schwern wrote: > On 2012.7.28 6:50 AM, Jonathan Nieder wrote: >> Michael G Schwern wrote: >>> --- a/perl/Git/SVN/Utils.pm >>> +++ b/perl/Git/SVN/Utils.pm >> [...] >>> @@ -100,6 +102,20 @@ API as a URL. >>> =cut >>> >>> sub canonicalize_url { >>> + my $url = shift; >>> + >

[PATCH] exclude: fix a bug in prefix comparison optimization

2012-10-14 Thread Nguyễn Thái Ngọc Duy
When "namelen" becomes zero at this stage, we have matched the fixed part, but whether it actually matches the pattern still depends on the pattern in "exclude". As demonstrated in t3001, path "three/a.3" exists and it matches the "three/a.3" part in pattern "three/a.3[abc]", but that does not mean

Re: [PATCH v5 05/12] Integrate wildmatch to git

2012-10-14 Thread Torsten Bögershausen
diff --git a/t/t3070-wildmatch.sh b/t/t3070-wildmatch.sh new file mode 100755 index 000..dbd3c8b --- /dev/null +++ b/t/t3070-wildmatch.sh @@ -0,0 +1,188 @@ +#!/bin/sh +#else +#test_expect_success BROKEN_FNMATCH "fnmatch: '$3' '$4'" " +#! test-wildmatch fnmatch '$3' '$4' +#

Re: A design for subrepositories

2012-10-14 Thread Lauri Alanko
Quoting "Junio C Hamano" : If the submodules ever get reorganized and foo is moved to ./bar, then it is impossible to check out older versions or alternate branches, since the submodule is no longer where it is expected to be at the origin. Isn't that exactly what the "module name" vs "module

Re: [RFC/PATCH 0/2] Re: [PATCH] config: warn on inaccessible files

2012-10-14 Thread Jonathan Nieder
Junio C Hamano wrote: > If the config side can > be switched to unconditionally attempt to fopen and then deal with > an error when it happens, we can get rid of access_or_{warn,die} > and replace them with fopen_or_{warn,die} and use them from the two >

[PATCH v2 3/2] doc: advertise GIT_CONFIG_NOSYSTEM

2012-10-14 Thread Jonathan Nieder
On a multiuser system where mortals do not have write access to /etc, the GIT_CONFIG_NOSYSTEM variable is the best tool we have to keep getting work done when a syntax error or other problem renders /etc/gitconfig buggy, until the sysadmin sorts the problem out. Noticed while experimenting with te

[PATCH 4/2] config: exit on error accessing any config file

2012-10-14 Thread Jonathan Nieder
There is convenience in warning and moving on when somebody has a bogus permissions on /etc/gitconfig and cannot do anything about it. But the cost in predictability and security is too high --- when unreadable config files are skipped, it means an I/O error or permissions problem causes important

[PATCH 3/2] config doc: advertise GIT_CONFIG_NOSYSTEM

2012-10-14 Thread Jonathan Nieder
When a syntax error or other problem renders /etc/gitconfig buggy on a multiuser system where mortals do not have write access to /etc, the GIT_CONFIG_NOSYSTEM variable is the best tool we have to keep getting work done until the sysadmin sorts the problem out. Noticed while experimenting with tea

Re: [PATCH 2/2] config: treat user and xdg config permission problems as errors

2012-10-14 Thread Jonathan Nieder
Jeff King wrote: > For example, servers may depend on /etc/gitconfig to enforce security > policy (e.g., setting transfer.fsckObjects or receive.deny*). Perhaps > our default should be safe, and people can use GIT_CONFIG_NOSYSTEM to > work around a broken machine. Very good point. How about thes

Re: git reflog delete HEAD@{1} HEAD@{2} caught me by surprise...

2012-10-14 Thread George Spelvin
> I would actually call that behaviour a bug. Well, yes, that was my inclination, too. But writing documentation was easier than writing a code patch. :-) Even when it is fixed, a comment about when it was fixed and what the buggy version did should live in the BUGS section for a while, to warn