[PATCH 05/10] Import wildmatch from rsync

2012-10-05 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.c

Re: push.default documented in man git-push?

2012-10-05 Thread Nguyen Thai Ngoc Duy
On Thu, Oct 4, 2012 at 12:45 PM, Junio C Hamano gits...@pobox.com wrote: Nguyen Thai Ngoc Duy pclo...@gmail.com writes: On Thu, Oct 4, 2012 at 1:49 AM, Junio C Hamano gits...@pobox.com wrote: I would recommend against listing any advice.* in the command manual pages. They are meant to give

Re: Rebase doesn't restore branch pointer back on out of memory

2012-10-05 Thread Andrew Wong
'format-patch' is failing due to out of memory, and the error not being caught. So 'rebase' thinks 'am' has completed successfully and continue on with cleanup. i.e. move_to_original_branch So the user loses commits from the original head, and have to rely on reflog to return to the original head.

Re: upload-pack is slow with lots of refs

2012-10-05 Thread Johannes Sixt
Am 10/3/2012 21:41, schrieb Shawn Pearce: On Wed, Oct 3, 2012 at 11:55 AM, Jeff King p...@peff.net wrote: On Wed, Oct 03, 2012 at 11:53:35AM -0700, Junio C Hamano wrote: Jeff King p...@peff.net writes: Has there been any work on extending the protocol so that the client tells the server what

[RFC] rebase: Handle cases where format-patch fails

2012-10-05 Thread Andrew Wong
'format-patch' could fail due to reasons such as out of memory. Such failures are not detected or handled, which causes rebase to incorrectly think that it completed successfully and continue with cleanup. i.e. calling move_to_original_branch Since only the exit status of the last command in the

Re: [PATCH 5/6] log: pass rev_info to git_log_config()

2012-10-05 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: So we would need to do something like: - call git_log_config() first to let diff_context_default updated from the configuration as before. find the values of grep.* defaults at the same time, but stash it away in a separate

Re: Ignore on commit

2012-10-05 Thread Philip Oakley
From: Andrew Ardill andrew.ard...@gmail.com On 5 October 2012 07:20, Marco Craveiro marco.crave...@gmail.com wrote: ... Similar but not quite; the idea is that you know that there is some code (I'm just talking about files here, so lets ignore hunks for the moment) which is normally checked in

Re: Ignore on commit

2012-10-05 Thread Marco Craveiro
git update-index --assume-unchanged From the help page: --assume-unchanged, --no-assume-unchanged ... This option can be also used as a coarse file-level mechanism to ignore uncommitted changes in tracked files (akin to what .gitignore does for untracked files). Seems like it

Re: [PATCH 5/6] gitignore: do not do basename match with patterns that have '**'

2012-10-05 Thread Johannes Sixt
Am 10/4/2012 9:39, schrieb Nguyễn Thái Ngọc Duy: - - If the pattern does not contain a slash '/', git treats it as - a shell glob pattern and checks for a match against the - pathname relative to the location of the `.gitignore` file - (relative to the toplevel of the work tree if not

[PATCH] git-svn: keep leading slash when canonicalizing paths (fallback case)

2012-10-05 Thread Jonathan Nieder
Subversion's svn_dirent_canonicalize() and svn_path_canonicalize() APIs keep a leading slash in the return value if one was present on the argument, which can be useful since it allows relative and absolute paths to be distinguished. When git-svn's canonicalize_path() learned to use these

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

2012-10-05 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.

Re: grep.patternType

2012-10-05 Thread J Smith
On Wed, Oct 3, 2012 at 6:14 PM, Junio C Hamano gits...@pobox.com wrote: Junio C Hamano gits...@pobox.com writes: Junio C Hamano gits...@pobox.com writes: * git grep learned to use a non-standard pattern type by default if a configuration variable tells it to. This addition makes

[PATCH 02/10] attr: avoid strlen() on every match

2012-10-05 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- attr.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/attr.c b/attr.c index b52efb5..2942bf6 100644 --- a/attr.c +++ b/attr.c @@ -277,6 +277,7 @@ static struct match_attr *parse_attr_line(const char *line,

[PATCH 00/10] nd/wildmatch take 2

2012-10-05 Thread Nguyễn Thái Ngọc Duy
The first four patches are ignore/attr cleanups. The following imports wildmatch, nothing new there. The last patch limits allowed syntax to a safe subset: abc/**, **/def and abc/**/def. Nguyễn Thái Ngọc Duy (10): gitignore: make pattern parsing code a separate function attr: avoid strlen()

[PATCH 10/10] gitignore: forbid abc**def

2012-10-05 Thread Nguyễn Thái Ngọc Duy
Deep down wildmatch() sees ** as * that can also match slashes. On the surface, it may be confusing to users as the above pattern can match abcdef, abcxyzdef, abc/def, abc/x/def, abc/x/y/def... For now we just forbid it. Users can only do **/def, abc/** or abc/**/def. The syntax may be re-enabled

[PATCH 08/10] Integrate wildmatch to git

2012-10-05 Thread Nguyễn Thái Ngọc Duy
This makes wildmatch.c part of libgit.a and builds test-wildmatch; the dependency on libpopt in the original has been replaced with the use of our parse-options. Global variables in test-wildmatch are marked static to avoid sparse warnings. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com

Fwd: git-completion of branches containing @ in their name

2012-10-05 Thread Børge Bjørnli Nygård
Hello, When I try to complete a branch name containing @, it doesn't expand as expected. Running git on Windows 7. $ git --version git version 1.7.11.msysgit.1 $ git branch * master master@feature If I write $ git checkout master@ and press tab, the above expands to $ git checkout

[PATCH 01/10] gitignore: make pattern parsing code a separate function

2012-10-05 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: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- If we go with glob-regex conversion way, this is where we could rewrite the pattern (and set EXC_FLAG_REGEX). dir.c | 71

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

2012-10-05 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 adds those optimizations to .gitattributes. Basically it tries to avoid

[PATCH 06/10] wildmatch: remove static variable force_lower_case

2012-10-05 Thread Nguyễn Thái Ngọc Duy
One place less to worry about thread safety Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com Signed-off-by: Junio C Hamano gits...@pobox.com --- wildmatch.c | 17 +++-- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/wildmatch.c b/wildmatch.c index

[PATCH 03/10] attr: avoid searching for basename on every match

2012-10-05 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- attr.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/attr.c b/attr.c index 2942bf6..aeac564 100644 --- a/attr.c +++ b/attr.c @@ -644,13 +644,11 @@ static void prepare_attr_stack(const char *path) }

Bug report

2012-10-05 Thread Муковников Михаил
There's a problem using git with files having cyrillic 'й' in their name, git just can't track them. uname: Darwin 12.2.0 Darwin Kernel Version 12.2.0: Sat Aug 25 00:48:52 PDT 2012; root:xnu-2050.18.24~1/RELEASE_X86_64 x86_64 git version: 1.7.12.1 (from macports) Steps to reproduce: - git init

Re: [PATCH 05/10] Import wildmatch from rsync

2012-10-05 Thread Peter Krefting
These files are from rsync.git commit f92f5b166e3019db42bc7fe1aa2f1a9178cd215d, which was the last commit before rsync turned GPL-3. However: diff --git a/test-wildmatch.c b/test-wildmatch.c [...] + * This program is free software; you can redistribute it and/or modify + * it under the

Re: Bug report

2012-10-05 Thread Konstantin Khomoutov
On Fri, 5 Oct 2012 14:13:49 +0400 Муковников Михаил m.mukovni...@gmail.com wrote: There's a problem using git with files having cyrillic 'й' in their name, git just can't track them. uname: Darwin 12.2.0 Darwin Kernel Version 12.2.0: Sat Aug 25 00:48:52 PDT 2012;

Re: Bug report

2012-10-05 Thread Carlos Martín Nieto
Konstantin Khomoutov flatw...@users.sourceforge.net writes: On Fri, 5 Oct 2012 14:13:49 +0400 Муковников Михаил m.mukovni...@gmail.com wrote: There's a problem using git with files having cyrillic 'й' in their name, git just can't track them. uname: Darwin 12.2.0 Darwin Kernel Version

Re: Bug report

2012-10-05 Thread Муковников Михаил
Hey, Konstantin! Thanks for your reply. My bad, I described the problem not very well. I don't mind displaying escapes etc. (core.quotepath just makes \320\270\314\206 be й and that's it), the problem is that git cannot track files with cyrillic й in their name. I created a file, added it but

Re: Bug report

2012-10-05 Thread Муковников Михаил
Carlos, thank you very much, core.precomposeunicode works just like you said. And you're right, it seems the problem is in HFS+, 'git add .' worked as well, so did even 'git add test_*'. The problem seems solved. 05.10.2012, в 14:47, c...@elego.de (Carlos Martín Nieto) написал(а): Konstantin

Re: [PATCH 05/10] Import wildmatch from rsync

2012-10-05 Thread Nguyen Thai Ngoc Duy
On Fri, Oct 5, 2012 at 5:30 PM, Peter Krefting pe...@softwolves.pp.se wrote: These files are from rsync.git commit f92f5b166e3019db42bc7fe1aa2f1a9178cd215d, which was the last commit before rsync turned GPL-3. However: diff --git a/test-wildmatch.c b/test-wildmatch.c [...] + * This

Re: [PATCH 5/6] gitignore: do not do basename match with patterns that have '**'

2012-10-05 Thread Nguyen Thai Ngoc Duy
On Fri, Oct 5, 2012 at 2:01 PM, Johannes Sixt j.s...@viscovery.net wrote: Am 10/4/2012 9:39, schrieb Nguyễn Thái Ngọc Duy: - - If the pattern does not contain a slash '/', git treats it as - a shell glob pattern and checks for a match against the - pathname relative to the location of the

Re: What's cooking in git.git (Oct 2012, #01; Tue, 2)

2012-10-05 Thread Andreas Schwab
Junio C Hamano gits...@pobox.com writes: When we require x/**/y, I think we still want it to match x/y. FWIW, in bash (+extglob), ksh and zsh it doesn't. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now for

Re: What's cooking in git.git (Oct 2012, #01; Tue, 2)

2012-10-05 Thread Matthieu Moy
Andreas Schwab sch...@linux-m68k.org writes: Junio C Hamano gits...@pobox.com writes: When we require x/**/y, I think we still want it to match x/y. FWIW, in bash (+extglob), ksh and zsh it doesn't. You're right about bash, but I see the opposite for zsh and ksh: zsh$ echo x/**/y x/y x/z/y

Re: What's cooking in git.git (Oct 2012, #01; Tue, 2)

2012-10-05 Thread Nguyen Thai Ngoc Duy
On Thu, Oct 04, 2012 at 09:39:02AM -0700, Junio C Hamano wrote: Assuming that we do want to match x/y with x/**/y, I suspect that '**' matches anything including a slash would not give us that semantics. Is it something we can easily fix in the wildmatch code? Something like this may suffice.

Re: Ignore on commit

2012-10-05 Thread Pascal Obry
Marco, Similar but not quite; the idea is that you know that there is some code (I'm just talking about files here, so lets ignore hunks for the moment) which is normally checked in but for a period of time you want it ignored. Got it thanks! Would be useful some time indeed. --

Fw: [git-users] How do I git-push to an FTP server?

2012-10-05 Thread Konstantin Khomoutov
On the git-users mailing list we're trying someone to help with running `git push` over FTP. That person is runnig Git 1.7.9.5 on Ubuntu 12.04. Below is the trace captured while trying to perform such a faulty push. The oddity (in my eyes) is that after uploading the files, Git executes `git

Re: Fw: [git-users] How do I git-push to an FTP server?

2012-10-05 Thread Philippe Vaucher
On the git-users mailing list we're trying someone to help with running `git push` over FTP. That person is runnig Git 1.7.9.5 on Ubuntu 12.04. I don't think vanilla git supports pushing over ftp. There are plugins like https://github.com/resmo/git-ftp tho. Philippe -- To unsubscribe from

Re: What's cooking in git.git (Oct 2012, #01; Tue, 2)

2012-10-05 Thread Andreas Schwab
Matthieu Moy matthieu@grenoble-inp.fr writes: Andreas Schwab sch...@linux-m68k.org writes: Junio C Hamano gits...@pobox.com writes: When we require x/**/y, I think we still want it to match x/y. FWIW, in bash (+extglob), ksh and zsh it doesn't. You're right about bash, but I see the

git 1.8.0.rc0.18.gf84667d trouble with git commit -p file

2012-10-05 Thread Horst H. von Brand
What I did: - New file images/coins.asy ~~- 'git add images/coins.asy' - Started adding new stuff to fg.tex - Noticed a old bug in fg.tex, fixed that one - Did 'git -pm Some message' and selected just the bugfix But git created a commit _including_ the new file. Tried to go back: - 'git reset

Re: Fw: [git-users] How do I git-push to an FTP server?

2012-10-05 Thread Thomas Ferris Nicolaisen
On Fri, Oct 5, 2012 at 3:46 PM, Philippe Vaucher philippe.vauc...@gmail.com wrote: On the git-users mailing list we're trying someone to help with running `git push` over FTP. That person is runnig Git 1.7.9.5 on Ubuntu 12.04. I don't think vanilla git supports pushing over ftp. At

Re: [PATCH 5/6] log: pass rev_info to git_log_config()

2012-10-05 Thread Jeff King
On Thu, Oct 04, 2012 at 09:16:14PM -0700, Junio C Hamano wrote: Junio C Hamano gits...@pobox.com writes: So we would need to do something like: - call git_log_config() first to let diff_context_default updated from the configuration as before. find the values of

Re: Super long branch names corrupt `.git/config`

2012-10-05 Thread Jeff King
On Fri, Oct 05, 2012 at 10:36:52AM +1000, Andrew Ardill wrote: On 5 October 2012 10:29, Jeff King p...@peff.net wrote: ... but it feels a little fake. Why 200? Because that will test the config limit, but will not overflow the NAME_MAX limit (at least not on Linux! No clue on other

Re: upload-pack is slow with lots of refs

2012-10-05 Thread Shawn Pearce
On Thu, Oct 4, 2012 at 11:24 PM, Johannes Sixt j.s...@viscovery.net wrote: Am 10/3/2012 21:41, schrieb Shawn Pearce: On Wed, Oct 3, 2012 at 11:55 AM, Jeff King p...@peff.net wrote: On Wed, Oct 03, 2012 at 11:53:35AM -0700, Junio C Hamano wrote: Jeff King p...@peff.net writes: Has there been

Re: Fw: [git-users] How do I git-push to an FTP server?

2012-10-05 Thread Konstantin Khomoutov
On Fri, 5 Oct 2012 15:46:33 +0200 Philippe Vaucher philippe.vauc...@gmail.com wrote: On the git-users mailing list we're trying someone to help with running `git push` over FTP. That person is runnig Git 1.7.9.5 on Ubuntu 12.04. I don't think vanilla git supports pushing over ftp.

Re: [PATCH 04/10] attr: more matching optimizations from .gitignore

2012-10-05 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy pclo...@gmail.com writes: +Unlike `.gitignore`, negative patterns are not supported. +Patterns that match directories are also not supported. Is are not supported the right phrasing? I think it makes perfect sense not to forbid !path attr1, because it is unclear what it

Re: [PATCH 5/6] log: pass rev_info to git_log_config()

2012-10-05 Thread Junio C Hamano
Jeff King p...@peff.net writes: Agreed. Maybe the simplest thing would be to have grep_config fill in a static struct grep_opt grep_defaults, and then memcpy that into place during init_revisions? Yes, I was doing that for a bit last night, but then realized that the grep_config() should be

Re: git 1.8.0.rc0.18.gf84667d trouble with git commit -p file

2012-10-05 Thread Frans Klaver
On Fri, 05 Oct 2012 16:20:45 +0200, Horst H. von Brand vonbr...@inf.utfsm.cl wrote: What I did: - New file images/coins.asy ~~- 'git add images/coins.asy' - Started adding new stuff to fg.tex - Noticed a old bug in fg.tex, fixed that one - Did 'git -pm Some message' and selected just the

Re: push.default documented in man git-push?

2012-10-05 Thread Junio C Hamano
Nguyen Thai Ngoc Duy pclo...@gmail.com writes: On Thu, Oct 4, 2012 at 12:45 PM, Junio C Hamano gits...@pobox.com wrote: Nguyen Thai Ngoc Duy pclo...@gmail.com writes: On Thu, Oct 4, 2012 at 1:49 AM, Junio C Hamano gits...@pobox.com wrote: I would recommend against listing any advice.* in the

Re: [RFC] rebase: Handle cases where format-patch fails

2012-10-05 Thread Junio C Hamano
Andrew Wong andrew.k...@gmail.com writes: 'format-patch' could fail due to reasons such as out of memory. Such failures are not detected or handled, which causes rebase to incorrectly think that it completed successfully and continue with cleanup. i.e. calling move_to_original_branch Since

Re: git pull takes ~8 seconds on up-to-date Linux git tree

2012-10-05 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: Here is a tested (in the sense that it passes the test suite, and also in the sense that an empty pull in the kernel history gives quick turnaround) patch. As I do not think we would want to revert 5802f81 (fmt-merge-msg: discard needless merge

[PATCH 2/2] show color hints based on state of the git tree

2012-10-05 Thread Simon Oosthoek
By setting GIT_PS1_SHOW_COLORHINTS when using __git_ps1 as PROMPT_COMMAND, you will get color hints in addition to a different character (*+% etc.) Signed-off-by: Simon Oosthoek soosth...@nieuwland.nl --- contrib/completion/git-prompt.sh | 42 +++--- 1 file

[PATCH 1/2] Allow __git_ps1 to be used in PROMPT_COMMAND

2012-10-05 Thread Simon Oosthoek
changes __git_ps1 to not just allow use in setting PS1 with __git_ps1 in a command substitution, but also allows __git_ps1 to be used as PROMPT_COMMAND in bash. This has advantages for using color and I think it is more elegant Signed-off-by: Simon Oosthoek soosth...@nieuwland.nl ---

Re: [PATCH 08/10] Integrate wildmatch to git

2012-10-05 Thread Thiago Farina
On Fri, Oct 5, 2012 at 1:41 AM, Nguyễn Thái Ngọc Duy pclo...@gmail.com wrote: This makes wildmatch.c part of libgit.a and builds test-wildmatch; the dependency on libpopt in the original has been replaced with the use of our parse-options. Global variables in test-wildmatch are marked static

Re: Fw: [git-users] How do I git-push to an FTP server?

2012-10-05 Thread Junio C Hamano
Thomas Ferris Nicolaisen tfn...@gmail.com writes: On Fri, Oct 5, 2012 at 3:46 PM, Philippe Vaucher philippe.vauc...@gmail.com wrote: On the git-users mailing list we're trying someone to help with running `git push` over FTP. That person is runnig Git 1.7.9.5 on Ubuntu 12.04. I don't

Re: git 1.8.0.rc0.18.gf84667d trouble with git commit -p file

2012-10-05 Thread Junio C Hamano
Frans Klaver franskla...@gmail.com writes: On Fri, 05 Oct 2012 16:20:45 +0200, Horst H. von Brand vonbr...@inf.utfsm.cl wrote: What I did: - New file images/coins.asy ~~- 'git add images/coins.asy' - Started adding new stuff to fg.tex - Noticed a old bug in fg.tex, fixed that one - Did

Re: git 1.8.0.rc0.18.gf84667d trouble with git commit -p file

2012-10-05 Thread Jeff King
On Fri, Oct 05, 2012 at 03:29:10PM -0700, Junio C Hamano wrote: Assuming that the last step of what Horst did was git commit -pm, I think Git is wrong in this case. When you tell git commit what to commit, unless you give -i (aka also) option, the command makes a commit to record changes

Re: [PATCH] git-svn: keep leading slash when canonicalizing paths (fallback case)

2012-10-05 Thread Eric Wong
Jonathan Nieder jrnie...@gmail.com wrote: Noticed by forcing the fallback on and running tests. Without this patch, t9101.4 fails: Bad URL passed to RA layer: Unable to open an ra_local session to \ URL: Local URL 'file://homejrnsrcgit-scratch/t/trash%20directory.\

Re: git pull takes ~8 seconds on up-to-date Linux git tree

2012-10-05 Thread Jeff King
On Fri, Oct 05, 2012 at 01:34:02PM -0700, Junio C Hamano wrote: OK, I think I am convinced myself that this patch is the right fix. The performance regression Markus saw is in fmt-merge-message, and it is caused by the updated remove_redundant() that is used by get_merge_bases_many() and

Re: [PATCH 04/10] attr: more matching optimizations from .gitignore

2012-10-05 Thread Nguyen Thai Ngoc Duy
On Sat, Oct 6, 2012 at 1:48 AM, Junio C Hamano gits...@pobox.com wrote: Nguyễn Thái Ngọc Duy pclo...@gmail.com writes: +Unlike `.gitignore`, negative patterns are not supported. +Patterns that match directories are also not supported. Is are not supported the right phrasing? I think it

Re: git pull takes ~8 seconds on up-to-date Linux git tree

2012-10-05 Thread Junio C Hamano
Jeff King p...@peff.net writes: @@ -617,6 +618,8 @@ static struct commit_list *paint_down_to_common(struct commit *one, int n, struc one-object.flags |= PARENT1; commit_list_insert_by_date(one, list); + if (!n) + return list; for (i = 0; i n; i++) {

Re: [PATCH] git-svn: keep leading slash when canonicalizing paths (fallback case)

2012-10-05 Thread Junio C Hamano
Eric Wong normalper...@yhbt.net writes: Jonathan Nieder jrnie...@gmail.com wrote: Noticed by forcing the fallback on and running tests. Without this patch, t9101.4 fails: Bad URL passed to RA layer: Unable to open an ra_local session to \ URL: Local URL