1. 06 2月, 2019 1 次提交
  2. 04 1月, 2019 1 次提交
  3. 27 12月, 2018 1 次提交
    • T
      git clone <url> C:\cygwin\home\USER\repo' is working (again) · 1cadad6f
      Torsten Bögershausen 提交于
      A regression for cygwin users was introduced with commit 05b458c1,
       "real_path: resolve symlinks by hand".
      
      In the the commit message we read:
        The current implementation of real_path uses chdir() in order to resolve
          symlinks.  Unfortunately this isn't thread-safe as chdir() affects a
            process as a whole...
      
      The old (and non-thread-save) OS calls chdir()/pwd() had been
      replaced by a string operation.
      The cygwin layer "knows" that "C:\cygwin" is an absolute path,
      but the new string operation does not.
      
      "git clone <url> C:\cygwin\home\USER\repo" fails like this:
      fatal: Invalid path '/home/USER/repo/C:\cygwin\home\USER\repo'
      
      The solution is to implement has_dos_drive_prefix(), skip_dos_drive_prefix()
      is_dir_sep(), offset_1st_component() and convert_slashes() for cygwin
      in the same way as it is done in 'Git for Windows' in compat/mingw.[ch]
      
      Extract the needed code into compat/win32/path-utils.[ch] and use it
      for cygwin as well.
      Reported-by: NSteven Penny <svnpenn@gmail.com>
      Helped-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NTorsten Bögershausen <tboegi@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      1cadad6f
  4. 03 12月, 2018 1 次提交
  5. 05 11月, 2018 1 次提交
    • J
      build: link with curl-defined linker flags · 23c4bbe2
      James Knight 提交于
      Adjusting the build process to rely more on curl-config to populate
      linker flags instead of manually populating flags based off detected
      features.
      
      Originally, a configure-invoked build would check for SSL-support in the
      target curl library. If enabled, NEEDS_SSL_WITH_CURL would be set and
      used in the Makefile to append additional libraries to link against. As
      for systems building solely with make, the defines NEEDS_IDN_WITH_CURL
      and NEEDS_SSL_WITH_CURL could be set to indirectly enable respective
      linker flags. Since both configure.ac and Makefile already rely on
      curl-config utility to provide curl-related build information, adjusting
      the respective assets to populate required linker flags using the
      utility (unless explicitly configured).
      Signed-off-by: NJames Knight <james.d.knight@live.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      23c4bbe2
  6. 24 10月, 2018 1 次提交
  7. 04 10月, 2018 1 次提交
    • J
      mingw: bump the minimum Windows version to Vista · 2939a1f7
      Johannes Schindelin 提交于
      Quite some time ago, a last plea to the XP users out there who want to
      see Windows XP support in Git for Windows, asking them to get engaged
      and help, vanished into the depths of the universe.
      
      We tried for a long time to play nice with the last remaining XP users
      who somehow manage to build Git from source, but a recent update of
      mingw-w64 (7.0.0.5233.e0c09544 -> 7.0.0.5245.edf66197) finally dropped
      the last sign of XP support, and Git for Windows' SDK is no longer able
      to build core Git's `master` branch as a consequence. (Git for Windows'
      `master` branch already bumped the minimum Windows version to Vista a
      while ago, so it is fine.)
      
      It is time to require Windows Vista or later to build Git from source.
      This, incidentally, lets us use quite a few nice new APIs.
      
      It also means that we no longer need the inet_pton() and inet_ntop()
      emulation, which is nice.
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      2939a1f7
  8. 01 9月, 2018 1 次提交
  9. 31 7月, 2018 1 次提交
  10. 16 4月, 2018 1 次提交
    • N
      gc --auto: exclude base pack if not enough mem to "repack -ad" · 9806f5a7
      Nguyễn Thái Ngọc Duy 提交于
      pack-objects could be a big memory hog especially on large repos,
      everybody knows that. The suggestion to stick a .keep file on the
      giant base pack to avoid this problem is also known for a long time.
      
      Recent patches add an option to do just this, but it has to be either
      configured or activated manually. This patch lets `git gc --auto`
      activate this mode automatically when it thinks `repack -ad` will use
      a lot of memory and start affecting the system due to swapping or
      flushing OS cache.
      
      gc --auto decides to do this based on an estimation of pack-objects
      memory usage, which is quite accurate at least for the heap part, and
      whether that fits in half of system memory (the assumption here is for
      desktop environment where there are many other applications running).
      
      This mechanism only kicks in if gc.bigBasePackThreshold is not configured.
      If it is, it is assumed that the user already knows what they want.
      Signed-off-by: NNguyễn Thái Ngọc Duy <pclouds@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9806f5a7
  11. 11 4月, 2018 2 次提交
  12. 13 2月, 2018 1 次提交
  13. 25 9月, 2017 1 次提交
    • M
      packed_ref_cache: keep the `packed-refs` file mmapped if possible · 5b633610
      Michael Haggerty 提交于
      Keep a copy of the `packed-refs` file contents in memory for as long
      as a `packed_ref_cache` object is in use:
      
      * If the system allows it, keep the `packed-refs` file mmapped.
      
      * If not (either because the system doesn't support `mmap()` at all,
        or because a file that is currently mmapped cannot be replaced via
        `rename()`), then make a copy of the file's contents in
        heap-allocated space, and keep that around instead.
      
      We base the choice of behavior on a new build-time switch,
      `MMAP_PREVENTS_DELETE`. By default, this switch is set for Windows
      variants.
      
      After this commit, `MMAP_NONE` and `MMAP_TEMPORARY` are still handled
      identically. But the next commit will introduce a difference.
      
      This whole change is still pointless, because we only read the
      `packed-refs` file contents immediately after instantiating the
      `packed_ref_cache`. But that will soon change.
      Signed-off-by: NMichael Haggerty <mhagger@alum.mit.edu>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      5b633610
  14. 22 7月, 2017 1 次提交
  15. 06 7月, 2017 1 次提交
    • T
      cygwin: allow pushing to UNC paths · 496f2569
      Torsten Bögershausen 提交于
       cygwin can use an UNC path like //server/share/repo
      
       $ cd //server/share/dir
       $ mkdir test
       $ cd test
       $ git init --bare
      
       However, when we try to push from a local Git repository to this repo,
       there is a problem: Git converts the leading "//" into a single "/".
      
       As cygwin handles an UNC path so well, Git can support them better:
      
       - Introduce cygwin_offset_1st_component() which keeps the leading "//",
         similar to what Git for Windows does.
      
       - Move CYGWIN out of the POSIX in the tests for path normalization in t0060
      Signed-off-by: NTorsten Bögershausen <tboegi@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      496f2569
  16. 02 6月, 2017 1 次提交
    • Æ
      grep: un-break building with PCRE >= 8.32 without --enable-jit · fb95e2e3
      Ævar Arnfjörð Bjarmason 提交于
      Amend my change earlier in this series ("grep: add support for the
      PCRE v1 JIT API", 2017-04-11) to un-break the build on PCRE v1
      versions later than 8.31 compiled without --enable-jit.
      
      As explained in that change and a later compatibility change in this
      series ("grep: un-break building with PCRE < 8.32", 2017-05-10) the
      pcre_jit_exec() function is a faster path to execute the JIT.
      
      Unfortunately there's no compatibility stub for that function compiled
      into the library if pcre_config(PCRE_CONFIG_JIT, &ret) would return 0,
      and no macro that can be used to check for it, so the only portable
      option to support builds without --enable-jit is via a new
      NO_LIBPCRE1_JIT=UnfortunatelyYes Makefile option[1].
      
      Another option would be to make the JIT opt-in via
      USE_LIBPCRE1_JIT=YesPlease, after all it's not a default option of
      PCRE v1.
      
      I think it makes more sense to make it opt-out since even though it's
      not a default option, most packagers of PCRE seem to turn it on by
      default, with the notable exception of the MinGW package.
      
      Make the MinGW platform work by default by changing the build defaults
      to turn on NO_LIBPCRE1_JIT=UnfortunatelyYes. It is the only platform
      that turns on USE_LIBPCRE=YesPlease by default, see commit
      df5218b4 ("config.mak.uname: support MSys2", 2016-01-13) for that
      change.
      
      1. "How do I support pcre1 JIT on all
         versions?"  (https://lists.exim.org/lurker/thread/20170601.103148.10253788.en.html)
      
      2. https://github.com/Alexpux/MINGW-packages/blob/master/mingw-w64-pcre/PKGBUILD
         (referenced from "Re: PCRE v2 compile error, was Re: What's cooking
         in git.git (May 2017, #01; Mon, 1)";
         <alpine.DEB.2.20.1705021756530.3480@virtualbox>)
      Signed-off-by: NÆvar Arnfjörð Bjarmason <avarab@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      fb95e2e3
  17. 26 5月, 2017 2 次提交
  18. 04 5月, 2017 1 次提交
  19. 01 3月, 2017 1 次提交
  20. 10 2月, 2017 1 次提交
    • J
      mingw: use OpenSSL's SHA-1 routines · 2cfc70f0
      Jeff Hostetler 提交于
      Use OpenSSL's SHA-1 routines rather than builtin block-sha1 routines.
      This improves performance on SHA1 operations on Intel processors.
      
      OpenSSL 1.0.2 has made considerable performance improvements and
      support the Intel hardware acceleration features.  See:
      https://software.intel.com/en-us/articles/improving-openssl-performance
      https://software.intel.com/en-us/articles/intel-sha-extensions
      
      To test this I added/staged a single file in a gigantic
      repository having a 450MB index file.  The code in read-cache.c
      verifies the header SHA as it reads the index and computes a new
      header SHA as it writes out the new index.  Therefore, in this test
      the SHA code must process 900MB of data.  Testing was done on an
      Intel I7-4770 CPU @ 3.40GHz (Intel64, Family 6, Model 60) CPU.
      
      The block-sha1 version averaged 5.27 seconds.
      The OpenSSL    version averaged 4.50 seconds.
      
      ================================================================
      
      $ echo xxx >> project.mk
      $ time /e/blk_sha/bin/git.exe add project.mk
      
      real    0m5.207s
      user    0m0.000s
      sys     0m0.250s
      
      $ echo xxx >> project.mk
      $ time /e/blk_sha/bin/git.exe add project.mk
      
      real    0m5.362s
      user    0m0.015s
      sys     0m0.234s
      
      $ echo xxx >> project.mk
      $ time /e/blk_sha/bin/git.exe add project.mk
      
      real    0m5.300s
      user    0m0.016s
      sys     0m0.250s
      
      $ echo xxx >> project.mk
      $ time /e/blk_sha/bin/git.exe add project.mk
      
      real    0m5.216s
      user    0m0.000s
      sys     0m0.250s
      
      ================================================================
      $ echo xxx >> project.mk
      $ time /e/openssl/bin/git.exe add project.mk
      
      real    0m4.431s
      user    0m0.000s
      sys     0m0.250s
      
      $ echo xxx >> project.mk
      $ time /e/openssl/bin/git.exe add project.mk
      
      real    0m4.478s
      user    0m0.000s
      sys     0m0.265s
      
      $ echo xxx >> project.mk
      $ time /e/openssl/bin/git.exe add project.mk
      
      real    0m4.690s
      user    0m0.000s
      sys     0m0.250s
      
      $ echo xxx >> project.mk
      $ time /e/openssl/bin/git.exe add project.mk
      
      real    0m4.420s
      user    0m0.000s
      sys     0m0.234s
      
      ================================================================
      Signed-off-by: NJeff Hostetler <jeffhost@microsoft.com>
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      2cfc70f0
  21. 07 12月, 2016 1 次提交
    • J
      xdiff: drop XDL_FAST_HASH · 1f7c9261
      Jeff King 提交于
      The xdiff code hashes every line of both sides of a diff,
      and then compares those hashes to find duplicates. The
      overall performance depends both on how fast we can compute
      the hashes, but also on how many hash collisions we see.
      
      The idea of XDL_FAST_HASH is to speed up the hash
      computation. But the generated hashes have worse collision
      behavior. This means that in some cases it speeds diffs up
      (running "git log -p" on git.git improves by ~8% with it),
      but in others it can slow things down. One pathological case
      saw over a 100x slowdown[1].
      
      There may be a better hash function that covers both
      properties, but in the meantime we are better off with the
      original hash. It's slightly slower in the common case, but
      it has fewer surprising pathological cases.
      
      [1] http://public-inbox.org/git/20141222041944.GA441@peff.net/Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      1f7c9261
  22. 05 8月, 2016 1 次提交
  23. 27 7月, 2016 1 次提交
  24. 12 7月, 2016 1 次提交
  25. 27 5月, 2016 1 次提交
    • K
      mingw: make isatty() recognize MSYS2's pseudo terminals (/dev/pty*) · f7f90e0f
      Karsten Blees 提交于
      MSYS2 emulates pseudo terminals via named pipes, and isatty() returns 0
      for such file descriptors. Therefore, some interactive functionality
      (such as launching a pager, asking if a failed unlink should be repeated
      etc.) doesn't work when run in a terminal emulator that uses MSYS2's
      ptys (such as mintty).
      
      However, MSYS2 uses special names for its pty pipes ('msys-*-pty*'),
      which allows us to distinguish them from normal piped input / output.
      
      On startup, check if stdin / stdout / stderr are connected to such pipes
      using the NtQueryObject API from NTDll.dll. If the names match, adjust
      the flags in MSVCRT's ioinfo structure accordingly.
      Signed-off-by: NKarsten Blees <blees@dcon.de>
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      f7f90e0f
  26. 22 3月, 2016 1 次提交
  27. 11 3月, 2016 1 次提交
    • J
      sane_grep: pass "-a" if grep accepts it · 71b40103
      Junio C Hamano 提交于
      Newer versions of GNU grep is reported to be pickier when we feed a
      non-ASCII input and break some Porcelain scripts.  As we know we do
      not feed random binary file to our own sane_grep wrapper, allow us
      to always pass "-a" by setting SANE_TEXT_GREP=-a Makefile variable
      to work it around.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      71b40103
  28. 29 2月, 2016 1 次提交
    • T
      config.mak.uname: use clang for Mac OS X 10.6 · 7b6daf8d
      Torsten Bögershausen 提交于
      Gcc under Mac OX 10.6 throws an internal compiler error:
      
      CC combine-diff.o
          combine-diff.c: In function ‘diff_tree_combined’:
          combine-diff.c:1391: internal compiler error: Segmentation fault
      
      while attempting to build Git at 5b442c4f (tree-diff: catch integer
      overflow in combine_diff_path allocation, 2016-02-19).
      
      As clang that ships with the version does not have the same bug,
      make Git compile under Mac OS X 10.6 by using clang instead of gcc
      to work this around, as it is unlikely that we will see fixed GCC
      on that platform.
      
      Later versions of Mac OSX/Xcode only provide clang, and gcc is a
      wrapper to it.
      Signed-off-by: NTorsten Bögershausen <tboegi@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7b6daf8d
  29. 27 1月, 2016 2 次提交
  30. 14 1月, 2016 2 次提交
    • J
      config.mak.uname: supporting 64-bit MSys2 · 7b40ae86
      Johannes Schindelin 提交于
      This just makes things compile, the test suite needs extra tender loving
      care in addition to this change. We will address these issues in later
      commits.
      
      While at it, also allow building MSys2 Git (i.e. a Git that uses MSys2's
      POSIX emulation layer).
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7b40ae86
    • J
      config.mak.uname: support MSys2 · df5218b4
      Johannes Schindelin 提交于
      For a long time, Git for Windows lagged behind Git's 2.x releases because
      the Git for Windows developers wanted to let that big jump coincide with
      a well-needed jump away from MSys to MSys2.
      
      To understand why this is such a big issue, it needs to be noted that
      many parts of Git are not written in portable C, but instead Git relies
      on a POSIX shell and Perl to be available.
      
      To support the scripts, Git for Windows has to ship a minimal POSIX
      emulation layer with Bash and Perl thrown in, and when the Git for
      Windows effort started in August 2007, this developer settled on using
      MSys, a stripped down version of Cygwin. Consequently, the original name
      of the project was "msysGit" (which, sadly, caused a *lot* of confusion
      because few Windows users know about MSys, and even less care).
      
      To compile the C code of Git for Windows, MSys was used, too: it sports
      two versions of the GNU C Compiler: one that links implicitly to the
      POSIX emulation layer, and another one that targets the plain Win32 API
      (with a few convenience functions thrown in).  Git for Windows'
      executables are built using the latter, and therefore they are really
      just Win32 programs. To discern executables requiring the POSIX
      emulation layer from the ones that do not, the latter are called MinGW
      (Minimal GNU for Windows) when the former are called MSys executables.
      
      This reliance on MSys incurred challenges, too, though: some of our
      changes to the MSys runtime -- necessary to support Git for Windows
      better -- were not accepted upstream, so we had to maintain our own
      fork. Also, the MSys runtime was not developed further to support e.g.
      UTF-8 or 64-bit, and apart from lacking a package management system
      until much later (when mingw-get was introduced), many packages provided
      by the MSys/MinGW project lag behind the respective source code
      versions, in particular Bash and OpenSSL. For a while, the Git for
      Windows project tried to remedy the situation by trying to build newer
      versions of those packages, but the situation quickly became untenable,
      especially with problems like the Heartbleed bug requiring swift action
      that has nothing to do with developing Git for Windows further.
      
      Happily, in the meantime the MSys2 project (https://msys2.github.io/)
      emerged, and was chosen to be the base of the Git for Windows 2.x. Just
      like MSys, MSys2 is a stripped down version of Cygwin, but it is
      actively kept up-to-date with Cygwin's source code.  Thereby, it already
      supports Unicode internally, and it also offers the 64-bit support that
      we yearned for since the beginning of the Git for Windows project.
      
      MSys2 also ported the Pacman package management system from Arch Linux
      and uses it heavily. This brings the same convenience to which Linux
      users are used to from `yum` or `apt-get`, and to which MacOSX users are
      used to from Homebrew or MacPorts, or BSD users from the Ports system,
      to MSys2: a simple `pacman -Syu` will update all installed packages to
      the newest versions currently available.
      
      MSys2 is also *very* active, typically providing package updates
      multiple times per week.
      
      It still required a two-month effort to bring everything to a state
      where Git's test suite passes, many more months until the first official
      Git for Windows 2.x was released, and a couple of patches still await
      their submission to the respective upstream projects. Yet without MSys2,
      the modernization of Git for Windows would simply not have happened.
      
      This commit lays the ground work to supporting MSys2-based Git builds.
      Assisted-by: NWaldek Maleska <weakcamel@users.github.com>
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      df5218b4
  31. 06 10月, 2015 1 次提交
  32. 08 8月, 2015 1 次提交
  33. 04 6月, 2015 1 次提交
  34. 16 4月, 2015 1 次提交
    • J
      strbuf_getwholeline: use getdelim if it is available · 0cc30e0e
      Jeff King 提交于
      We spend a lot of time in strbuf_getwholeline in a tight
      loop reading characters from a stdio handle into a buffer.
      The libc getdelim() function can do this for us with less
      overhead. It's in POSIX.1-2008, and was a GNU extension
      before that. Therefore we can't rely on it, but can fall
      back to the existing getc loop when it is not available.
      
      The HAVE_GETDELIM knob is turned on automatically for Linux,
      where we have glibc. We don't need to set any new
      feature-test macros, because we already define _GNU_SOURCE.
      Other systems that implement getdelim may need to other
      macros (probably _POSIX_C_SOURCE >= 200809L), but we can
      address that along with setting the Makefile knob after
      testing the feature on those systems.
      
      Running "git rev-parse refs/heads/does-not-exist" on a repo
      with an extremely large (1.6GB) packed-refs file went from
      (best-of-5):
      
        real    0m8.601s
        user    0m8.084s
        sys     0m0.524s
      
      to:
      
        real    0m6.768s
        user    0m6.340s
        sys     0m0.432s
      
      for a wall-clock speedup of 21%.
      
      Based on a patch from Rasmus Villemoes <rv@rasmusvillemoes.dk>.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      0cc30e0e
  35. 11 3月, 2015 1 次提交
  36. 10 1月, 2015 1 次提交