broken racy detection and performance issues with nanosecond file times

2015-09-25 Thread Karsten Blees
Hi there, I think I found a few nasty problems with racy detection, as well as performance issues when using git implementations with different file time resolutions on the same repository (e.g. git compiled with and without USE_NSEC, libgit2 compiled with and without USE_NSEC, JGit executed in di

[PATCH/RFC] read-cache: fix file time comparisons with different precisions

2015-09-28 Thread Karsten Blees
fixes racy detection in USE_NSEC-enabled git with core.checkStat=minimal, as the coreStat setting now affects racy checks as well. Finally, do not check ctime if ctime.sec is 0 (as recorded by JGit). Signed-off-by: Karsten Blees --- read-ca

Re: [PATCH/RFC] read-cache: fix file time comparisons with different precisions

2015-09-29 Thread Karsten Blees
Am 28.09.2015 um 14:52 schrieb Johannes Schindelin: > Otherwise there would be that little loop-hole where (nsec % 1000) == 0 *by > chance* and we assume the timestamps to be identical even if they are not. Yeah, but in this case the file would be racy, as racy-checks use the same comparison now.

Re: broken racy detection and performance issues with nanosecond file times

2015-09-29 Thread Karsten Blees
Am 28.09.2015 um 19:38 schrieb Junio C Hamano: > Karsten Blees writes: > >> Problem 1: Failure to detect racy files (without USE_NSEC) >> == >> >> Git may not detect racy changes when 'update-index'

[PATCH (resend)] git-gui: make gc warning threshold match 'git gc --auto'

2015-06-13 Thread Karsten Blees
very small, to get a better estimate. Signed-off-by: Karsten Blees --- git-gui/lib/database.tcl | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/git-gui/lib/database.tcl b/git-gui/lib/database.tcl index 1f187ed..212b195 100644 --- a/git-gui/lib/database.tcl ++

[PATCH] Documentation/i18n.txt: clarify character encoding support

2015-06-13 Thread Karsten Blees
established UTF-8 NFC as de-facto standard for path names. Update the documentation in i18n.txt to reflect the current status-quo. Signed-off-by: Karsten Blees --- Documentation/i18n.txt | 30 -- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/Docu

[PATCH] Makefile / racy-git.txt: clarify USE_NSEC prerequisites

2015-06-13 Thread Karsten Blees
Signed-off-by: Karsten Blees --- Enabling nanosecond file times was recently discussed on the libgit2 project, so I thought its time to fix the nanosecond issue on Linux. Don't know yet if the patch will be accepted (and in which kernel version). Considering that nanosecond file times are

Re: [PATCH] Documentation/i18n.txt: clarify character encoding support

2015-06-15 Thread Karsten Blees
Am 15.06.2015 um 02:12 schrieb Junio C Hamano: > Karsten Blees writes: > >> diff --git a/Documentation/i18n.txt b/Documentation/i18n.txt >> index e9a1d5d..e5f6233 100644 >> --- a/Documentation/i18n.txt >> +++ b/Documentation/i18n.txt >> @@ -1,18 +1,28 @@ >

[PATCH] config.c: fix writing config files on Windows network shares

2015-06-30 Thread Karsten Blees
Renaming to an existing file doesn't work on Windows network shares if the target file is open. munmap() the old config file before commit_lock_file. Signed-off-by: Karsten Blees --- See https://github.com/git-for-windows/git/issues/226 Strangely, renaming to an open file works fine on

[PATCH v2] Makefile / racy-git.txt: clarify USE_NSEC prerequisites

2015-07-01 Thread Karsten Blees
Signed-off-by: Karsten Blees --- ...just changed wording as you suggested. Documentation/technical/racy-git.txt | 8 ++-- Makefile | 9 + 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Documentation/technical/racy-git.txt b

[PATCH v2] Documentation/i18n.txt: clarify character encoding support

2015-07-01 Thread Karsten Blees
established UTF-8 NFC as de-facto standard for path names. Update the documentation in i18n.txt to reflect the current status-quo. Signed-off-by: Karsten Blees --- Sorry for the delay, got swamped with other stuff... Am 17.06.2015 um 22:45 schrieb Junio C Hamano: > > ... I am OK to

Re: Git doesn't detect change, if file modification time is restored to original one

2015-07-23 Thread Karsten Blees
Am 23.07.2015 um 16:53 schrieb Konstantin Khomoutov: > On Thu, 23 Jul 2015 11:14:11 +0200 > Konrád Lőrinczi wrote: > > [...] >> I accept these solutions as workarounds, but the real solution would >> be: Dev suggestions: >> 1) Add a --force-reread option to git status, so user can force >> reread

Re: [RFC PATCH] hashmap API: introduce for_each_hashmap_entry() helper macro

2016-03-19 Thread Karsten Blees
Am 16.03.2016 um 17:39 schrieb Alexander Kuleshov: > There is common pattern to traverse a hashmap in git source code: > > hashmap_iter_init(map, &iter); > while ((entry = hashmap_iter_next(&iter))) > // do something with entry > The hashmap_iter_first() function al

Re: [PATCH v2] hashmap API: introduce for_each_hashmap_entry() helper macro

2016-03-19 Thread Karsten Blees
Am 17.03.2016 um 11:38 schrieb Alexander Kuleshov: > This patch introduces the for_each_hashmap_entry() macro for more I'd rather call it 'hashmap_for_each', following the pattern 'operandtype_operation' used throughout git. E.g. we already have 'hashmap_get', not 'get_hashmap_entry'. I realize

Re: Make the git codebase thread-safe

2014-02-12 Thread Karsten Blees
Am 13.02.2014 00:03, schrieb Mike Hommey: > On Wed, Feb 12, 2014 at 12:00:19PM +0100, Karsten Blees wrote: >> Am 12.02.2014 04:43, schrieb Duy Nguyen: >>> On Wed, Feb 12, 2014 at 9:02 AM, Robin H. Johnson >>> wrote: >>>> On Tue, Feb 11, 2014 at 05:54:51PM

Re: Make the git codebase thread-safe

2014-02-13 Thread Karsten Blees
Am 13.02.2014 19:38, schrieb Zachary Turner: > The only reason ReOpenFile is necessary at > all is because some code somewhere is mixing read-styles against the same > fd. > I don't understand...ReadFile with OVERLAPPED parameter doesn't modify the HANDLE's file position, so you should be abl

Re: Make the git codebase thread-safe

2014-02-14 Thread Karsten Blees
xed read > styles, but it seems like the only possible explanation. > > On Thu, Feb 13, 2014 at 2:53 PM, Stefan Zager wrote: >> On Thu, Feb 13, 2014 at 2:51 PM, Karsten Blees >> wrote: >>> Am 13.02.2014 19:38, schrieb Zachary Turner: >>> >>>> The onl

Re: Make the git codebase thread-safe

2014-02-14 Thread Karsten Blees
Am 14.02.2014 20:16, schrieb Zachary Turner: > For the mixed read, we wouldn't be looking for another caller of > pread() (since it doesn't care what the file pointer is), but instead > a caller of read() or lseek() (since those do depend on the current > file pointer). In index-pack.c, I see two

Re: Branch Name Case Sensitivity

2014-02-27 Thread Karsten Blees
Am 27.02.2014 21:32, schrieb Torsten Bögershausen: > On 2014-02-27 20.50, Junio C Hamano wrote: >> Lee Hopkins writes: >> >>> Last week I ran across a potential bug with branch names on case >>> insensitive file systems, the complete scenario can be found here: >>> >>> https://groups.google.com/fo

Re: Branch Name Case Sensitivity

2014-02-28 Thread Karsten Blees
Am 28.02.2014 07:41, schrieb Johannes Sixt: > Am 2/28/2014 0:38, schrieb Lee Hopkins: >>> If I understand the issue correctly, the problem is that packed-refs >>> are always case-sensitive, even if core.ignorecase=true. OTOH, > > core.ignorecase is intended to affect filenames of the worktree, not

Re: Branch Name Case Sensitivity

2014-03-03 Thread Karsten Blees
Am 01.03.2014 07:54, schrieb Torsten Bögershausen: > On 2014-03-01 03.42, Lee Hopkins wrote: >> + >> +if(ignore_case) > Only looking at ignore_case here closes the door for people > who have a branch "foo" and "Foo" at the same time. > (Which means that they are carefully running git pack-refs)

Re: Branch Name Case Sensitivity

2014-03-04 Thread Karsten Blees
Am 03.03.2014 18:51, schrieb Junio C Hamano: > Lee Hopkins writes: > >> I went ahead and took a stab at a solution. My solution is more >> aggressive than a warning, I actually prevent the creation of >> ambiguous refs. My changes are also in refs.c, which may not be >> appropriate, but it seemed

Re: question about: Facebook makes Mercurial faster than Git

2014-03-10 Thread Karsten Blees
Am 10.03.2014 12:42, schrieb Dennis Luehring: > Am 10.03.2014 12:28, schrieb demerphq: >> I had the impression, and I would not be surprised if they had the >> impression that the git development community is relatively >> unconcerned about performance issues on larger repositories. > > so the que

Re: [RFC/WIP] Pluggable reference backends

2014-03-11 Thread Karsten Blees
Am 10.03.2014 12:00, schrieb Michael Haggerty: > > Reference transactions > -- > Very cool ideas indeed. However, I'm concerned a bit that transactions are conceptual overkill. How many concurrent updates do you expect in a repository? Wouldn't a single repo-wide lock suff

Re: [PATCH] Enable index-pack threading in msysgit.

2014-03-20 Thread Karsten Blees
Am 19.03.2014 01:46, schrieb sza...@chromium.org: > This adds a Windows implementation of pread. Note that it is NOT > safe to intersperse calls to read() and pread() on a file > descriptor. This is a bad idea. You're basically fixing the multi-threaded issue twice, while at the same time breaki

Re: [PATCH] Enable index-pack threading in msysgit.

2014-03-20 Thread Karsten Blees
Am 20.03.2014 17:08, schrieb Stefan Zager: > On Thu, Mar 20, 2014 at 6:54 AM, Karsten Blees > wrote: >> Am 19.03.2014 01:46, schrieb sza...@chromium.org: >>> This adds a Windows implementation of pread. Note that it is NOT >>> safe to intersperse calls t

Re: [PATCH] Enable index-pack threading in msysgit.

2014-03-21 Thread Karsten Blees
Am 20.03.2014 02:25, schrieb Duy Nguyen: > On Thu, Mar 20, 2014 at 4:35 AM, Stefan Zager wrote: >> This adds a Windows implementation of pread. Note that it is NOT >> safe to intersperse calls to read() and pread() on a file >> descriptor. According to the ReadFile spec, using the 'overlapped' >

Re: [PATCH] Enable index-pack threading in msysgit.

2014-03-21 Thread Karsten Blees
Am 21.03.2014 06:35, schrieb Stefan Zager: > On Thu, Mar 20, 2014 at 10:21 PM, Duy Nguyen wrote: >> On Fri, Mar 21, 2014 at 08:51:18AM +0700, Duy Nguyen wrote: >>> On Thu, Mar 20, 2014 at 11:08 PM, Stefan Zager wrote: Duy, would you like to re-post your patch without the new pread impl

Re: [PATCH] Enable index-pack threading in msysgit.

2014-03-21 Thread Karsten Blees
Am 20.03.2014 22:56, schrieb Stefan Zager: > On Thu, Mar 20, 2014 at 2:35 PM, Karsten Blees > wrote: >> Am 20.03.2014 17:08, schrieb Stefan Zager: >> >>> Going forward, there is still a lot of performance that gets left on >>> the table when you rule out thr

Re: Our official home page and logo for the Git project

2014-04-11 Thread Karsten Blees
Am 09.04.2014 18:43, schrieb Felipe Contreras: > Junio C Hamano wrote: >> - To officially adopt the logo that appears on the "project >>home page" as our "project logo". > > I have made my objections to that logo before, but here it goes again: bright > red is a horrible color for a logo, as

Re: [PATCH 8/9] autoconf: Check for timer_settime

2014-09-10 Thread Karsten Blees
Am 29.08.2014 19:40, schrieb Keller, Jacob E: > On Fri, 2014-08-29 at 19:26 +0200, Johannes Sixt wrote: >> Am 29.08.2014 18:42, schrieb Jacob Keller: >>> From: Jonas 'Sortie' Termansen >>> >>> This function will be used in a following commit. >>> >>> The timer_settime function is provided in librt

Re: [RFC] Speed up "git status" by caching untracked file info

2014-04-22 Thread Karsten Blees
Am 17.04.2014 07:51, schrieb Nguyễn Thái Ngọc Duy: > This patch serves as a heads up about a feature I'm working on. I hope > that by posting it early, people could double check if I have made > some fundamental mistakes that completely ruin the idea. It's about > speeding up "git status" by cachin

Re: [RFC] Speed up "git status" by caching untracked file info

2014-04-22 Thread Karsten Blees
Am 22.04.2014 12:35, schrieb Duy Nguyen: > On Tue, Apr 22, 2014 at 5:13 PM, Duy Nguyen wrote: >>> IIRC name_hash.c::lazy_init_name_hash took ~100ms on my system, so >>> hopefully you did a dummy 'cache_name_exists("anything")' before starting >>> the measurement of the first run? >> >> No I didn

Re: [PATCH 08/12] MINGW: fix main() signature in http-fetch.c and remote-curl.c

2014-04-30 Thread Karsten Blees
Am 29.04.2014 11:12, schrieb Marat Radchenko: > On MinGW, compat/mingw.h defines a 'mingw_main' wrapper function. > Fix `warning: passing argument 2 of 'mingw_main' from incompatible > pointer type` in http-fetch.c and remote-curl.c by dropping 'const'. > Would you mind cross checking your change

[RFC/PATCH v4 0/3] add performance tracing facility

2014-05-20 Thread Karsten Blees
This is the POSIX port of the patches I typically use to track down msysgit performance issues (thus v4, the latest windows-only version is here [1]). Sebastian and Dscho thought this might be useful in core git, so here it is. [1] https://github.com/msysgit/git/pull/46 Karsten Blees (3): add

[RFC/PATCH v4 2/3] add trace_performance facility to debug performance issues

2014-05-20 Thread Karsten Blees
case (measure repetitive code sections): uint64_t t = 0; for (;;) { /* ignore */ t -= getnanotime(); /* code section to measure */ t += getnanotime(); /* ignore */ } trace_performance(t, "frotz"); Signed-off-by: Karsten Blees --- cache

[RFC/PATCH v4 1/3] add high resolution timer function to debug performance issues

2014-05-20 Thread Karsten Blees
following platforms: * Linux: using clock_gettime(CLOCK_MONOTONIC) * Windows: using QueryPerformanceCounter() Todo: * enable clock_gettime() on more platforms * implement Mac OSX version using mach_absolute_time Signed-off-by: Karsten Blees --- Makefile | 7 + cache.h

[RFC/PATCH v4 3/3] add command performance tracing to debug scripted commands

2014-05-20 Thread Karsten Blees
' 'config' '--get-color' 'color.interactive.help' 'red bold' performance: at trace.c:319, time: 0.000280701 s: git command: 'git' 'config' '--get-color' '' 'reset' performance: at trace.c:319, time: 0.00

Re: [RFC/PATCH v4 1/3] add high resolution timer function to debug performance issues

2014-05-21 Thread Karsten Blees
Am 21.05.2014 09:31, schrieb Noel Grandin: > On 2014-05-20 21:11, Karsten Blees wrote: >> * implement Mac OSX version using mach_absolute_time >> >> > > > Note that unlike the Windows and Linux APIs, mach_absolute_time does not do > correction for frequency

Re: [RFC/PATCH v4 2/3] add trace_performance facility to debug performance issues

2014-05-21 Thread Karsten Blees
Am 21.05.2014 18:58, schrieb Jeff King: > On Tue, May 20, 2014 at 09:11:19PM +0200, Karsten Blees wrote: > >> Add trace_performance and trace_performance_since macros that print file >> name, line number, time and an optional printf-formatted text to the file >> specified

Re: [RFC/PATCH v4 3/3] add command performance tracing to debug scripted commands

2014-05-21 Thread Karsten Blees
Am 21.05.2014 18:55, schrieb Jeff King: > On Tue, May 20, 2014 at 09:11:24PM +0200, Karsten Blees wrote: > >> Add performance tracing to identify which git commands are called and how >> long they execute. This is particularly useful to debug performance issues >&

Re: [RFC/PATCH v4 1/3] add high resolution timer function to debug performance issues

2014-05-21 Thread Karsten Blees
Am 22.05.2014 00:14, schrieb Richard Hansen: > On 2014-05-20 15:11, Karsten Blees wrote: >> Add a getnanotime() function that returns nanoseconds since 01/01/1970 as >> unsigned 64-bit integer (i.e. overflows in july 2554). > > Must it be relative to epoch? If it was re

Re: [RFC/PATCH v4 3/3] add command performance tracing to debug scripted commands

2014-05-23 Thread Karsten Blees
Am 22.05.2014 11:59, schrieb Jeff King: > On Thu, May 22, 2014 at 02:40:48AM +0200, Karsten Blees wrote: > >> E.g. if I'm interested in a particular code section, I throw in 2 >> lines of code (before and after the code section). This gives very >> accurate r

Re: [PATCH] environment: enable core.preloadindex by default

2014-06-02 Thread Karsten Blees
Am 02.06.2014 18:43, schrieb Steve Hoelzer: > There is consensus that the default should change because it will > benefit nearly all users (some just a little, but some a lot). > See [1] and replies. Git for Windows users may want to try core.fscache=true as well [1]. This eliminates the UAC pena

Re: [PATCH] environment: enable core.preloadindex by default

2014-06-03 Thread Karsten Blees
Am 03.06.2014 08:18, schrieb Steve Hoelzer: > On Mon, Jun 2, 2014 at 3:01 PM, Karsten Blees wrote: >> Git for Windows users may want to try core.fscache=true as well [1]. This >> eliminates the UAC penalties for repositories located on the Windows system >> drive

Re: [msysGit] Re: [PATCH] Add a Windows-specific fallback to getenv("HOME");

2014-06-04 Thread Karsten Blees
Am 04.06.2014 16:05, schrieb Erik Faye-Lund: > On Wed, Jun 4, 2014 at 3:47 PM, Duy Nguyen wrote: >> On Wed, Jun 4, 2014 at 6:47 PM, Stepan Kasal wrote: >>> @@ -133,7 +133,7 @@ char *git_path(const char *fmt, ...) >>> void home_config_paths(char **global, char **xdg, char *file) >>> { >>>

Re: [msysGit] Re: [PATCH] Add a Windows-specific fallback to getenv("HOME");

2014-06-04 Thread Karsten Blees
Am 04.06.2014 17:46, schrieb Johannes Schindelin: > Hi kusma, > > On Wed, 4 Jun 2014, Johannes Schindelin wrote: > >> The problem arises whenever git.exe calls subprocesses. You can pollute >> the environment by setting HOME, I do not recall the details, but I >> remember that we had to be very c

Re: [PATCH v2] Add a Windows-specific fallback to getenv("HOME");

2014-06-05 Thread Karsten Blees
Am 05.06.2014 10:03, schrieb Stepan Kasal: > From: Johannes Schindelin > Date: Wed, 2 Jun 2010 00:41:33 +0200 > > If HOME is not set, use $HOMEDRIVE$HOMEPATH > > Signed-off-by: Johannes Schindelin > Signed-off-by: Stepan Kasal > --- > > Hello Karsten, > thanks for your explanation. There are

Re: [msysGit] Re: [PATCH] Add a Windows-specific fallback to getenv("HOME");

2014-06-05 Thread Karsten Blees
Am 05.06.2014 14:03, schrieb Johannes Schindelin: > Hi Karsten, > > On Thu, 5 Jun 2014, Karsten Blees wrote: > >> After a bit of digging in the history and the old googlegroups issue >> tracker, I think this patch is completely unrelated to the non-ASCII >> problems

Re: [PATCH] mingw: redefine the wrapper macro after the corresponding function

2014-06-05 Thread Karsten Blees
Am 05.06.2014 10:05, schrieb Stepan Kasal: > mingw.c defines several wrapper functionsi, like mingw_unlink(). > These wrappers are deployed by macros like this: > #define unlink mingw_unlink > The function itself is preceded by #undef, leaving the wrapper out > of the game for the rest of min

Re: [PATCH v2] Add a Windows-specific fallback to getenv("HOME");

2014-06-05 Thread Karsten Blees
Am 05.06.2014 15:39, schrieb Johannes Schindelin: > And in particular with your changes to Unicodify the complete environment, > I am *highly* doubtful that child processes will be able to handle > themselves properly, unless we spend a whole lot of time converting back > and forth the environment

Re: [PATCH v2] Add a Windows-specific fallback to getenv("HOME");

2014-06-05 Thread Karsten Blees
Am 05.06.2014 11:58, schrieb Erik Faye-Lund: > On Thu, Jun 5, 2014 at 11:40 AM, Karsten Blees > wrote: >> Am 05.06.2014 10:03, schrieb Stepan Kasal: >>> From: Johannes Schindelin >>> Date: Wed, 2 Jun 2010 00:41:33 +0200 >>> >>> If HOME is not se

Re: [msysGit] [PATCH] mingw: redefine the wrapper macro after the corresponding function

2014-06-05 Thread Karsten Blees
Am 05.06.2014 18:56, schrieb Johannes Sixt: > Am 05.06.2014 10:05, schrieb Stepan Kasal: >> mingw.c defines several wrapper functionsi, like mingw_unlink(). >> These wrappers are deployed by macros like this: >> #define unlink mingw_unlink >> The function itself is preceded by #undef, leaving

Re: [msysGit] Re: [PATCH] mingw: redefine the wrapper macro after the corresponding function

2014-06-05 Thread Karsten Blees
Am 05.06.2014 17:13, schrieb Stepan Kasal: > Hello Karsten, > > On Thu, Jun 05, 2014 at 04:51:39PM +0200, Karsten Blees wrote: >> In the current msysgit HEAD, most of these #undef's can simply be >> removed or have already been removed [...] > > not "most of

Re: [msysGit] [PATCH] mingw: redefine the wrapper macro after the corresponding function

2014-06-06 Thread Karsten Blees
Am 06.06.2014 10:32, schrieb Stepan Kasal: > Hello, > > On Fri, Jun 06, 2014 at 12:00:51AM +0200, Karsten Blees wrote: >> Am 05.06.2014 18:56, schrieb Johannes Sixt: >>> Within mingw.c, if some other function inside mingw.c wants to use >>> mingw_unlink, then it s

Re: [PATCH 2/2] mingw: avoid const warning

2014-06-06 Thread Karsten Blees
Am 29.05.2014 12:47, schrieb Stepan Kasal: > Fix const warnings in http-fetch.c and remote-curl.c main() where is > argv declared as const. > > The fix should work for all future declarations of main, no matter > whether the second parameter's type is "char**", "const char**", or > "char *[]". I'

Re: [PATCH 0/5] Windows dirent patches

2014-06-06 Thread Karsten Blees
Am 06.06.2014 15:43, schrieb Stepan Kasal: > Hello, > > This is a series of dirent modifications, 4 tiny ones and one bigger. > As the date indicates, these are battle tested in mysgit for several years. > The dates are actually missing from the patches, otherwise full ack from me. Thanks! --

Re: [PATCH 0/5] First part of Unicode console support for msysgit

2014-06-06 Thread Karsten Blees
in. > The fourth one is just a trivial prerequisite for > the last one, that was written in Jan 2012, with a fixup from Mar 2012. > The dates are missing from the patches. It would also have been nice to name (or link to) the patches you sqashed. > Regards, > Stepan > &g

Re: [PATCH 1/5] hashmap: add enum for hashmap free_entries option

2014-06-06 Thread Karsten Blees
Am 05.06.2014 08:06, schrieb Heiko Voigt: > This allows a reader to immediately know which options can be used and > what this parameter is about. > [...] > -void hashmap_free(struct hashmap *map, int free_entries) > +void hashmap_free(struct hashmap *map, enum hashmap_free_options > free_entries

Re: [msysGit] [PATCH] mingw: redefine the wrapper macro after the corresponding function

2014-06-06 Thread Karsten Blees
Am 06.06.2014 13:10, schrieb Stepan Kasal: > Hi Karsten, > > On Fri, Jun 06, 2014 at 11:43:03AM +0200, Karsten Blees wrote: >> Thinking about this some more, the best solution is probably to >> eliminate the problem altogether by adding inline-wrappers for >>

Re: [PATCH 2/2] mingw: avoid const warning

2014-06-06 Thread Karsten Blees
Am 06.06.2014 21:13, schrieb Junio C Hamano: > Karsten Blees writes: > >> Am 29.05.2014 12:47, schrieb Stepan Kasal: >>> Fix const warnings in http-fetch.c and remote-curl.c main() where is >>> argv declared as const. >>> >>> The fix should wor

Re: [PATCH 5/5] Win32: Thread-safe windows console output

2014-06-06 Thread Karsten Blees
Am 06.06.2014 23:29, schrieb Peter Krefting: > Stepan Kasal: > >> +/* only called from console_thread, so a static buffer will do */ >> +static wchar_t wbuf[2 * BUFFER_SIZE + 1]; > > Wouldn't BUFFER_SIZE + 1 (or even BUFFER_SIZE) do here? If you convert from > up to BUFFER_SIZE octets of

[PATCH v5 00/11] add performance tracing facility

2014-06-11 Thread Karsten Blees
.649779 git.c:312] trace: built-in: git 'rev-parse' '--git-dir' Or print file:line at the end (but what about multi-line messages, such as packet-trace?): > GIT_TRACE=1 git stash list 00:12:10.544266 trace: exec: 'git-stash' 'list' (git.c:512) 00:12:10.

[PATCH v5 01/11] trace: move trace declarations from cache.h to new trace.h

2014-06-11 Thread Karsten Blees
Also include direct dependencies (strbuf.h and git-compat-util.h for __attribute__) so that trace.h can be used independently of cache.h, e.g. in test programs. Signed-off-by: Karsten Blees --- cache.h | 13 ++--- trace.h | 17 + 2 files changed, 19 insertions(+), 11

[PATCH v5 03/11] trace: remove redundant printf format attribute

2014-06-11 Thread Karsten Blees
trace_printf_key() is the only non-static function that duplicates the printf format attribute in the .c file, remove it for consistency. Signed-off-by: Karsten Blees --- trace.c | 1 - 1 file changed, 1 deletion(-) diff --git a/trace.c b/trace.c index 37a7fa9..3e31558 100644 --- a/trace.c

[PATCH v5 02/11] trace: consistently name the format parameter

2014-06-11 Thread Karsten Blees
The format parameter to trace_printf functions is sometimes abbreviated 'fmt'. Rename to 'format' everywhere (consistent with POSIX' printf specification). Signed-off-by: Karsten Blees --- trace.c | 22 +++--- trace.h | 2 +- 2 files changed, 12 in

[PATCH v5 04/11] trace: factor out printing to the trace file

2014-06-11 Thread Karsten Blees
formatting. Signed-off-by: Karsten Blees --- trace.c | 37 +++-- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/trace.c b/trace.c index 3e31558..b7ca51b 100644 --- a/trace.c +++ b/trace.c @@ -62,6 +62,21 @@ static int get_trace_fd(const char *key

[PATCH v5 05/11] trace: add infrastructure to augment trace output with additional info

2014-06-11 Thread Karsten Blees
an print arbitrary binary data (without barfing on '%' or stopping at '\0'), so 'data' seems more appropriate. Signed-off-by: Karsten Blees --- trace.c | 45 ++--- trace.h | 2 +- 2 files changed, 35 insertions(+), 12 deletio

[PATCH v5 06/11] trace: add current timestamp to all trace output

2014-06-11 Thread Karsten Blees
processes are involved). Signed-off-by: Karsten Blees --- trace.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/trace.c b/trace.c index c920429..5a3393a 100644 --- a/trace.c +++ b/trace.c @@ -79,12 +79,21 @@ static void do_trace_print(const char *key, const struct

[PATCH v5 07/11] trace: move code around, in preparation to file:line output

2014-06-11 Thread Karsten Blees
No functional changes, just move stuff around so that the next patch isn't that ugly... Signed-off-by: Karsten Blees --- trace.c | 36 ++-- trace.h | 12 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/trace.c b/trace.c index 5a

[PATCH v5 08/11] trace: add 'file:line' to all trace output

2014-06-11 Thread Karsten Blees
2005+ (_MSC_VER 1400). This has the nice side effect that the old C-style declarations serve as documentation how the macros are to be used. Signed-off-by: Karsten Blees --- git-compat-util.h | 4 trace.c | 69 +-- tr

[PATCH v5 09/11] trace: add high resolution timer function to debug performance issues

2014-06-11 Thread Karsten Blees
ion, e.g. using mach_absolute_time + mach_timebase_info Signed-off-by: Karsten Blees --- Makefile | 7 + config.mak.uname | 1 + trace.c | 82 trace.h | 1 + 4 files changed, 91 insertions(+) diff --git a/Makefile b/Makefil

[PATCH v5 10/11] trace: add trace_performance facility to debug performance issues

2014-06-11 Thread Karsten Blees
rformance(t, "frotz"); Signed-off-by: Karsten Blees --- trace.c | 49 + trace.h | 24 2 files changed, 73 insertions(+) diff --git a/trace.c b/trace.c index 4bd52f2..0551509 100644 --- a/trace.c +++ b/trace.c @

[PATCH v5 11/11] git: add performance tracing for git's main() function to debug scripts

2014-06-11 Thread Karsten Blees
7 s: git command: 'git' 'config' '--get-color' 'color.interactive.help' 'red bold' 23:57:38.650465 trace.c:405 performance: 0.000243063 s: git command: 'git' 'config' '--get-color' '' 'reset' 23:57:38.6548

Re: [PATCH v5 09/11] trace: add high resolution timer function to debug performance issues

2014-06-11 Thread Karsten Blees
Am 11.06.2014 10:01, schrieb Karsten Blees: > the epoch allows using the results (div 10e9) with other time-related APIs. s/10e9/1e9/ -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo

Re: [PATCH 1/5] hashmap: add enum for hashmap free_entries option

2014-06-11 Thread Karsten Blees
Am 10.06.2014 12:17, schrieb Heiko Voigt: > On Fri, Jun 06, 2014 at 07:52:03PM +0200, Karsten Blees wrote: >> Am 05.06.2014 08:06, schrieb Heiko Voigt: >>> This allows a reader to immediately know which options can be used and >>> what this parameter is about. >>

[PATCH 7/6] Win32: reliably detect console pipe handles

2014-06-13 Thread Karsten Blees
pping the handles in MSVCRT's internal data structures, as we do in winansi_init(). Reported-by: Johannes Sixt Signed-off-by: Karsten Blees --- Thanks for reporting this. The fix applies on top of [6/6] Win32: fix broken pipe detection (should probably not be squashed, as its obviously

Re: [PATCH 1/5] hashmap: add enum for hashmap free_entries option

2014-06-17 Thread Karsten Blees
Am 12.06.2014 21:12, schrieb Junio C Hamano: > Karsten Blees writes: > >> Am 10.06.2014 12:17, schrieb Heiko Voigt: >>> The intention of Jonathans critique here[1] was that you do not see what >>> this parameter does on the callsite. I.e.: >>> >>>

Re: [PATCH 0/7] Second part of msysgit/unicode

2014-06-17 Thread Karsten Blees
Am 11.06.2014 11:37, schrieb Stepan Kasal: > This is the second part of the time-proven unicode suport branch from msysgit. > This batch is a collection of small independent changes, limited to mingw.c. > The only exception is the last patch: it changes gitk and git-gui. > I'm missing the other t

Re: [PATCH v5 10/11] trace: add trace_performance facility to debug performance issues

2014-06-18 Thread Karsten Blees
Am 17.06.2014 19:11, schrieb Junio C Hamano: > Karsten Blees writes: > >> Simple use case (measure one code section): >> >> uint64_t start = getnanotime(); >> /* code section to measure */ >> trace_performance_since(start, "foobar"); >> &

Re: [PATCH v5 09/11] trace: add high resolution timer function to debug performance issues

2014-06-18 Thread Karsten Blees
Am 17.06.2014 18:44, schrieb Junio C Hamano: > Karsten Blees writes: > >> Am 11.06.2014 10:01, schrieb Karsten Blees: >>> the epoch allows using the results (div 10e9) with other time-related APIs. >> >> s/10e9/1e9/ > > That replacement is fine but the &q

Re: [PATCH v5 00/11] add performance tracing facility

2014-06-18 Thread Karsten Blees
Am 12.06.2014 20:30, schrieb Junio C Hamano: > Karsten Blees writes: > >> Here's v5 of the performance tracing patch series, now including a bunch of >> cleanups and adding timestamp, file and line to all trace output. >> >> I'm particularly interested in

[PATCH v6 01/11] trace: move trace declarations from cache.h to new trace.h

2014-06-20 Thread Karsten Blees
Also include direct dependencies (strbuf.h and git-compat-util.h for __attribute__) so that trace.h can be used independently of cache.h, e.g. in test programs. Signed-off-by: Karsten Blees Signed-off-by: Junio C Hamano --- cache.h | 13 ++--- trace.h | 17 + 2 files

[PATCH v6 00/11] add performance tracing facility

2014-06-20 Thread Karsten Blees
e_performance[_since]() return value and the respective usage example. Renamed trace_performance_vfl to trace_performance_vprintf_fl. The other patches are the versions from pu. Karsten Blees (11): trace: move trace declarations from cache.h to new trace.h trace: consiste

[PATCH v6 03/11] trace: remove redundant printf format attribute

2014-06-20 Thread Karsten Blees
trace_printf_key() is the only non-static function that duplicates the printf format attribute in the .c file, remove it for consistency. Signed-off-by: Karsten Blees Signed-off-by: Junio C Hamano --- trace.c | 1 - 1 file changed, 1 deletion(-) diff --git a/trace.c b/trace.c index 37a7fa9

[PATCH v6 02/11] trace: consistently name the format parameter

2014-06-20 Thread Karsten Blees
The format parameter to trace_printf functions is sometimes abbreviated 'fmt'. Rename to 'format' everywhere (consistent with POSIX' printf specification). Signed-off-by: Karsten Blees Signed-off-by: Junio C Hamano --- trace.c | 22 +++--- trace.h |

[PATCH v6 04/11] trace: factor out printing to the trace file

2014-06-20 Thread Karsten Blees
formatting. Signed-off-by: Karsten Blees Signed-off-by: Junio C Hamano --- trace.c | 37 +++-- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/trace.c b/trace.c index 3e31558..b7ca51b 100644 --- a/trace.c +++ b/trace.c @@ -62,6 +62,21 @@ static int

[PATCH v6 06/11] trace: add current timestamp to all trace output

2014-06-20 Thread Karsten Blees
processes are involved). Signed-off-by: Karsten Blees Signed-off-by: Junio C Hamano --- trace.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/trace.c b/trace.c index 9fa406e..9fa6cc7 100644 --- a/trace.c +++ b/trace.c @@ -81,6 +81,10 @@ static int trace_bare = -1

[PATCH v6 05/11] trace: add infrastructure to augment trace output with additional info

2014-06-20 Thread Karsten Blees
al file IO). While we're at it, rename trace_strbuf's 'buf' argument, which suggests that the function is modifying the buffer. Trace_strbuf() currently is the only trace API that can print arbitrary binary data (without barfing on '%' or stopping at '\0'), so 

[PATCH v6 07/11] trace: move code around, in preparation to file:line output

2014-06-20 Thread Karsten Blees
No functional changes, just move stuff around so that the next patch isn't that ugly... Signed-off-by: Karsten Blees Signed-off-by: Junio C Hamano --- trace.c | 36 ++-- trace.h | 12 2 files changed, 26 insertions(+), 22 deletions(-) diff --

[PATCH v6 08/11] trace: add 'file:line' to all trace output

2014-06-20 Thread Karsten Blees
er (currently there are 30 *.c files of length 18 and just 11 of 19). Trace output from longer source files (e.g. builtin/receive-pack.c) will not be aligned. Signed-off-by: Karsten Blees --- git-compat-util.h | 4 trace.c | 72 +

[PATCH v6 09/11] trace: add high resolution timer function to debug performance issues

2014-06-20 Thread Karsten Blees
h_absolute_time + mach_timebase_info Signed-off-by: Karsten Blees Signed-off-by: Junio C Hamano --- Makefile | 7 + config.mak.uname | 1 + trace.c | 82 trace.h | 1 + 4 files changed, 91 insertions(+) diff --g

[PATCH v6 10/11] trace: add trace_performance facility to debug performance issues

2014-06-20 Thread Karsten Blees
/* ignore */ } trace_performance(t, "frotz"); Signed-off-by: Karsten Blees --- trace.c | 47 +++ trace.h | 18 ++ 2 files changed, 65 insertions(+) diff --git a/trace.c b/trace.c index 88e05b9..65cd887 100644 --- a/trace.c +++ b/trace.c @@ -1

[PATCH v6 11/11] git: add performance tracing for git's main() function to debug scripts

2014-06-20 Thread Karsten Blees
7 s: git command: 'git' 'config' '--get-color' 'color.interactive.help' 'red bold' 23:57:38.650465 trace.c:405 performance: 0.000243063 s: git command: 'git' 'config' '--get-color' '' 'reset' 23:57:38.654

Re: [PATCH v6 05/11] trace: add infrastructure to augment trace output with additional info

2014-06-20 Thread Karsten Blees
Am 21.06.2014 00:33, schrieb Junio C Hamano: > Karsten Blees writes: > >> To be able to add a common prefix or suffix to all trace output (e.g. >> a timestamp or file:line of the caller), factor out common setup and >> cleanup tasks of the trace* functions. >> >&

Re: [PATCH v6 00/11] add performance tracing facility

2014-06-20 Thread Karsten Blees
Am 21.06.2014 00:49, schrieb Philip Oakley: > Should there be some documentation as well? Perhaps in t/README, or in > Documentation/howto. I'll add Documentation/technical/api-trace.txt when I find the time. But lets settle on the final API first. -- To unsubscribe from this list: send the line "

Git-status / preload_index() performance

2014-06-24 Thread Karsten Blees
Putting the new trace_performance functions to good use, here are a few observations about git-status performance. Comes with three patches (mostly independent, not a patch series!): * [PATCH] preload-index: optimize for sequential IO Improves preload-index performance, should apply anywhere

[PATCH] preload-index: optimize for sequential IO

2014-06-24 Thread Karsten Blees
by path, this implicitly increases IO locality. This improves cold cache performance of preload_index() by ~20% and hot cache performance by ~15%. Total improvement of e.g. 'git status -uno' on WebKit is ~15% (cold cache) and ~5% (hot cache). Signed-off-by: Karsten Blees --- preload-in

[PATCH (experimental)] preload-index: make parallel IO configurable

2014-06-24 Thread Karsten Blees
IO). Signed-off-by: Karsten Blees --- Applies on top of "preload-index: optimize for sequential IO". preload-index.c | 22 +- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/preload-index.c b/preload-index.c index 6ac368d..5fe5521 100644 --- a/prelo

[PATCH (performance tracing)] test git-status performance

2014-06-24 Thread Karsten Blees
Add trace_performance output to functions involved in git-status. Signed-off-by: Karsten Blees --- Applies on top of performance-tracing topic. builtin/commit.c | 8 preload-index.c | 4 read-cache.c | 2 ++ wt-status.c | 11 +++ 4 files changed, 25

  1   2   3   4   >