[PATCH] improve git svn performance

2014-01-19 Thread manjian2006
From: linzj Hi, I am trying to improve git svn's performance according to some profiling data.As the data showed,_rev_list subroutine and rebuild subroutine are consuming a large proportion of time.So I improve _rev_list's performance by memoize its results,and avoid subprocess invocation by

[PATCH] improve git svn performance Hi, I am trying to improve git svn's performance according to some profiling data.As the data showed,_rev_list subroutine and rebuild subroutine are consuming a l

2014-01-19 Thread manjian2006
From: linzj --- perl/Git/SVN.pm | 63 - 1 file changed, 49 insertions(+), 14 deletions(-) diff --git a/perl/Git/SVN.pm b/perl/Git/SVN.pm index 5273ee8..3cd1c8f 100644 --- a/perl/Git/SVN.pm +++ b/perl/Git/SVN.pm @@ -1599,27 +1599,36 @@ sub

Re: [PATCH/WIP v2 02/14] read-cache: new extension to mark what file is watched

2014-01-19 Thread Duy Nguyen
On Mon, Jan 20, 2014 at 12:06 AM, Thomas Rast wrote: > Nguyễn Thái Ngọc Duy writes: > >> If an entry is "watched", git lets an external program decide if the >> entry is modified or not. It's more like --assume-unchanged, but >> designed to be controlled by machine. >> >> We are running out of on

Re: [PATCH/WIP v2 05/14] read-cache: put some limits on file watching

2014-01-19 Thread Duy Nguyen
On Mon, Jan 20, 2014 at 12:06 AM, Thomas Rast wrote: > Nguyễn Thái Ngọc Duy writes: > >> watch_entries() is a lot of computation and could trigger a lot more >> lookups in file-watcher. Normally after the first set of watches are >> in place, we do not need to update often. Moreover if the number

Re: [PATCH/WIP v2 08/14] read-cache: add GIT_TEST_FORCE_WATCHER for testing

2014-01-19 Thread Duy Nguyen
On Mon, Jan 20, 2014 at 12:04 AM, Thomas Rast wrote: > Nguyễn Thái Ngọc Duy writes: > >> This can be used to force watcher on when running the test >> suite. >> >> git-file-watcher processes are not automatically cleaned up after each >> test. So after running the test suite you'll be left with p

Re: [PATCH/WIP v2 00/14] inotify support

2014-01-19 Thread Duy Nguyen
On Mon, Jan 20, 2014 at 12:04 AM, Thomas Rast wrote: > I never got the last three patches, did you send them? > > Also, this doesn't cleanly apply anywhere at my end. Can you push it > somewhere for easier experimentation? Sorry I rebased it on top of kb/fast-hashmap but never got around to actu

Re: [PATCH v2 03/17] safe_create_leading_directories(): add explicit "slash" pointer

2014-01-19 Thread Sebastian Schuberth
On Tue, Jan 7, 2014 at 6:41 PM, Junio C Hamano wrote: >> Let me know if you would like me to merge or rebase the is_dir_sep() >> changes into this patch series. > > I'd want SSchuberth and windows folks to be at least aware of this > series and preferrably see that they offer inputs to this serie

Re: [PATCH v2] safe_create_leading_directories(): on Windows, \ can separate path components

2014-01-19 Thread Sebastian Schuberth
On Sun, Jan 19, 2014 at 12:40 AM, Michael Haggerty wrote: > This patch applies on top of v3 of mh/safe-create-leading-directories. > > The only logical change from Sebastian's patch is that this version > restores the original slash character rather than always restoring it > to '/' (as suggested

[PATCH 1/2] builtin/blame.c: struct blame_entry does not need a prev link

2014-01-19 Thread David Kastrup
--- builtin/blame.c | 13 ++--- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/builtin/blame.c b/builtin/blame.c index e44a6bb..2195595 100644 --- a/builtin/blame.c +++ b/builtin/blame.c @@ -197,7 +197,6 @@ static void drop_origin_blob(struct origin *o) * scoreboard struc

[PATCH 2/2] Eliminate same_suspect function in builtin/blame.c

2014-01-19 Thread David Kastrup
Since the origin pointers are "interned" and reference-counted, comparing the pointers rather than the content is enough. The only uninterned origins are cached values kept in commit->util, but same_suspect is not called on them. --- builtin/blame.c | 25 - 1 file changed,

[PATCH 0/2] Two janitorial patches for builtin/blame.c

2014-01-19 Thread David Kastrup
This is more a warmup than anything else: I'm actually doing a quite more involved rewrite of git-blame right now. But it's been a long time since I sent patches for Git, so I'm starting out with something reasonably uncontroversial. Patch 1 is a no-brainer: maintaining reverse links is not worth

Re: [PATCH/WIP v2 05/14] read-cache: put some limits on file watching

2014-01-19 Thread Thomas Rast
Nguyễn Thái Ngọc Duy writes: > watch_entries() is a lot of computation and could trigger a lot more > lookups in file-watcher. Normally after the first set of watches are > in place, we do not need to update often. Moreover if the number of > entries is small, the overhead of file watcher may act

Re: [PATCH/WIP v2 02/14] read-cache: new extension to mark what file is watched

2014-01-19 Thread Thomas Rast
Nguyễn Thái Ngọc Duy writes: > If an entry is "watched", git lets an external program decide if the > entry is modified or not. It's more like --assume-unchanged, but > designed to be controlled by machine. > > We are running out of on-disk ce_flags, so instead of extending > on-disk entry format

Re: [PATCH/WIP v2 08/14] read-cache: add GIT_TEST_FORCE_WATCHER for testing

2014-01-19 Thread Thomas Rast
Nguyễn Thái Ngọc Duy writes: > This can be used to force watcher on when running the test > suite. > > git-file-watcher processes are not automatically cleaned up after each > test. So after running the test suite you'll be left with plenty > git-file-watcher processes that should all end after a

Re: [PATCH/WIP v2 00/14] inotify support

2014-01-19 Thread Thomas Rast
Nguyễn Thái Ngọc Duy writes: > read-cache: save trailing sha-1 > read-cache: new extension to mark what file is watched > read-cache: connect to file watcher > read-cache: ask file watcher to watch files > read-cache: put some limits on file watching > read-cache: get modified file lis

Re: [Question] Usercase about git clone

2014-01-19 Thread Christian Couder
Hi, On Fri, Jan 17, 2014 at 4:53 PM, Wang Shilong wrote: > Hello everyone, > > I have a question about command 'git clone' > If i clone a repo from remote, and if i run command: > > # git remote show origin > > It will output origin's url, however, this is what i want, Is it really what you want

[PATCH v2 03/16] trailer: read and process config information

2014-01-19 Thread Christian Couder
This patch implements reading the configuration to get trailer information, and then processing it and storing it in a doubly linked list. The config information is stored in the list whose first item is pointed to by: static struct trailer_item *first_conf_item; Signed-off-by: Christian Couder

[PATCH v2 05/16] strbuf: add strbuf_isspace()

2014-01-19 Thread Christian Couder
This helper function checks if a strbuf contains only space chars or not. Signed-off-by: Christian Couder --- strbuf.c | 7 +++ strbuf.h | 1 + 2 files changed, 8 insertions(+) diff --git a/strbuf.c b/strbuf.c index 83caf4a..2124bb8 100644 --- a/strbuf.c +++ b/strbuf.c @@ -124,6 +124,13 @@

[PATCH v2 08/16] trailer: add interpret-trailers command

2014-01-19 Thread Christian Couder
This patch adds the "git interpret-trailers" command. This command uses the previously added process_trailers() function in trailer.c. Signed-off-by: Christian Couder --- .gitignore | 1 + Makefile | 1 + builtin.h| 1 + builtin/interp

[PATCH v2 04/16] trailer: process command line trailer arguments

2014-01-19 Thread Christian Couder
This patch parses the trailer command line arguments and put the result into an arg_tok doubly linked list. Signed-off-by: Christian Couder --- trailer.c | 77 +++ 1 file changed, 77 insertions(+) diff --git a/trailer.c b/trailer.c ind

[PATCH v2 14/16] trailer: add tests for trailer command

2014-01-19 Thread Christian Couder
Signed-off-by: Christian Couder --- t/t7513-interpret-trailers.sh | 27 +++ 1 file changed, 27 insertions(+) diff --git a/t/t7513-interpret-trailers.sh b/t/t7513-interpret-trailers.sh index f5ef81f..2d50b7a 100755 --- a/t/t7513-interpret-trailers.sh +++ b/t/t7513-interpre

[PATCH v2 13/16] trailer: execute command from 'trailer..command'

2014-01-19 Thread Christian Couder
Signed-off-by: Christian Couder --- trailer.c | 57 + 1 file changed, 57 insertions(+) diff --git a/trailer.c b/trailer.c index 43a3735..549d381 100644 --- a/trailer.c +++ b/trailer.c @@ -1,4 +1,5 @@ #include "cache.h" +#include "run-comma

[PATCH v2 09/16] trailer: add tests for "git interpret-trailers"

2014-01-19 Thread Christian Couder
Signed-off-by: Christian Couder --- t/t7513-interpret-trailers.sh | 208 ++ 1 file changed, 208 insertions(+) create mode 100755 t/t7513-interpret-trailers.sh diff --git a/t/t7513-interpret-trailers.sh b/t/t7513-interpret-trailers.sh new file mode 100755

[PATCH v2 11/16] trailer: add new_trailer_item() function

2014-01-19 Thread Christian Couder
This is a small refactoring to prepare for the next steps. Signed-off-by: Christian Couder --- trailer.c | 31 +++ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/trailer.c b/trailer.c index 9026337..43a3735 100644 --- a/trailer.c +++ b/trailer.c @@ -4

[PATCH v2 12/16] strbuf: add strbuf_replace()

2014-01-19 Thread Christian Couder
Signed-off-by: Christian Couder --- strbuf.c | 7 +++ strbuf.h | 3 +++ 2 files changed, 10 insertions(+) diff --git a/strbuf.c b/strbuf.c index 2124bb8..e45e513 100644 --- a/strbuf.c +++ b/strbuf.c @@ -197,6 +197,13 @@ void strbuf_splice(struct strbuf *sb, size_t pos, size_t len, s

[PATCH v2 02/16] trailer: process trailers from file and arguments

2014-01-19 Thread Christian Couder
This patch implements the logic that process trailers from file and arguments. At the beginning trailers from file are in their own infile_tok doubly linked list, and trailers from arguments are in their own arg_tok doubly linked list. The lists are traversed and when an arg_tok should be "applie

[PATCH v2 15/16] trailer: set author and committer env variables

2014-01-19 Thread Christian Couder
Signed-off-by: Christian Couder --- trailer.c | 30 +- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/trailer.c b/trailer.c index 549d381..3b21f57 100644 --- a/trailer.c +++ b/trailer.c @@ -1,5 +1,6 @@ #include "cache.h" #include "run-command.h" +#incl

[PATCH v2 16/16] trailer: add tests for commands using env variables

2014-01-19 Thread Christian Couder
Signed-off-by: Christian Couder --- t/t7513-interpret-trailers.sh | 20 1 file changed, 20 insertions(+) diff --git a/t/t7513-interpret-trailers.sh b/t/t7513-interpret-trailers.sh index 2d50b7a..00894a8 100755 --- a/t/t7513-interpret-trailers.sh +++ b/t/t7513-interpret-trail

[PATCH v2 07/16] trailer: put all the processing together and print

2014-01-19 Thread Christian Couder
This patch adds the process_trailers() function that calls all the previously added processing functions and then prints the results on the standard output. Signed-off-by: Christian Couder --- trailer.c | 40 1 file changed, 40 insertions(+) diff --git a

[PATCH v2 06/16] trailer: parse trailers from input file

2014-01-19 Thread Christian Couder
This patch reads trailers from an input file, parses them and puts the result into a doubly linked list. Signed-off-by: Christian Couder --- trailer.c | 62 ++ 1 file changed, 62 insertions(+) diff --git a/trailer.c b/trailer.c index b

[PATCH v2 10/16] trailer: if no input file is passed, read from stdin

2014-01-19 Thread Christian Couder
It is simpler and more natural if the "git interpret-trailers" is made a filter as its output already goes to sdtout. Signed-off-by: Christian Couder --- builtin/interpret-trailers.c | 2 +- t/t7513-interpret-trailers.sh | 7 +++ trailer.c | 15 +-- 3 files

[PATCH v2 01/16] Add data structures and basic functions for commit trailers

2014-01-19 Thread Christian Couder
We will use a doubly linked list to store all information about trailers and their configuration. This way we can easily remove or add trailers to or from trailer lists while traversing the lists in either direction. Signed-off-by: Christian Couder --- Makefile | 1 + trailer.c | 47 +

[PATCH v2 00/16] Add interpret-trailers builtin

2014-01-19 Thread Christian Couder
This patch series implements a new command: git interpret-trailers and an infrastructure to process trailers that can be reused, for example in "commit.c". 1) Rationale: This command should help with RFC 822 style headers, called "trailers", that are found at the end of commit messages.