1. 10 1月, 2015 1 次提交
  2. 05 12月, 2014 1 次提交
    • D
      compat: convert modes to use portable file type values · d543d9c0
      David Michael 提交于
      This adds simple wrapper functions around calls to stat(), fstat(),
      and lstat() that translate the operating system's native file type
      bits to those used by most operating systems.  It also rewrites the
      S_IF* macros to the common values, so all file type processing is
      performed using the translated modes.  This makes projects portable
      across operating systems that use different file type definitions.
      
      Only the file type bits may be affected by these compatibility
      functions; the file permission bits are assumed to be 07777 and are
      passed through unchanged.
      Signed-off-by: NDavid Michael <fedora.dm0@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d543d9c0
  3. 19 11月, 2014 3 次提交
    • J
      Makefile: have python scripts depend on NO_PYTHON setting · ca2051d6
      Jonathan Nieder 提交于
      Like the perl scripts, python scripts need a dependency to ensure they
      are rebuilt when switching between the "dummy" versions that run
      without Python and the real thing.
      Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      ca2051d6
    • J
      Makefile: simplify by using SCRIPT_{PERL,SH}_GEN macros · 64c07db9
      Jonathan Nieder 提交于
      SCRIPT_PERL_GEN is defined as $(patsubst %.perl,%,$(SCRIPT_PERL))
      for use in targets like build-perl-script used by makefiles in
      subdirectories that override SCRIPT_PERL (see v1.8.2-rc0~17^2,
      "git-remote-mediawiki: use toplevel's Makefile", 2013-02-08).
      
      The same expression is used in the rules that actually write the
      generated perl scripts, and since these rules were introduced before
      SCRIPT_PERL_GEN, they use the longhand instead of that macro.  Use the
      macro to make reading easier.
      
      Likewise for SCRIPT_SH_GEN.  The Python rules already got the same
      simplification in v1.8.4-rc0~162^2~8 (2013-05-24).
      Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
      Reviewed-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      64c07db9
    • J
      Makefile: have perl scripts depend on NO_PERL setting · e204b001
      Jeff King 提交于
      If NO_PERL is not set, our perl scripts are built as
      usual. If it is set, then we build "dummy" versions that
      tell you git was built without perl support and exit
      gracefully.
      
      However, if you switch to NO_PERL in a directory with
      existing build artifacts, we do not notice that the files
      need rebuilt. We see only that they are newer than the
      "unimplemented.sh" wrapper and assume they are done. So
      doing:
      
        make
        make NO_PERL=Nope
      
      would result in a git-add--interactive script that uses perl
      (and running the test suite would make use of it).
      
      Instead, we should trigger a rebuild of the perl scripts
      anytime NO_PERL changes.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e204b001
  4. 11 11月, 2014 1 次提交
    • B
      git-imap-send: use libcurl for implementation · 1e16b255
      Bernhard Reiter 提交于
      Use libcurl's high-level API functions to implement git-imap-send
      instead of the previous low-level OpenSSL-based functions.
      
      Since version 7.30.0, libcurl's API has been able to communicate with
      IMAP servers. Using those high-level functions instead of the current
      ones would reduce imap-send.c by some 1200 lines of code. For now,
      the old ones are wrapped in #ifdefs, and the new functions are enabled
      by make if curl's version is >= 7.34.0, from which version on curl's
      CURLOPT_LOGIN_OPTIONS (enabling IMAP authentication) parameter has been
      available. The low-level functions will still be used for tunneling
      into the server for now.
      
      As I don't have access to that many IMAP servers, I haven't been able to
      test the new code with a wide variety of parameter combinations. I did
      test both secure and insecure (imaps:// and imap://) connections and
      values of "PLAIN" and "LOGIN" for the authMethod.
      
      In order to suppress a sparse warning about "using sizeof on a
      function", we use the same solution used in commit 9371322a
      ("sparse: suppress some "using sizeof on a function" warnings",
      06-10-2013) which solved exactly this problem for the other commands
      using libcurl.
      Helped-by: NRamsay Jones <ramsay@ramsay1.demon.co.uk>
      Signed-off-by: NBernhard Reiter <ockham@raz.or.at>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      1e16b255
  5. 28 10月, 2014 1 次提交
  6. 14 10月, 2014 2 次提交
  7. 02 10月, 2014 1 次提交
  8. 16 9月, 2014 1 次提交
  9. 03 9月, 2014 1 次提交
  10. 27 8月, 2014 1 次提交
    • J
      Makefile: drop CHECK_HEADER_DEPENDENCIES code · 14821f88
      Jeff King 提交于
      This code was useful when we kept a static list of header
      files, and it was easy to forget to update it. Since the last
      commit, we generate the list dynamically.
      
      Technically this could still be used to find a dependency
      that our dynamic check misses (e.g., a header file without a
      ".h" extension).  But that is reasonably unlikely to be
      added, and even less likely to be noticed by this tool
      (because it has to be run manually)., It is not worth
      carrying around the cruft in the Makefile.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      14821f88
  11. 26 8月, 2014 2 次提交
    • J
      Makefile: use `find` to determine static header dependencies · d85b0dff
      Jeff King 提交于
      Most modern platforms will use automatically computed header
      dependencies to figure out when a C file needs rebuilt due
      to a header changing. With old compilers, however, we
      fallback to a static list of header files. If any of them
      changes, we recompile everything. This is overly
      conservative, but the best we can do on older platforms.
      
      It is unfortunately easy for our static header list to grow
      stale, as none of the regular developers make use of it.
      Instead of trying to keep it up to date, let's invoke "find"
      to generate the list dynamically.
      
      Since we do not use the value $(LIB_H) unless either
      COMPUTE_HEADER_DEPENDENCIES is turned on or the user is
      building "po/git.pot" (where it comes in via $(LOCALIZED_C),
      make is smart enough to not even run this "find" in most
      cases. However, we do need to stop using the "immediate"
      variable assignment ":=" for $(LOCALIZED_C). That's OK,
      because it was not otherwise useful here.
      Signed-off-by: NJeff King <peff@peff.net>
      Reviewed-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d85b0dff
    • J
      i18n: treat "make pot" as an explicitly-invoked target · 1f31963e
      Jonathan Nieder 提交于
      po/git.pot is normally used as-is and not regenerated by people
      building git, so it is okay if an explicit "make po/git.pot" always
      automatically regenerates it.  Depend on the magic FORCE target
      instead of explicitly keeping track of dependencies.
      
      This simplifies the makefile, in particular preparing for a moment
      when $(LIB_H), which is part of $(LOCALIZED_C), can be computed on the
      fly. It also fixes a slight breakage in which changes to perl and shell
      scripts did not trigger a rebuild of po/git.pot.
      
      We still need a dependency on GENERATED_H, to force those files to be
      built when regenerating git.pot.
      Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      1f31963e
  12. 20 8月, 2014 1 次提交
  13. 30 7月, 2014 1 次提交
  14. 14 7月, 2014 1 次提交
    • K
      trace: add high resolution timer function to debug performance issues · 148d6771
      Karsten Blees 提交于
      Add a getnanotime() function that returns nanoseconds since 01/01/1970 as
      unsigned 64-bit integer (i.e. overflows in july 2554). This is easier to
      work with than e.g. struct timeval or struct timespec. Basing the timer on
      the epoch allows using the results with other time-related APIs.
      
      To simplify adaption to different platforms, split the implementation into
      a common getnanotime() and a platform-specific highres_nanos() function.
      
      The common getnanotime() function handles errors, falling back to
      gettimeofday() if highres_nanos() isn't implemented or doesn't work.
      
      getnanotime() is also responsible for normalizing to the epoch. The offset
      to the system clock is calculated only once on initialization, i.e.
      manually setting the system clock has no impact on the timer (except if
      the fallback gettimeofday() is in use). Git processes are typically short
      lived, so we don't need to handle clock drift.
      
      The highres_nanos() function returns monotonically increasing nanoseconds
      relative to some arbitrary point in time (e.g. system boot), or 0 on
      failure. Providing platform-specific implementations should be relatively
      easy, e.g. adapting to clock_gettime() as defined by the POSIX realtime
      extensions is seven lines of code.
      
      This version includes highres_nanos() implementations for:
       * Linux: using clock_gettime(CLOCK_MONOTONIC)
       * Windows: using QueryPerformanceCounter()
      
      Todo:
       * enable clock_gettime() on more platforms
       * add Mac OSX version, e.g. using mach_absolute_time + mach_timebase_info
      Signed-off-by: NKarsten Blees <blees@dcon.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      148d6771
  15. 09 7月, 2014 2 次提交
    • A
      Fix profile feedback with -jN and add profile-fast · 066dd263
      Andi Kleen 提交于
      Profile feedback always failed for me with -jN. The problem
      was that there was no implicit ordering between the profile generate
      stage and the profile use stage. So some objects in the later stage
      would be linked with profile generate objects, and fail due
      to the missing -lgcov.
      
      This adds a new profile target that implicitely enforces the
      correct ordering by using submakes. Plus a profile-install target
      to also install. This is also nicer to type that PROFILE=...
      
      Plus I always run the performance test suite now for the full
      profile run.
      
      In addition I also added a profile-fast / profile-fast-install
      target the only runs the performance test suite instead of the
      whole test suite. This significantly speeds up the profile build,
      which was totally dominated by test suite run time. However
      it may have less coverage of course.
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      066dd263
    • A
      Run the perf test suite for profile feedback too · 5d7fd6d0
      Andi Kleen 提交于
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      5d7fd6d0
  16. 08 7月, 2014 1 次提交
  17. 24 6月, 2014 1 次提交
  18. 14 6月, 2014 2 次提交
    • N
    • N
      read-cache: split-index mode · 5fc2fc8f
      Nguyễn Thái Ngọc Duy 提交于
      This split-index mode is designed to keep write cost proportional to
      the number of changes the user has made, not the size of the work
      tree. (Read cost is another matter, to be dealt separately.)
      
      This mode stores index info in a pair of $GIT_DIR/index and
      $GIT_DIR/sharedindex.<SHA-1>. sharedindex is large and unchanged over
      time while "index" is smaller and updated often. Format details are in
      index-format.txt, although not everything is implemented in this
      patch.
      
      Shared indexes are not automatically removed, because it's unclear if
      the shared index is needed by any (even temporary) indexes by just
      looking at it. After a while you'll collect stale shared indexes. The
      good news is one shared index is useable for long, until
      $GIT_DIR/index becomes too big and sluggish that the new shared index
      must be created.
      
      The safest way to clean shared indexes is to turn off split index
      mode, so shared files are all garbage, delete them all, then turn on
      split index mode again.
      Signed-off-by: NNguyễn Thái Ngọc Duy <pclouds@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      5fc2fc8f
  19. 13 5月, 2014 1 次提交
    • T
      utf8: make it easier to auto-update git_wcwidth() · 9c94389c
      Torsten Bögershausen 提交于
      The function git_wcwidth() returns for a given unicode code point the
      width on the display:
      
       -1 for control characters,
        0 for combining or other non-visible code points
        1 for e.g. ASCII
        2 for double-width code points.
      
      This table had been originally been extracted for one Unicode
      version, probably 3.2.
      
      We now use two tables these days, one for zero-width and another for
      double-width.  Make it easier to update these tables to a later
      version of Unicode by factoring out the table from utf8.c into
      unicode_width.h and add the script update_unicode.sh to update the
      table based on the latest Unicode specification files.
      
      Thanks to Peter Krefting <peter@softwolves.pp.se> and Kevin Bracey
      <kevin@bracey.fi> for helping with their Unicode knowledge.
      Signed-off-by: NTorsten Bögershausen <tboegi@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9c94389c
  20. 01 5月, 2014 1 次提交
  21. 29 4月, 2014 1 次提交
    • D
      Makefile: default to -lcurl when no CURL_CONFIG or CURLDIR · f3f11fa6
      Dave Borowitz 提交于
      The original implementation of CURL_CONFIG support did not match the
      original behavior of using -lcurl when CURLDIR was not set. This broke
      implementations that were lacking curl-config but did have libcurl
      installed along system libraries, such as MSysGit. In other words, the
      assumption that curl-config is always installed was incorrect.
      
      Instead, if CURL_CONFIG is empty or returns an empty result (e.g. due
      to curl-config being missing), use the old behavior of falling back to
      -lcurl.
      Signed-off-by: NDave Borowitz <dborowitz@google.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      f3f11fa6
  22. 18 4月, 2014 1 次提交
    • J
      i18n: only extract comments marked with "TRANSLATORS:" · 47fbfded
      Jiang Xin 提交于
      When extract l10n messages, we use "--add-comments" option to keep
      comments right above the l10n messages for references.  But sometimes
      irrelevant comments are also extracted.  For example in the following
      code block, the comment in line 2 will be extracted as comment for the
      l10n message in line 3, but obviously it's wrong.
      
              { OPTION_CALLBACK, 0, "ignore-removal", &addremove_explicit,
                NULL /* takes no arguments */,
                N_("ignore paths removed in the working tree (same as
                --no-all)"),
                PARSE_OPT_NOARG, ignore_removal_cb },
      
      Since almost all comments for l10n translators are marked with the same
      prefix (tag): "TRANSLATORS:", it's safe to only extract comments with
      this special tag.  I.E. it's better to call xgettext as:
      
              xgettext --add-comments=TRANSLATORS: ...
      
      Also tweaks the multi-line comment in "init-db.c", to make it start with
      the proper tag, not "* TRANSLATORS:" (which has a star before the tag).
      Signed-off-by: NJiang Xin <worldhello.net@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      47fbfded
  23. 17 4月, 2014 1 次提交
    • N
      index-pack: work around thread-unsafe pread() · 39539495
      Nguyễn Thái Ngọc Duy 提交于
      Multi-threaing of index-pack was disabled with c0f86547
      (index-pack: Disable threading on cygwin - 2012-06-26), because
      pread() implementations for Cygwin and MSYS were not thread
      safe.  Recent Cygwin does offer usable pread() and we enabled
      multi-threading with 103d530f (Cygwin 1.7 has thread-safe pread,
      2013-07-19).
      
      Work around this problem on platforms with a thread-unsafe
      pread() emulation by opening one file handle per thread; it
      would prevent parallel pread() on different file handles from
      stepping on each other.
      
      Also remove NO_THREAD_SAFE_PREAD that was introduced in c0f86547
      because it's no longer used anywhere.
      
      This workaround is unconditional, even for platforms with
      thread-safe pread() because the overhead is small (a couple file
      handles more) and not worth fragmenting the code.
      Signed-off-by: NNguyễn Thái Ngọc Duy <pclouds@gmail.com>
      Tested-by: NJohannes Sixt <j6t@kdbg.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      39539495
  24. 16 4月, 2014 2 次提交
    • D
      Makefile: allow static linking against libcurl · d5067112
      Dave Borowitz 提交于
      This requires more flags than can be guessed with the old-style
      CURLDIR and related options, so is only supported when curl-config is
      present.
      Signed-off-by: NDave Borowitz <dborowitz@google.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d5067112
    • D
      Makefile: use curl-config to determine curl flags · 61a64fff
      Dave Borowitz 提交于
      curl-config should always be installed alongside a curl distribution,
      and its purpose is to provide flags for building against libcurl, so
      use it instead of guessing flags and dependent libraries.
      
      Allow overriding CURL_CONFIG to a custom path to curl-config, to
      compile against a curl installation other than the first in PATH.
      
      Depending on the set of features curl is compiled with, there may be
      more libraries required than the previous two options of -lssl and
      -lidn. For example, with a vanilla build of libcurl-7.36.0 on Mac OS X
      10.9:
      
      $ ~/d/curl-out-7.36.0/lib/curl-config --libs
      -L/Users/dborowitz/d/curl-out-7.36.0/lib -lcurl -lgssapi_krb5 -lresolv -lldap -lz
      
      Use this only when CURLDIR is not explicitly specified, to continue
      supporting older builds.
      Signed-off-by: NDave Borowitz <dborowitz@google.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      61a64fff
  25. 02 4月, 2014 1 次提交
  26. 01 4月, 2014 1 次提交
  27. 28 3月, 2014 1 次提交
    • K
      Portable alloca for Git · 61f76a36
      Kirill Smelkov 提交于
      In the next patch we'll have to use alloca() for performance reasons,
      but since alloca is non-standardized and is not portable, let's have a
      trick with compatibility wrappers:
      
      1. at configure time, determine, do we have working alloca() through
         alloca.h, and define
      
          #define HAVE_ALLOCA_H
      
         if yes.
      
      2. in code
      
          #ifdef HAVE_ALLOCA_H
          # include <alloca.h>
          # define xalloca(size)      (alloca(size))
          # define xalloca_free(p)    do {} while(0)
          #else
          # define xalloca(size)      (xmalloc(size))
          # define xalloca_free(p)    (free(p))
          #endif
      
         and use it like
      
         func() {
             p = xalloca(size);
             ...
      
             xalloca_free(p);
         }
      
      This way, for systems, where alloca is available, we'll have optimal
      on-stack allocations with fast executions. On the other hand, on
      systems, where alloca is not available, this gracefully fallbacks to
      xmalloc/free.
      
      Both autoconf and config.mak.uname configurations were updated. For
      autoconf, we are not bothering considering cases, when no alloca.h is
      available, but alloca() works some other way - its simply alloca.h is
      available and works or not, everything else is deep legacy.
      
      For config.mak.uname, I've tried to make my almost-sure guess for where
      alloca() is available, but since I only have access to Linux it is the
      only change I can be sure about myself, with relevant to other changed
      systems people Cc'ed.
      
      NOTE
      
      SunOS and Windows had explicit -DHAVE_ALLOCA_H in their configurations.
      I've changed that to now-common HAVE_ALLOCA_H=YesPlease which should be
      correct.
      
      Cc: Brandon Casey <drafnel@gmail.com>
      Cc: Marius Storm-Olsen <mstormo@gmail.com>
      Cc: Johannes Sixt <j6t@kdbg.org>
      Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>
      Cc: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
      Cc: Gerrit Pape <pape@smarden.org>
      Cc: Petr Salinger <Petr.Salinger@seznam.cz>
      Cc: Jonathan Nieder <jrnieder@gmail.com>
      Acked-by: Thomas Schwinge <thomas@codesourcery.com> (GNU Hurd changes)
      Signed-off-by: NKirill Smelkov <kirr@mns.spb.ru>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      61f76a36
  28. 24 3月, 2014 1 次提交
  29. 28 2月, 2014 1 次提交
  30. 25 2月, 2014 1 次提交
  31. 21 2月, 2014 1 次提交
  32. 28 1月, 2014 1 次提交
  33. 24 1月, 2014 1 次提交
    • J
      Makefile: Fix compilation of Windows resource file · b594c975
      Johannes Sixt 提交于
      If the git version number consists of less than three period
      separated numbers, then the Windows resource file compilation
      issues a syntax error:
      
        $ touch git.rc
        $ make V=1 git.res
        GIT_VERSION = 1.9.rc0
        windres -O coff \
                  -DMAJOR=1 -DMINOR=9 -DPATCH=rc0 \
                  -DGIT_VERSION="\\\"1.9.rc0\\\"" git.rc -o git.res
        C:\msysgit\msysgit\mingw\bin\windres.exe: git.rc:2: syntax error
        make: *** [git.res] Error 1
        $
      
      Note that -DPATCH=rc0.
      
      The values passed via -DMAJOR=, -DMINOR=, and -DPATCH= are used in
      FILEVERSION and PRODUCTVERSION statements, which expect up to four numeric
      values. These version numbers are intended for machine consumption. They
      are typically inspected by installers to decide whether a file to be
      installed is newer than one that exists on the system, but are not used
      for much else.
      
      We can be pretty certain that there are no tools that look at these
      version numbers, not even the installer of Git for Windows does.
      Therefore, to fix the syntax error, fill in only the first two numbers,
      which we are guaranteed to find in Git version numbers.
      Signed-off-by: NJohannes Sixt <j6t@kdbg.org>
      Acked-by: NPat Thoyts <patthoyts@users.sourceforge.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b594c975