Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: kb/devel
Commits on Jun 9, 2013
  1. Win32: add a cache below mingw's lstat and readdir implementations

    authored
    Checking the work tree status is quite slow on Windows, due to slow lstat
    emulation (git calls lstat once for each file in the index). Windows
    operating system APIs seem to be much better at scanning the status
    of entire directories than checking single files.
    
    Add an lstat implementation that uses a cache for lstat data. Cache misses
    read the entire parent directory and add it to the cache. Subsequent lstat
    calls for the same directory are served directly from the cache.
    
    Also implement opendir / readdir / closedir so that they create and use
    directory listings in the cache.
    
    The cache doesn't track file system changes and doesn't plug into any
    modifying file APIs, so it has to be explicitly enabled for git functions
    that don't modify the working copy. For a start, enable the cache for the
    entire 'git status' command and the core.preloadIndex feature.
    
    The cache can be disabled at runtime by setting environment variable
    GIT_NOFSCACHE, or at compile time by unsetting USE_FSCACHE in the Makefile.
    
    Note: in an earlier version of this patch, the cache was always active and
    tracked file system changes via ReadDirectoryChangesW. However, this was
    much more complex and had negative impact on the performance of modifying
    git commands such as 'git checkout'.
    
    Signed-off-by: Karsten Blees <blees@dcon.de>
  2. add a hashtable implementation that supports O(1) removal

    authored
    The existing hashtable implementation (in hash.[ch]) uses open addressing
    (i.e. resolve hash collisions by distributing entries across the table).
    Thus, removal is difficult to implement with less than O(n) complexity.
    Resolving collisions of entries with identical hashes (e.g. via chaining)
    is left to the client code.
    
    Add a hashtable implementation that supports O(1) removal and is slightly
    easier to use due to builtin entry chaining.
    
    Supports all basic operations init, free, get, put, remove and iteration.
    Also includes ready-to-use hash functions based on the public domain FNV-1
    algorithm (http://www.isthe.com/chongo/tech/comp/fnv).
    
    The per-entry data structure (hashmap_entry) is meant to be piggybacked
    onto the client's data structure to save memory. See test-hashmap.c for
    usage examples.
    
    The hashtable is resized by a factor of four when 80% full. With these
    settings, average memory consumption is about 2/3 of hash.[ch], and
    insertion is twice as fast (due to less frequent resizing).
    
    Signed-off-by: Karsten Blees <blees@dcon.de>
  3. Win32: fix segfault in WriteConsoleW when debugging in gdb

    authored
    On Windows XP (not Win7), WriteConsoleW and WriteFile seem to raise and
    catch SIGSEGV if the lpNumberOfCharsWritten parameter is NULL. This is not
    a problem when executed standalone, but gdb stops execution here (unless
    disabled via "handle SIGSEGV nostop").
    
    Fix it by passing a dummy variable.
    
    Signed-off-by: Karsten Blees <blees@dcon.de>
Commits on Jun 7, 2013
  1. Win32: add command performance tracing to debug scripted commands

    authored
    Especially scripted git commands are still quite slow on Windows. Add
    performance tracing to identify which commands are called by a script and
    how long they execute.
    
    Usage: > GIT_TRACE_PERFORMANCE=C:/git.log git svn rebase
    creates a log file like this:
    trace: at compat/mingw.c:2068, time: 0.001000 s: command: git.exe rev-parse --show-prefix
    trace: at compat/mingw.c:2068, time: 0.001219 s: command: git.exe config --bool --get svn.fetchall
    ...
    
    Signed-off-by: Karsten Blees <blees@dcon.de>
  2. Win32: add trace_performance facility to debug performance issues

    authored
    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 in environment variable GIT_TRACE_PERFORMANCE.
    
    Unless enabled via GIT_TRACE_PERFORMANCE, these macros have no noticeable
    impact on performance, so that test code may be shipped in release builds.
    
    MSVC: variadic macros (__VA_ARGS__) require VC++ 2005 or newer.
    
    Simple use case (measure one code section):
    doube start = ticks();
    /* measure this */
    trace_performance_since(start, "foobar");
    
    Medium use case (measure consecutive code sections):
    doube start = ticks();
    /* measure this */
    start = trace_performance_since(start, "foobar1");
    /* measure this */
    trace_performance_since(start, "foobar2");
    
    Complex use case (measure several code sections):
    double t = 0;
    for (;;) {
      /* ignore */
      t -= ticks();
      /* measure this */
      t += ticks();
      /* ignore */
    }
    trace_performance(t, "frotz");
    
    Signed-off-by: Karsten Blees <blees@dcon.de>
  3. Win32: add high resolution timer function to debug performance issues

    authored
    Add a high resolution timer function as basis for performance debugging.
    
    Simple use case (measure one code section):
    doube start = ticks();
    /* measure this */
    fprintf(stderr, "time: %g s\n", (ticks() - start));
    
    Complex use case (measure several code sections):
    double t = 0;
    for (;;) {
      /* ignore */
      t -= ticks();
      /* measure this */
      t += ticks();
      /* ignore */
    }
    fprintf(stderr, "time: %g s\n", t);
    
    Signed-off-by: Karsten Blees <blees@dcon.de>
Commits on Jun 1, 2013
  1. Pat Thoyts

    t4210: skip command-line encoding tests on mingw

    patthoyts authored
    On Windows the application command line is provided as unicode and in
    mingw-git we convert that to utf-8. So these tests that require a iso-8859-1
    input are being subverted by the encoding transformations we perform and
    should be skipped.
    
    Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Commits on May 31, 2013
  1. Pat Thoyts

    t7800: a few tests should ignore crlf in checking the result.

    patthoyts authored
    Those tests that generate files using echo can expect crlf issues when run
    under windows. For such cases we use 'test_cmp_text'.
    
    Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Commits on May 30, 2013
  1. Pat Thoyts

    dir.c: fix ignore processing within not-ignored directories

    Karsten Blees authored patthoyts committed
    As of 95c6f27 "dir.c: unify is_excluded and is_path_excluded APIs", the
    is_excluded API no longer recurses into directories that match an ignore
    pattern, and returns the directory's ignored state for all contained paths.
    
    This is OK for normal ignore patterns, i.e. ignoring a directory affects
    the entire contents recursively.
    
    Unfortunately, this also "works" for negated ignore patterns ('!dir'), i.e.
    the entire contents is "not-ignored" recursively, regardless of ignore
    patterns that match the contents directly.
    
    In prep_exclude, skip recursing into a directory only if it is really
    ignored (i.e. the ignore pattern is not negated).
    
    Signed-off-by: Karsten Blees <blees@dcon.de>
    Tested-by: Øystein Walle
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. Pat Thoyts

    t0008: avoid absolute path on Windows as colon is used in the tests

    patthoyts authored
    The test separator char is a colon which means any absolute paths on windows
    confuse the tests that use global_excludes.
    
    Suggested-by: Karsten Blees <karsten.blees@gmail.com>
    Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Commits on May 29, 2013
  1. dscho Pat Thoyts

    Fix t3404 for Windows

    dscho authored patthoyts committed
    The usual problem: CR/LF...
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  2. Prof Gra Pat Thoyts

    French translation: copy -> copie.

    Grahack authored patthoyts committed
  3. Pat Thoyts

    wincred: add install target and avoid overwriting configured variables.

    patthoyts authored
    Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
  4. Pat Thoyts

    t1306: perform file comparisons using text mode for Windows support

    patthoyts authored
    Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
  5. dscho Pat Thoyts

    git stash: make sure that .git/logs/refs/ exists

    dscho authored patthoyts committed
    If the user has not activated reflogs, or if nothing has been recorded
    yet (as is the case directly after cloning), said directory may not
    exist yet.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  6. Sebastian Schuberth Pat Thoyts

    gitk: Use an external icon file on Windows

    sschuberth authored patthoyts committed
    Git for Windows now ships with the new Git icon from git-scm.com. Use that
    icon file if it exists instead of the old procedurally drawn one.
    
    This patch was sent upstream but so far no decision on its inclusion was
    made, so commit it to our fork.
    
    Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
  7. Pat Thoyts

    help: correct behavior for is_executable on Windows

    Heiko Voigt authored patthoyts committed
    The previous implementation said that the filesystem information on
    Windows is not reliable to determine whether a file is executable.
    To find gather this information it was peeking into the first two bytes
    of a file to see whether it looks executable.
    Apart from the fact that on Windows executables are usually defined as
    such by their extension it lead to slow opening of help file in some
    situations.
    
    When you have virus scanner running calling open on an executable file
    is a potentially expensive operation. See the following measurements (in
    seconds) for example.
    
    With virus scanner running (coldcache):
    
    $ ./a.exe /libexec/git-core/
    before open (git-add.exe): 0.000000
    after open (git-add.exe): 0.412873
    before open (git-annotate.exe): 0.000175
    after open (git-annotate.exe): 0.397925
    before open (git-apply.exe): 0.000243
    after open (git-apply.exe): 0.399996
    before open (git-archive.exe): 0.000147
    after open (git-archive.exe): 0.397783
    before open (git-bisect--helper.exe): 0.000160
    after open (git-bisect--helper.exe): 0.397700
    before open (git-blame.exe): 0.000160
    after open (git-blame.exe): 0.399136
    ...
    
    With virus scanner running (hotcache):
    
    $ ./a.exe /libexec/git-core/
    before open (git-add.exe): 0.000000
    after open (git-add.exe): 0.000325
    before open (git-annotate.exe): 0.000229
    after open (git-annotate.exe): 0.000177
    before open (git-apply.exe): 0.000167
    after open (git-apply.exe): 0.000150
    before open (git-archive.exe): 0.000154
    after open (git-archive.exe): 0.000156
    before open (git-bisect--helper.exe): 0.000132
    after open (git-bisect--helper.exe): 0.000180
    before open (git-blame.exe): 0.000718
    after open (git-blame.exe): 0.000724
    ...
    
    This test did just list the given directory and open() each file in it.
    
    With this patch I get:
    
    $ time git help git
    Launching default browser to display HTML ...
    
    real    0m8.723s
    user    0m0.000s
    sys     0m0.000s
    
    and without
    
    $ time git help git
    Launching default browser to display HTML ...
    
    real    1m37.734s
    user    0m0.000s
    sys     0m0.031s
    
    both tests with cold cache and giving the machine some time to settle
    down after restart.
    
    Signed-off-by: Heiko Voigt <heiko.voigt@mahr.de>
  8. Pat Thoyts

    Set the default help format to html for msys builds.

    patthoyts authored
    This resolves issue #19 by setting the compiled default to html in msys
    builds following the changes introduced by commit
    1cc8af0 "help: use HTML as the default help format on Windows"
    
    Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
  9. Adam Roben Pat Thoyts

    Make non-.exe externals work again

    aroben authored patthoyts committed
    7ebac8c made launching of .exe
    externals work when installed in Unicode paths. But it broke launching
    of non-.exe externals, no matter where they were installed. We now
    correctly maintain the UTF-8 and UTF-16 paths in tandem in lookup_prog.
    
    This fixes t5526, among others.
    
    Signed-off-by: Adam Roben <adam@roben.org>
  10. Pat Thoyts

    Ensure the resource file is rebuilt when the version changes.

    patthoyts authored
    Acked-by: Erik Faye-Lund <kusmabite@gmail.com>
    Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
  11. dscho Pat Thoyts

    Windows resource: handle dashes in the Git version gracefully

    dscho authored patthoyts committed
    Reported by postiffm as issue #14.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  12. Pat Thoyts

    Provide a Windows version resource for the git executables.

    patthoyts authored
    Embeds the git version and description into the git executable thus
    implementing the request in issue #5.
    
    Acked-by: Heiko Voigt <hvoigt@hvoigt.net>
    Acked-by: Sebastian Schuberth <sschuberth@gmail.com>
    Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
  13. theoleblond Pat Thoyts

    Sleep 1 millisecond in poll() to avoid busy wait

    theoleblond authored patthoyts committed
    I played around with this quite a bit. After trying some more complex
    schemes, I found that what worked best is to just sleep 1 millisecond
    between iterations. Though it's a very short time, it still completely
    eliminates the busy wait condition, without hurting perf.
    
    There code uses SleepEx(1, TRUE) to sleep. See this page for a good
    discussion of why that is better than calling SwitchToThread, which
    is what was used previously:
    http://stackoverflow.com/questions/1383943/switchtothread-vs-sleep1
    
    Note that calling SleepEx(0, TRUE) does *not* solve the busy wait.
    
    The most striking case was when testing on a UNC share with a large repo,
    on a single CPU machine. Without the fix, it took 4 minutes 15 seconds,
    and with the fix it took just 1:08! I think it's because git-upload-pack's
    busy wait was eating the CPU away from the git process that's doing the
    real work. With multi-proc, the timing is not much different, but tons of
    CPU time is still wasted, which can be a killer on a server that needs to
    do bunch of other things.
    
    I also tested the very fast local case, and didn't see any measurable
    difference. On a big repo with 4500 files, the upload-pack took about 2
    seconds with and without the fix.
  14. dscho Pat Thoyts

    Work around a problem identified by BuildHive

    dscho authored patthoyts committed
    Apparently the signal handling is not quite correct in the fsckobject
    handling (most likely we rely on a side effect that lets us still output
    some message after receiving a signal 13 but in the BuildHive setup this
    fails intermittently).
    
    As a consequence, the push in t5504 does fail as expected, but fails to
    output anything (unexpected). Since this is good enough for now, let's
    handle an empty output as success, too.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  15. dscho Pat Thoyts

    t1050: Fix invalid call to dd(1)

    dscho authored patthoyts committed
    This is a companion patch to fce52b4(t4012: Fix invalid call to dd(1)).
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  16. dscho Pat Thoyts

    Always auto-gc after calling a fast-import transport

    dscho authored patthoyts committed
    After importing anything with fast-import, we should always let the
    garbage collector do its job, since the objects are written to disk
    inefficiently.
    
    This brings down an initial import of http://selenic.com/hg from about
    230 megabytes to about 14.
    
    In the future, we may want to make this configurable on a per-remote
    basis, or maybe teach fast-import about it in the first place.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  17. Sverre Rabbelier Pat Thoyts

    remote-helper: check helper status after import/export

    SRabbelier authored patthoyts committed
    Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
    Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
  18. Sverre Rabbelier Pat Thoyts

    transport-helper: add trailing --

    SRabbelier authored patthoyts committed
    [PT: ensure we add an additional element to the argv array]
  19. Sverre Rabbelier Pat Thoyts

    t5800: point out that deleting branches does not work

    SRabbelier authored patthoyts committed
    This test actually breaks the repositories involved somehow, so it is
    not enabled by default.
  20. Sverre Rabbelier Pat Thoyts

    t5800: test pushing a new branch with old content

    SRabbelier authored patthoyts committed
    This works now that fast-export has been fixed to properly handle
    refs that point to a commit that was not exported during the current
    fast-export run.
  21. dscho Pat Thoyts

    setup_revisions: remember whether a ref was positive or not

    dscho authored patthoyts committed
    This will be required by fast-export, when no commits were
    exported, but the refs should be set, of course.
    
    Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
    Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
  22. dscho Pat Thoyts

    fast-export: do not refer to non-existing marks

    dscho authored patthoyts committed
    When calling `git fast-export a..a b` when a and b refer to the same
    commit, nothing would be exported, and an incorrect reset line would
    be printed for b ('from :0').
    
    Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
    Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
  23. Erik Faye-Lund Pat Thoyts

    MSVC: fix poll-related macro redefines

    kusma authored patthoyts committed
    This seems to be related to the poll-emulation... I see that these things
    are guarded by an "#if(_WIN32_WINNT >= 0x0600)" in <winsock2.h>, which
    means it's supported for Windows Vista and above... We still support
    Windows XP, so it seems someone has set this too high :)
    
    I'd prefer to set this from the Makefile, but this generates a warning in
    compat/win32/poll.c about redefining a macro (poll.c wants it to be 0x502,
    which is Windows XP with SP2, rather than 0x501 which is normal Windows
    XP).
    
    [PT: amended to follow 41f2999 "msvc: Fix compilation errors caused by
         poll.h emulation" and support both MSVC and mingw]
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Something went wrong with that request. Please try again.