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
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
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
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
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
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
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
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
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
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
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
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
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
"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
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
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
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
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(
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
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
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
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
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
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
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
.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
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
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
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
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
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(+)
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
--
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"
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
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.
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_
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
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
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
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.
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
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
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"
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
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
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 "
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
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
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
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
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/
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
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
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
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
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.
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
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
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
---
> 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
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
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,
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
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 +
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 +
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
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(+)
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
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
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
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;
>>> +
>
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
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'
+#
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
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
>
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
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
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
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
> 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
80 matches
Mail list logo