[PATCH 2/3] mingw: replace MSVCRT's fstat() with a Win32-based implementation

2018-10-23 Thread Karsten Blees via GitGitGadget
From: Karsten Blees fstat() is the only stat-related CRT function for which we don't have a full replacement yet (and thus the only reason to stick with MSVCRT's 'struct stat' definition). Fully implement fstat(), in preparation of implementing a POSIX 2013 compatible 'struct stat

[PATCH 3/3] mingw: implement nanosecond-precision file times

2018-10-23 Thread Karsten Blees via GitGitGadget
From: Karsten Blees We no longer use any of MSVCRT's stat-functions, so there's no need to stick to a CRT-compatible 'struct stat' either. Define and use our own POSIX-2013-compatible 'struct stat' with nanosecond- precision file times. Note: This can cause performance issues when using Git

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: [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, ); > while ((entry = hashmap_iter_next())) > // do something with entry > The hashmap_iter_first() function allows you

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 <karsten.bl...@gmail.com> writes: > >> Problem 1: Failure to detect racy files (without USE_NSEC) >> == >> >> Git may not detect racy changes

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

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

2015-09-28 Thread Karsten Blees
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 <bl...@dcon.de> --- read-cache.

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

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 klorin...@gmail.com 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

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

2015-07-01 Thread Karsten Blees
for path names. Update the documentation in i18n.txt to reflect the current status-quo. Signed-off-by: Karsten Blees bl...@dcon.de --- Sorry for the delay, got swamped with other stuff... Am 17.06.2015 um 22:45 schrieb Junio C Hamano: ... I am OK to describe pathnames are mangled into UTF-8 NFC

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

2015-07-01 Thread Karsten Blees
Signed-off-by: Karsten Blees bl...@dcon.de --- ...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] 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 bl...@dcon.de --- See https://github.com/git-for-windows/git/issues/226 Strangely, renaming to an open file works

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 karsten.bl...@gmail.com 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 @@ -At the core level, Git

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

2015-06-13 Thread Karsten Blees
for path names. Update the documentation in i18n.txt to reflect the current status-quo. Signed-off-by: Karsten Blees bl...@dcon.de --- Documentation/i18n.txt | 30 -- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/Documentation/i18n.txt b/Documentation

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

2015-06-13 Thread Karsten Blees
estimate. Signed-off-by: Karsten Blees bl...@dcon.de --- 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 +++ b/git-gui/lib

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

2015-06-13 Thread Karsten Blees
Signed-off-by: Karsten Blees bl...@dcon.de --- 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

Re: [PATCH] git-new-workdir: add windows compatibility

2015-05-26 Thread Karsten Blees
Am 26.05.2015 um 06:03 schrieb Junio C Hamano: Daniel Smith dansmit...@gmail.com writes: When running on Windows in MinGW, creating symbolic links via ln always failed. Using mklink instead of ln is the recommended method of creating links on Windows:

Re: [PATCH v2 0/4] UTF8 BOM follow-up

2015-04-17 Thread Karsten Blees
Am 16.04.2015 um 20:39 schrieb Junio C Hamano: This is on top of the .gitignore can start with UTF8 BOM patch from Carlos. Second try; the first patch is new to clarify the logic in the codeflow after Carlos's patch, and the second one has been adjusted accordingly. Junio C Hamano (4):

Re: [PATCH 0/3] Win32: nanosecond-precision file times

2015-02-17 Thread Karsten Blees
Am 16.02.2015 um 23:10 schrieb Junio C Hamano: Karsten Blees karsten.bl...@gmail.com writes: However, the Makefile has this to say on the subject: # Define USE_NSEC below if you want git to care about sub-second file mtimes # and ctimes. Note that you need recent glibc (at least 2.2.4

Re: [PATCH 0/3] Win32: nanosecond-precision file times

2015-02-16 Thread Karsten Blees
Am 13.02.2015 um 20:28 schrieb Junio C Hamano: Karsten Blees karsten.bl...@gmail.com writes: Am 13.02.2015 um 00:38 schrieb Junio C Hamano: We do have sec/nsec fields in cache_time structure, so I have nothing against updating the msysGit port to fill that value. Having said that, we do

Re: [PATCH 0/3] Win32: nanosecond-precision file times

2015-02-12 Thread Karsten Blees
Am 12.02.2015 um 20:48 schrieb Junio C Hamano: Karsten Blees karsten.bl...@gmail.com writes: However, some users have expressed concerns that 'same size and mtime' [2] may theoretically happen by chance in daily operation. Hmph. Haven't we already accepted that it is not just may

Re: [PATCH 3/3] Win32: implement nanosecond-precision file times

2015-02-12 Thread Karsten Blees
Am 13.02.2015 um 00:15 schrieb Thomas Braun: Am 12.02.2015 um 00:53 schrieb Karsten Blees: diff --git a/config.mak.uname b/config.mak.uname index b64b63c..a18a4cc 100644 --- a/config.mak.uname +++ b/config.mak.uname @@ -346,7 +346,7 @@ ifeq ($(uname_S),Windows) NO_SVN_TESTS = YesPlease

Re: [PATCH 0/3] Win32: nanosecond-precision file times

2015-02-12 Thread Karsten Blees
Am 13.02.2015 um 00:38 schrieb Junio C Hamano: Karsten Blees karsten.bl...@gmail.com writes: This is more about copying 'old' things around, which usually also copies mtime on Windows. E.g.: # create two files with slightly different mtime for i in {1..10}; do (echo v1 test); done

[PATCH 3/3] Win32: implement nanosecond-precision file times

2015-02-11 Thread Karsten Blees
We no longer use any of MSVCRT's stat-functions, so there's no need to stick to a CRT-compatible 'struct stat' either. Define and use our own POSIX-2013-compatible 'struct stat' with nanosecond- precision file times. Signed-off-by: Karsten Blees bl...@dcon.de --- compat/mingw.c | 12

[PATCH 2/3] Win32: replace MSVCRT's fstat() with a Win32-based implementation

2015-02-11 Thread Karsten Blees
times. Signed-off-by: Karsten Blees bl...@dcon.de --- compat/mingw.c | 28 +++- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/compat/mingw.c b/compat/mingw.c index ba3cfb0..6d73a3d 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -532,28 +532,38 @@ int

[PATCH 1/3] Win32: make FILETIME conversion functions public

2015-02-11 Thread Karsten Blees
Signed-off-by: Karsten Blees bl...@dcon.de --- compat/mingw.c | 16 compat/mingw.h | 16 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/compat/mingw.c b/compat/mingw.c index 70f3191..ba3cfb0 100644 --- a/compat/mingw.c +++ b/compat/mingw.c

[PATCH 0/3] Win32: nanosecond-precision file times

2015-02-11 Thread Karsten Blees
to make this practically impossible, at least on NTFS with 100ns file time resolution. Cheers, Karsten [1] https://github.com/msysgit/git/issues/312 [2] Note that st_ctime of a file never changes on Windows, as it means 'creation time' rather than 'change status time'. Karsten Blees (3

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 sor...@maxsi.org This function will be used in a following commit. The timer_settime function is provided in librt

Re: Location of git config on Windows

2014-08-17 Thread Karsten Blees
Am 18.08.2014 00:01, schrieb Erik Faye-Lund: On Sun, Aug 17, 2014 at 10:18 PM, Daniel Corbe co...@corbe.net wrote: I installed git on my Windows machine while it was connected to my corporate network. It picked up on that fact and used a mapped drive to store its configuration file. As a

Re: Git for Windows 1.9.4.msysgit.1

2014-08-15 Thread Karsten Blees
Am 15.08.2014 19:14, schrieb Thomas Braun: Hi, the Git for Windows team just released the second maintenance release of the Windows-specific installers for git 1.9.4. Thank you so much! Regressions git svn is/might be broken. Fixes welcome. rebase -b 0x6400

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

2014-08-06 Thread Karsten Blees
if 'git gc --auto' would also do an automatic gc, i.e.: - calculate the threshold from the gc.auto setting (default 6700, disabled if = 0) - check directory .git/objects/17 We still check four directories (14-17) if gc.auto is very small, to get a better estimate. Signed-off-by: Karsten Blees bl

Re: [PATCH] pack-bitmap: do not use gcc packed attribute

2014-08-06 Thread Karsten Blees
Am 05.08.2014 20:47, schrieb Jeff King: On Mon, Aug 04, 2014 at 09:19:46PM +0200, Karsten Blees wrote: Hmm, I wonder if it wouldn't be simpler to read / write the desired on-disk structure directly, without copying to a uchar[6] first. Probably. My initial attempt was to keep together

Re: [PATCH] pack-bitmap: do not use gcc packed attribute

2014-08-04 Thread Karsten Blees
a sketch, commit message is lacky and the helper functions deserve a better place / name): 8- Subject: [PATCH] pack-bitmap: do not use packed structs to read / write bitmap files Signed-off-by: Karsten Blees bl...@dcon.de --- pack-bitmap-write.c | 18 +- pack-bitmap.c

Re: struct hashmap_entry packing

2014-08-04 Thread Karsten Blees
Am 02.08.2014 00:37, schrieb Jeff King: On Tue, Jul 29, 2014 at 10:40:12PM +0200, Karsten Blees wrote: The sizeof() has to be the same regardless of whether the hashmap_entry is standalone or in another struct, and therefore must be padded up to 16 bytes. If we stored x in that padding

[RFC/PATCH] Windows tests: let $TRASH_DIRECTORY point to native Windows path

2014-07-29 Thread Karsten Blees
everything before ':' as hostname, not as drive letter. Change respective tests to use stdin / stdout instead of '-f'. Also use $TAR from GIT-BUILD-OPTIONS rather than hardcoded tar. Signed-off-by: Karsten Blees bl...@dcon.de --- Am 25.07.2014 14:30, schrieb Duy Nguyen: On Wed, Jul 23, 2014 at 9:17 PM

Re: error: Tweaking file descriptors doesn't work with this MSVCRT.dll on wine

2014-07-29 Thread Karsten Blees
Am 28.07.2014 12:39, schrieb Duy Nguyen: I know wine is kind of second citizen but is there a cheap trick to make it work on wine? Reverting fcd428f (Win32: fix broken pipe detection - 2012-03-01) could result in conflicts in compat that I'm not comfortable resolving. I don't have Windows at

Re: struct hashmap_entry packing

2014-07-29 Thread Karsten Blees
Am 28.07.2014 19:17, schrieb Jeff King: Hi Karsten, The hashmap_entry documentation claims: `struct hashmap_entry`:: An opaque structure representing an entry in the hash table, which must be used as first member of user data structures. Ideally it should be

Re: Bug in get_pwd_cwd() in Windows?

2014-07-23 Thread Karsten Blees
Am 23.07.2014 13:53, schrieb Duy Nguyen: On Wed, Jul 23, 2014 at 2:35 AM, René Scharfe l@web.de wrote: Am 21.07.2014 16:13, schrieb Duy Nguyen: This function tests if $PWD is the same as getcwd() using st_dev and st_ino. But on Windows these fields are always zero (mingw.c:do_lstat). If

Re: What's cooking in git.git (Jul 2014, #04; Tue, 22)

2014-07-23 Thread Karsten Blees
Am 22.07.2014 23:44, schrieb Junio C Hamano: * sk/mingw-uni-fix-more (2014-07-21) 14 commits - Win32: enable color output in Windows cmd.exe - Win32: patch Windows environment on startup - Win32: keep the environment sorted - Win32: use low-level memory allocation during initialization

[PATCH] fixup! Win32: Unicode environment (outgoing)

2014-07-19 Thread Karsten Blees
compat/mingw.c needs to #include cache.h for ALLOC_GROW. Signed-off-by: Karsten Blees bl...@dcon.de --- compat/mingw.c | 1 + 1 file changed, 1 insertion(+) diff --git a/compat/mingw.c b/compat/mingw.c index bd45950..c725a3e 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -4,6 +4,7

[PATCH] t0110/MinGW: skip tests that pass arbitrary bytes on the command line

2014-07-19 Thread Karsten Blees
On Windows, the command line is a Unicode string, it is not possible to pass arbitrary bytes to a program. Disable tests that try to do so. Signed-off-by: Karsten Blees bl...@dcon.de --- t/t0110-urlmatch-normalization.sh | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git

Re: [PATCH] abspath.c: use PATH_MAX in real_path_internal()

2014-07-19 Thread Karsten Blees
Am 18.07.2014 13:32, schrieb René Scharfe: Am 18.07.2014 01:03, schrieb Karsten Blees: Am 17.07.2014 19:05, schrieb René Scharfe: Am 17.07.2014 14:45, schrieb Nguyễn Thái Ngọc Duy: [...] These routines have traditionally been used by programs to save the name of a working directory

Re: [PATCH] abspath.c: use PATH_MAX in real_path_internal()

2014-07-19 Thread Karsten Blees
Am 18.07.2014 12:49, schrieb Duy Nguyen: can be used, else we fall back to chdir. I think there are only four places that follow this pattern, here, setup.c (.git discovery), git.c (restore_env) and unix-socket.c. Enough call sites to make it worth the effort? real_path(): here we actually

Re: [PATCH 2/2] config: use chmod() instead of fchmod()

2014-07-17 Thread Karsten Blees
Am 17.07.2014 00:16, schrieb Junio C Hamano: Karsten Blees karsten.bl...@gmail.com writes: There is no fchmod() on native Windows platforms (MinGW and MSVC), and the equivalent Win32 API (SetFileInformationByHandle) requires Windows Vista. Use chmod() instead. Signed-off-by: Karsten Blees

Re: [PATCH 00/13] mingw unicode environment

2014-07-17 Thread Karsten Blees
Am 17.07.2014 17:37, schrieb Stepan Kasal: Hello, this is the remainder of Karsten's unicode branch, that is a time proven part of msysGit. (If this code is accepted, only one patch would only remain: gitk and git-gui fixes.) Thank you so much! I had to add '#include ../cache.h' to

Re: [PATCH 2/6] Disable t0110's high-bit test on Windows

2014-07-17 Thread Karsten Blees
Am 17.07.2014 17:37, schrieb Stepan Kasal: From: Johannes Schindelin johannes.schinde...@gmx.de The bash Git for Windows uses (i.e. the MSys bash) cannot pass command-line arguments with high bits set verbatim to non-MSys programs, but instead converts those characters with high bits set to

Re: [PATCH 00/13] mingw unicode environment

2014-07-17 Thread Karsten Blees
Am 17.07.2014 21:00, schrieb Stepan Kasal: Hi, Karsten Blees karsten.bl...@gmail.com writes: I believe we prefer moving code to the right place over forward declarations (IIRC I got bashed for the latter in one of the first rounds of this patch series). If only to justify 'git-blame -M' :-D

Re: [PATCH 1/6] MinGW: Skip test redirecting to fd 4

2014-07-17 Thread Karsten Blees
Am 17.07.2014 20:41, schrieb Junio C Hamano: Stepan Kasal ka...@ucw.cz writes: From: Johannes Schindelin johannes.schinde...@gmx.de ... because that does not work in MinGW. Signed-off-by: Johannes Schindelin johannes.schinde...@gmx.de Signed-off-by: Stepan Kasal ka...@ucw.cz ---

Re: [PATCH] abspath.c: use PATH_MAX in real_path_internal()

2014-07-17 Thread Karsten Blees
Am 17.07.2014 14:45, schrieb Nguyễn Thái Ngọc Duy: e.g. git init. Make it static too to reduce stack usage. But wouldn't this increase overall memory usage? Stack memory will be reused by subsequent code, while static memory cannot be reused (but still increases the process working set). -- To

Re: [PATCH] abspath.c: use PATH_MAX in real_path_internal()

2014-07-17 Thread Karsten Blees
Am 17.07.2014 20:03, schrieb Junio C Hamano: Nguyễn Thái Ngọc Duy pclo...@gmail.com writes: This array 'cwd' is used to store the result from getcwd() and chdir() back. PATH_MAX is the right constant for the job. On systems with longer PATH_MAX (eg. 4096 on Linux), hard coding 1024 fails

Re: [PATCH] abspath.c: use PATH_MAX in real_path_internal()

2014-07-17 Thread Karsten Blees
Am 17.07.2014 19:05, schrieb René Scharfe: Am 17.07.2014 14:45, schrieb Nguyễn Thái Ngọc Duy: [...] These routines have traditionally been used by programs to save the name of a working directory for the purpose of returning to it. A much faster and less error-prone method of accomplishing

Re: [PATCH 2/2] config: use chmod() instead of fchmod()

2014-07-16 Thread Karsten Blees
Am 16.07.2014 07:33, schrieb Johannes Sixt: Am 16.07.2014 00:54, schrieb Karsten Blees: There is no fchmod() on native Windows platforms (MinGW and MSVC), and the equivalent Win32 API (SetFileInformationByHandle) requires Windows Vista. Use chmod() instead. Signed-off-by: Karsten Blees bl

Re: [PATCH v1 1/3] dir.c: coding style fix

2014-07-15 Thread Karsten Blees
Am 15.07.2014 00:30, schrieb Junio C Hamano: Karsten Blees karsten.bl...@gmail.com writes: From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= pclo...@gmail.com Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com Signed-off-by: Karsten Blees bl...@dcon.de --- Thanks

Re: [PATCH 0/3] fix test suite with mingw-unicode patches

2014-07-15 Thread Karsten Blees
remaining, please tell us. Thanks, Stepan Karsten Blees (2): Win32: Unicode file name support (except dirent) Win32: Unicode file name support (dirent) Pat Thoyts and Stepan Kasal(1): tests: do not pass iso8859-1 encoded parameter Thanks. I'll queue these and wait for Windows

[PATCH 1/2] MinGW: fix compile error due to missing ELOOP

2014-07-15 Thread Karsten Blees
MinGW and MSVC before 2010 don't define ELOOP, use EMLINK (aka Too many links) instead. Signed-off-by: Karsten Blees bl...@dcon.de --- compat/mingw.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compat/mingw.h b/compat/mingw.h index 405c08f..510530c 100644 --- a/compat/mingw.h +++ b

[PATCH 2/2] config: use chmod() instead of fchmod()

2014-07-15 Thread Karsten Blees
There is no fchmod() on native Windows platforms (MinGW and MSVC), and the equivalent Win32 API (SetFileInformationByHandle) requires Windows Vista. Use chmod() instead. Signed-off-by: Karsten Blees bl...@dcon.de --- config.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff

Re: [PATCH 1/2] MinGW: fix compile error due to missing ELOOP

2014-07-15 Thread Karsten Blees
Am 16.07.2014 01:42, schrieb Jonathan Nieder: Karsten Blees wrote: MinGW and MSVC before 2010 don't define ELOOP, use EMLINK (aka Too many links) instead. [...] +#ifndef ELOOP +#define ELOOP EMLINK +#endif This could use #define ELOOP WSAELOOP as an alternative

[PATCH v1 0/3] dir.[ch]: remove PATH_MAX limitation

2014-07-14 Thread Karsten Blees
As discussed in [1], here's the first three patches of Duy's untracked cache series, which fixes a segfault with long paths on Windows. [1] http://article.gmane.org/gmane.comp.version-control.msysgit/20702 Nguyễn Thái Ngọc Duy (3): dir.c: coding style fix dir.h: move struct exclude

[PATCH v1 1/3] dir.c: coding style fix

2014-07-14 Thread Karsten Blees
From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= pclo...@gmail.com Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com Signed-off-by: Karsten Blees bl...@dcon.de --- dir.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dir.c b/dir.c index

[PATCH v1 2/3] dir.h: move struct exclude declaration to top level

2014-07-14 Thread Karsten Blees
From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= pclo...@gmail.com There is no actual nested struct here. Move it out for clarity. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com Signed-off-by: Karsten Blees bl...@dcon.de --- dir.h | 42

[PATCH v1 3/3] prep_exclude: remove the artificial PATH_MAX limit

2014-07-14 Thread Karsten Blees
add_excludes_from_file() will report if it gets ENAMETOOLONG. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com Signed-off-by: Karsten Blees bl...@dcon.de --- dir.c | 47 --- dir.h | 2 +- 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/dir.c b/dir.c

Re: No fchmod() under msygit - Was: Re: [PATCH 00/14] Add submodule test harness

2014-07-14 Thread Karsten Blees
Am 09.07.2014 22:00, schrieb Eric Wong: Torsten Bögershausen tbo...@web.de wrote: (And why is it 0 and not 0777) This is to preserve the uncommon sticky/sgid/suid bits. Probably not needed, but better to keep as much intact as possible. Can we avoid the fchmod() all together ?

Re: [PATCH 2/2] dir: remove PATH_MAX limitation

2014-07-11 Thread Karsten Blees
Am 05.07.2014 12:48, schrieb Duy Nguyen: On Sat, Jul 5, 2014 at 5:42 AM, Karsten Blees karsten.bl...@gmail.com wrote: 'git status' segfaults if a directory is longer than PATH_MAX, because processing .gitignore files in prep_exclude() writes past the end of a PATH_MAX-bounded buffer. Remove

Re: [PATCH 1/2] symlinks: remove PATH_MAX limitation

2014-07-11 Thread Karsten Blees
Am 07.07.2014 20:30, schrieb Junio C Hamano: Karsten Blees karsten.bl...@gmail.com writes: The above cache_def_free(cache) does not free the cache itself, but only its associated data, so the name cache_def_free() is somewhat misleading. You already merged this to master (kb/path-max-must

Re: [PATCH v1 3/4] hashmap: add simplified hashmap_get_from_hash() API

2014-07-11 Thread Karsten Blees
Am 07.07.2014 19:43, schrieb Junio C Hamano: Karsten Blees karsten.bl...@gmail.com writes: Hashmap entries are typically looked up by just a key. The hashmap_get() API expects an initialized entry structure instead, to support compound keys. This flexibility is currently only needed

Re: [PATCH 2/2] dir: remove PATH_MAX limitation

2014-07-11 Thread Karsten Blees
Am 09.07.2014 18:33, schrieb Junio C Hamano: Karsten Blees karsten.bl...@gmail.com writes: 'git status' segfaults if a directory is longer than PATH_MAX, because processing .gitignore files in prep_exclude() writes past the end of a PATH_MAX-bounded buffer. Remove the limitation by using

Re: Topic sk/mingw-unicode-spawn-args breaks tests

2014-07-11 Thread Karsten Blees
Am 10.07.2014 22:05, schrieb Johannes Sixt: It looks like I totally missed the topic sk/mingw-unicode-spawn-args. Now it's in master, and it breaks lots of test cases for me: t0050-filesystem t0110-urlmatch-normalization t4014-format-patch t4041-diff-submodule-option t4120-apply-popt

Re: [PATCH 2/2] dir: remove PATH_MAX limitation

2014-07-11 Thread Karsten Blees
Am 12.07.2014 00:29, schrieb Junio C Hamano: Karsten Blees karsten.bl...@gmail.com writes: Anyways, I'd like to kindly withdraw this patch in favor of Duy's version. http://article.gmane.org/gmane.comp.version-control.git/248310 Thanks; I've already reverted it from 'next'. Is Duy's

[PATCH v8 00/17] add performance tracing facility

2014-07-11 Thread Karsten Blees
Changes since v7: [04]: Fixed -Wextra compiler warnings, thanks to Ramsay Jones. [11]: Added #ifndef TRACE_CONTEXT, explained why __FILE__ : __FUNCTION__ doesn't work. [17]: New Documentation/technical/api-trace.txt Karsten Blees (17): trace: move trace declarations from cache.h to new

[PATCH v8 01/17] trace: move trace declarations from cache.h to new trace.h

2014-07-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 bl...@dcon.de Signed-off-by: Junio C Hamano gits...@pobox.com --- cache.h | 13 ++--- trace.h | 17

[PATCH v8 02/17] trace: consistently name the format parameter

2014-07-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 bl...@dcon.de Signed-off-by: Junio C Hamano gits...@pobox.com --- trace.c | 22 +++--- trace.h

[PATCH v8 03/17] trace: remove redundant printf format attribute

2014-07-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 bl...@dcon.de Signed-off-by: Junio C Hamano gits...@pobox.com --- trace.c | 1 - 1 file changed, 1 deletion(-) diff --git

[PATCH v8 04/17] trace: improve trace performance

2014-07-11 Thread Karsten Blees
trace_key' instead of a string constant. In trace.c::get_trace_fd(), save and reuse the file descriptor in 'struct trace_key'. Add a 'trace_disable()' API, so that packet_trace() can cleanly disable tracing when it encounters packed data (instead of using unsetenv()). Signed-off-by: Karsten Blees bl

[PATCH v8 11/17] trace: add 'file:line' to all trace output

2014-07-11 Thread Karsten Blees
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 bl...@dcon.de --- git-compat-util.h | 4 trace.c | 72 +-- trace.h

[PATCH 1/2] symlinks: remove PATH_MAX limitation

2014-07-04 Thread Karsten Blees
'git checkout' fails if a directory is longer than PATH_MAX, because the lstat_cache in symlinks.c checks if the leading directory exists using PATH_MAX-bounded string operations. Remove the limitation by using strbuf instead. Signed-off-by: Karsten Blees bl...@dcon.de --- This fixes a bug

[PATCH 2/2] dir: remove PATH_MAX limitation

2014-07-04 Thread Karsten Blees
. prep_exclude() can probably be simplified using more strbuf APIs. Signed-off-by: Karsten Blees bl...@dcon.de --- dir.c | 35 +++ dir.h | 4 ++-- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/dir.c b/dir.c index e65888d..8d4d83c 100644 --- a/dir.c +++ b

Re: [PATCH v7 11/16] trace: add 'file:line' to all trace output

2014-07-02 Thread Karsten Blees
Am 02.07.2014 20:57, schrieb Junio C Hamano: Karsten Blees karsten.bl...@gmail.com writes: +#else + +/* + * Macros to add file:line - see above for C-style declarations of how these + * should be used. + * + * TRACE_CONTEXT may be set to __FUNCTION__ if the compiler supports

[PATCH v1 0/4] hashmap improvements

2014-07-02 Thread Karsten Blees
Here are a few small hashmap improvements, partly resulting from recent discussion of the config-cache topic. Karsten Blees (4): hashmap: factor out getting an int hash code from a SHA1 hashmap: improve struct hashmap member documentation hashmap: add simplified hashmap_get_from_hash() API

[PATCH v1 1/4] hashmap: factor out getting an int hash code from a, SHA1

2014-07-02 Thread Karsten Blees
Copying the first bytes of a SHA1 is duplicated in six places, however, the implications (wrong byte order on little-endian systems) is documented only once. Add a properly documented API for this. Signed-off-by: Karsten Blees bl...@dcon.de --- Documentation/technical/api-hashmap.txt | 9

[PATCH v1 2/4] hashmap: improve struct hashmap member documentation

2014-07-02 Thread Karsten Blees
Signed-off-by: Karsten Blees bl...@dcon.de --- Documentation/technical/api-hashmap.txt | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Documentation/technical/api-hashmap.txt b/Documentation/technical/api-hashmap.txt index 4689968..dc21a7c 100644

[PATCH v1 4/4] hashmap: add string interning API

2014-07-02 Thread Karsten Blees
(), in case we ever encounter a platform where a call to getenv() invalidates previous getenv() results (which is allowed by POSIX). Signed-off-by: Karsten Blees bl...@dcon.de --- Documentation/technical/api-hashmap.txt | 15 + hashmap.c | 38

[PATCH v1 3/4] hashmap: add simplified hashmap_get_from_hash() API

2014-07-02 Thread Karsten Blees
by just specifying the key and its hash code, i.e.: return hashmap_get_from_hash(map, hash(key), key); Signed-off-by: Karsten Blees bl...@dcon.de --- Documentation/technical/api-hashmap.txt | 14 ++ builtin/describe.c | 4 +--- diffcore-rename.c

[PATCH v7 00/16] add performance tracing facility

2014-07-01 Thread Karsten Blees
conflicts. Karsten Blees (16): trace: move trace declarations from cache.h to new trace.h trace: consistently name the format parameter trace: remove redundant printf format attribute trace: improve trace performance Documentation/git.txt: improve documentation of 'GIT_TRACE*' variables

[PATCH v7 02/16] trace: consistently name the format parameter

2014-07-01 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 bl...@dcon.de Signed-off-by: Junio C Hamano gits...@pobox.com --- trace.c | 22 +++--- trace.h

[PATCH v7 01/16] trace: move trace declarations from cache.h to new trace.h

2014-07-01 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 bl...@dcon.de Signed-off-by: Junio C Hamano gits...@pobox.com --- cache.h | 13 ++--- trace.h | 17

[PATCH v7 03/16] trace: remove redundant printf format attribute

2014-07-01 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 bl...@dcon.de Signed-off-by: Junio C Hamano gits...@pobox.com --- trace.c | 1 - 1 file changed, 1 deletion(-) diff --git

[PATCH v7 04/16] trace: improve trace performance

2014-07-01 Thread Karsten Blees
trace_key' instead of a string constant. In trace.c::get_trace_fd(), save and reuse the file descriptor in 'struct trace_key'. Add a 'trace_disable()' API, so that packet_trace() can cleanly disable tracing when it encounters packed data (instead of using unsetenv()). Signed-off-by: Karsten Blees bl

[PATCH v7 05/16] Documentation/git.txt: improve documentation of 'GIT_TRACE*' variables

2014-07-01 Thread Karsten Blees
Separate GIT_TRACE description into what it prints and how to configure where trace output is printed to. Change other GIT_TRACE_* descriptions to refer to GIT_TRACE. Add descriptions for GIT_TRACE_SETUP and GIT_TRACE_SHALLOW. Signed-off-by: Karsten Blees bl...@dcon.de --- Documentation/git.txt

[PATCH v7 06/16] sha1_file: change GIT_TRACE_PACK_ACCESS logging to use trace API

2014-07-01 Thread Karsten Blees
This changes GIT_TRACE_PACK_ACCESS functionality as follows: * supports the same options as GIT_TRACE (e.g. printing to stderr) * no longer supports relative paths * appends to the trace file rather than overwriting Signed-off-by: Karsten Blees bl...@dcon.de --- Documentation/git.txt | 4

[PATCH v7 07/16] trace: add infrastructure to augment trace output with additional info

2014-07-01 Thread Karsten Blees
(without barfing on '%' or stopping at '\0'), so 'data' seems more appropriate. Signed-off-by: Karsten Blees bl...@dcon.de --- trace.c | 47 +-- trace.h | 2 +- 2 files changed, 34 insertions(+), 15 deletions(-) diff --git a/trace.c b/trace.c index

[PATCH v7 08/16] trace: disable additional trace output for unit tests

2014-07-01 Thread Karsten Blees
Some unit-tests use trace output to verify internal state, and unstable output such as timestamps and line numbers are not useful there. Disable additional trace output if GIT_TRACE_BARE is set. Signed-off-by: Karsten Blees bl...@dcon.de --- t/test-lib.sh | 4 trace.c | 6 ++ 2

[PATCH v7 09/16] trace: add current timestamp to all trace output

2014-07-01 Thread Karsten Blees
or processes are involved). Signed-off-by: Karsten Blees bl...@dcon.de --- trace.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/trace.c b/trace.c index a194b16..18e5d93 100644 --- a/trace.c +++ b/trace.c @@ -88,6 +88,9 @@ static const char err_msg[] = Could not trace

[PATCH v7 11/16] trace: add 'file:line' to all trace output

2014-07-01 Thread Karsten Blees
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 bl...@dcon.de --- git-compat-util.h | 4 trace.c | 72 +-- trace.h

[PATCH v7 10/16] trace: move code around, in preparation to file:line output

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

[PATCH v7 12/16] trace: add high resolution timer function to debug performance issues

2014-07-01 Thread Karsten Blees
+ mach_timebase_info Signed-off-by: Karsten Blees bl...@dcon.de Signed-off-by: Junio C Hamano gits...@pobox.com --- Makefile | 7 + config.mak.uname | 1 + trace.c | 82 trace.h | 1 + 4 files changed, 91 insertions

[PATCH v7 13/16] trace: add trace_performance facility to debug performance issues

2014-07-01 Thread Karsten Blees
(t, frotz); Signed-off-by: Karsten Blees bl...@dcon.de --- trace.c | 47 +++ trace.h | 18 ++ 2 files changed, 65 insertions(+) diff --git a/trace.c b/trace.c index b9d7272..af64dbb 100644 --- a/trace.c +++ b/trace.c @@ -169,6 +169,27

[PATCH v7 14/16] git: add performance tracing for git's main() function to debug scripts

2014-07-01 Thread Karsten Blees
s: git command: 'git' 'config' '--get-color' '' 'reset' 23:57:38.654850 trace.c:405 performance: 0.025126313 s: git command: 'git' 'stash' 'list' Signed-off-by: Karsten Blees bl...@dcon.de --- Documentation/git.txt | 5 + git.c | 2 ++ trace.c | 22

[PATCH v7 15/16] wt-status: simplify performance measurement by using getnanotime()

2014-07-01 Thread Karsten Blees
Calculating duration from a single uint64_t is simpler than from a struct timeval. Change performance measurement for 'advice.statusuoption' from gettimeofday() to getnanotime(). Also initialize t_begin to prevent uninitialized variable warning. Signed-off-by: Karsten Blees bl...@dcon.de --- wt

[PATCH v7 16/16] progress: simplify performance measurement by using getnanotime()

2014-07-01 Thread Karsten Blees
-by: Karsten Blees bl...@dcon.de --- progress.c | 71 +++--- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/progress.c b/progress.c index 261314e..412e6b1 100644 --- a/progress.c +++ b/progress.c @@ -12,13 +12,14 @@ #include

Re: [RFC/PATCH] notes-util.c: replace git_config with git_config_get_string

2014-06-30 Thread Karsten Blees
Am 29.06.2014 13:01, schrieb Eric Sunshine: On Thu, Jun 26, 2014 at 4:19 AM, Tanay Abhra tanay...@gmail.com wrote: On 6/25/2014 1:24 PM, Eric Sunshine wrote: On Mon, Jun 23, 2014 at 6:41 AM, Tanay Abhra tanay...@gmail.com wrote: Use git_config_get_string instead of git_config to take advantage

  1   2   3   4   >