1. 16 6月, 2008 2 次提交
  2. 09 6月, 2008 1 次提交
    • B
      Port to 12 other Platforms. · 457bb452
      Boyd Lynn Gerber 提交于
      This patch adds support to compile and run git on 12 additional platforms.
      The platforms are based on UNIX Systems Labs (USL)/Novell/SYS V code base.
      The most common are Novell UnixWare 2.X.X, SCO UnixWare 7.X.X,
      OpenServer 5.0.X, OpenServer 6.0.X, and SCO pre OSR 5 platforms.
      
      Looking at the the various platform headers, I find:
      
      	#if defined(_KERNEL) || !defined(_POSIX_SOURCE) \
      	     && !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)
      
      which hides u_short and other typedefs that other header files on these
      platforms depend on.  WIth _XOPEN_SOURCE defined, sources that include
      system header files that depend on the typedefs such as u_short cannot be
      compiled on these platforms.
      
      __USLC__ indicates UNIX System Labs Corperation (USLC), or a Novell-derived
      compiler and/or some SysV based OS's.
      
      __M_UNIX indicates XENIX/SCO UNIX/OpenServer 5.0.7 and prior releases
      of the SCO OS's.  It is used just like Apple and BSD, both of these
      shouldn't have _XOPEN_SOURCE defined.
      
      This is with suggestions and modifications from
      
      Daniel Barkalow, Junio C Hamano, Thomas Harning, and Jeremy Maitin-Shepard.
      Signed-off-by: NBoyd Lynn Gerber <gerberb@zenez.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      457bb452
  3. 27 5月, 2008 1 次提交
  4. 24 5月, 2008 1 次提交
    • J
      "git diff": do not ignore index without --no-index · 0569e9b8
      Junio C Hamano 提交于
      Even if "foo" and/or "bar" does not exist in index, "git diff foo bar"
      should not change behaviour drastically from "git diff foo bar baz" or
      "git diff foo".  A feature that "sometimes works and is handy" is an
      unreliable cute hack.
      
      "git diff foo bar" outside a git repository continues to work as a more
      colourful alternative to "diff -u" as before.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      0569e9b8
  5. 17 5月, 2008 1 次提交
  6. 06 5月, 2008 1 次提交
  7. 05 5月, 2008 1 次提交
  8. 02 5月, 2008 1 次提交
  9. 09 4月, 2008 2 次提交
    • J
      sha1-lookup: more memory efficient search in sorted list of SHA-1 · 628522ec
      Junio C Hamano 提交于
      Currently, when looking for a packed object from the pack idx, a
      simple binary search is used.
      
      A conventional binary search loop looks like this:
      
              unsigned lo, hi;
              do {
                      unsigned mi = (lo + hi) / 2;
                      int cmp = "entry pointed at by mi" minus "target";
                      if (!cmp)
                              return mi; "mi is the wanted one"
                      if (cmp > 0)
                              hi = mi; "mi is larger than target"
                      else
                              lo = mi+1; "mi is smaller than target"
              } while (lo < hi);
      	"did not find what we wanted"
      
      The invariants are:
      
        - When entering the loop, 'lo' points at a slot that is never
          above the target (it could be at the target), 'hi' points at
          a slot that is guaranteed to be above the target (it can
          never be at the target).
      
        - We find a point 'mi' between 'lo' and 'hi' ('mi' could be
          the same as 'lo', but never can be as high as 'hi'), and
          check if 'mi' hits the target.  There are three cases:
      
           - if it is a hit, we have found what we are looking for;
      
           - if it is strictly higher than the target, we set it to
             'hi', and repeat the search.
      
           - if it is strictly lower than the target, we update 'lo'
             to one slot after it, because we allow 'lo' to be at the
             target and 'mi' is known to be below the target.
      
          If the loop exits, there is no matching entry.
      
      When choosing 'mi', we do not have to take the "middle" but
      anywhere in between 'lo' and 'hi', as long as lo <= mi < hi is
      satisfied.  When we somehow know that the distance between the
      target and 'lo' is much shorter than the target and 'hi', we
      could pick 'mi' that is much closer to 'lo' than (hi+lo)/2,
      which a conventional binary search would pick.
      
      This patch takes advantage of the fact that the SHA-1 is a good
      hash function, and as long as there are enough entries in the
      table, we can expect uniform distribution.  An entry that begins
      with for example "deadbeef..." is much likely to appear much
      later than in the midway of a reasonably populated table.  In
      fact, it can be expected to be near 87% (222/256) from the top
      of the table.
      
      This is a work-in-progress and has switches to allow easier
      experiments and debugging.  Exporting GIT_USE_LOOKUP environment
      variable enables this code.
      
      On my admittedly memory starved machine, with a partial KDE
      repository (3.0G pack with 95M idx):
      
          $ GIT_USE_LOOKUP=t git log -800 --stat HEAD >/dev/null
          3.93user 0.16system 0:04.09elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k
          0inputs+0outputs (0major+55588minor)pagefaults 0swaps
      
      Without the patch, the numbers are:
      
          $ git log -800 --stat HEAD >/dev/null
          4.00user 0.15system 0:04.17elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
          0inputs+0outputs (0major+60258minor)pagefaults 0swaps
      
      In the same repository:
      
          $ GIT_USE_LOOKUP=t git log -2000 HEAD >/dev/null
          0.12user 0.00system 0:00.12elapsed 97%CPU (0avgtext+0avgdata 0maxresident)k
          0inputs+0outputs (0major+4241minor)pagefaults 0swaps
      
      Without the patch, the numbers are:
      
          $ git log -2000 HEAD >/dev/null
          0.05user 0.01system 0:00.07elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k
          0inputs+0outputs (0major+8506minor)pagefaults 0swaps
      
      There isn't much time difference, but the number of minor faults
      seems to show that we are touching much smaller number of pages,
      which is expected.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      628522ec
    • L
      Move name hashing functions into a file of its own · 96872bc2
      Linus Torvalds 提交于
      It's really totally separate functionality, and if we want to start
      doing case-insensitive hash lookups, I'd rather do it when it's
      separated out.
      
      It also renames "remove_index_entry()" to "remove_name_hash()", because
      that really describes the thing better. It doesn't actually remove the
      index entry, that's done by "remove_index_entry_at()", which is something
      very different, despite the similarity in names.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      96872bc2
  10. 06 4月, 2008 1 次提交
  11. 28 3月, 2008 1 次提交
  12. 14 3月, 2008 1 次提交
  13. 13 3月, 2008 2 次提交
  14. 12 3月, 2008 3 次提交
  15. 06 3月, 2008 2 次提交
  16. 05 3月, 2008 1 次提交
  17. 01 3月, 2008 2 次提交
  18. 29 2月, 2008 1 次提交
    • J
      use build-time SHELL_PATH in test scripts · 7cf7f54a
      Jeff King 提交于
      The top-level Makefile now creates a GIT-BUILD-OPTIONS file
      which stores any options selected by the make process that
      may be of use to further parts of the build process.
      Specifically, we store the SHELL_PATH so that it can be used
      by tests to construct shell scripts on the fly.
      
      The format of the GIT-BUILD-OPTIONS file is Bourne shell,
      and it is sourced by test-lib.sh; all tests can rely on just
      having $SHELL_PATH correctly set in the environment.
      
      The GIT-BUILD-OPTIONS file is written every time the
      toplevel 'make' is invoked. Since the only users right now
      are the test scripts, there's no drawback to updating its
      timestamp. If something build-related depends on this, we
      can do a trick similar to the one used by GIT-CFLAGS.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7cf7f54a
  19. 26 2月, 2008 2 次提交
  20. 25 2月, 2008 1 次提交
  21. 24 2月, 2008 3 次提交
  22. 22 2月, 2008 2 次提交
    • S
      git-gui: Avoid hardcoded Windows paths in Cygwin package files · df4ec4cf
      Shawn O. Pearce 提交于
      When we are being built by the Cygwin package maintainers we need to
      embed the POSIX path to our library files and not the Windows path.
      Embedding the Windows path means all end-users who install our Cygwin
      package would be required to install Cygwin at the same Windows path
      as the package maintainer had Cygwin installed to.  This requirement
      is simply not user-friendly and may be infeasible for a large number
      of our users.
      
      We now try to auto-detect if the Tcl/Tk binary we will use at runtime
      is capable of translating POSIX paths into Windows paths the same way
      that cygpath does the translations.  If the Tcl/Tk binary gives us the
      same results then it understands the Cygwin path translation process
      and should be able to read our library files from a POSIX path name.
      
      If it does not give us the same answer as cygpath then the Tcl/Tk
      binary might actually be a native Win32 build (one that is not
      linked against Cygwin) and thus requires the native Windows path
      to our library files.  We can assume this is not a Cygwin package
      as the Cygwin maintainers do not currently ship a pure Win32 build
      of Tcl/Tk.
      
      Reported on the git mailing list by Jurko Gospodnetić.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      df4ec4cf
    • S
      git-gui: Default TCL_PATH to same location as TCLTK_PATH · 651fbba2
      Shawn O. Pearce 提交于
      Most users set TCLTK_PATH to tell git-gui where to find wish, but they
      fail to set TCL_PATH to the same Tcl installation.  We use the non-GUI
      tclsh during builds so headless systems are still able to create an
      index file and create message files without GNU msgfmt.  So it matters
      to us that we find a working TCL_PATH at build time.
      
      If TCL_PATH hasn't been set yet we can take a better guess about what
      tclsh executable to use by replacing 'wish' in the executable path with
      'tclsh'.  We only do this replacement on the filename part of the path,
      just in case the string "wish" appears in the directory paths.  Most of
      the time the tclsh will be installed alongside wish so this replacement
      is a sensible and safe default.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      651fbba2
  23. 18 2月, 2008 1 次提交
  24. 17 2月, 2008 1 次提交
    • D
      Build in checkout · 782c2d65
      Daniel Barkalow 提交于
      The only differences in behavior should be:
      
       - git checkout -m with non-trivial merging won't print out
         merge-recursive messages (see the change in t7201-co.sh)
      
       - git checkout -- paths... will give a sensible error message if
         HEAD is invalid as a commit.
      
       - some intermediate states which were written to disk in the shell
         version (in particular, index states) are only kept in memory in
         this version, and therefore these can no longer be revealed by
         later write operations becoming impossible.
      
       - when we change branches, we discard MERGE_MSG, SQUASH_MSG, and
         rr-cache/MERGE_RR, like reset always has.
      
      I'm not 100% sure I got the merge recursive setup exactly right; the
      base for a non-trivial merge in the shell code doesn't seem
      theoretically justified to me, but I tried to match it anyway, and the
      tests all pass this way.
      
      Other than these items, the results should be identical to the shell
      version, so far as I can tell.
      
      [jc: squashed lock-file fix from Dscho in]
      Signed-off-by: NDaniel Barkalow <barkalow@iabervon.org>
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      782c2d65
  25. 12 2月, 2008 2 次提交
  26. 10 2月, 2008 2 次提交
    • D
      Move create_branch into a library file · e496c003
      Daniel Barkalow 提交于
      You can also create branches, in exactly the same way, with checkout -b.
      
      This introduces branch.{c,h} library files for doing porcelain-level
      operations on branches (such as creating them with their appropriate
      default configuration).
      Signed-off-by: NDaniel Barkalow <barkalow@iabervon.org>
      e496c003
    • D
      Build-in merge-recursive · e1b3a2ca
      Daniel Barkalow 提交于
      This makes write_tree_from_memory(), which writes the active cache as
      a tree and returns the struct tree for it, available to other code. It
      also makes available merge_trees(), which does the internal merge of
      two trees with a known base, and merge_recursive(), which does the
      recursive internal merge of two commits with a list of common
      ancestors.
      
      The first two of these will be used by checkout -m, and the third is
      presumably useful in general, although the implementation of checkout
      -m which entirely matches the behavior of the shell version does not
      use it (since it ignores the difference of ancestry between the old
      branch and the new branch).
      Signed-off-by: NDaniel Barkalow <barkalow@iabervon.org>
      e1b3a2ca
  27. 07 2月, 2008 1 次提交
    • B
      compat: Add simplified merge sort implementation from glibc · 43fe901b
      Brian Downing 提交于
      qsort in Windows 2000 (and various other C libraries) is a Quicksort
      with the usual O(n^2) worst case.  Unfortunately, sorting Git trees
      seems to get very close to that worst case quite often:
      
          $ /git/gitbad runstatus
          # On branch master
          qsort, nmemb = 30842
          done, 237838087 comparisons.
      
      This patch adds a simplified version of the merge sort that is glibc's
      qsort(3).  As a merge sort, this needs a temporary array equal in size
      to the array that is to be sorted, but has a worst-case performance of
      O(n log n).
      
      The complexity that was removed is:
      
      * Doing direct stores for word-size and -aligned data.
      * Falling back to quicksort if the allocation required to perform the
        merge sort would likely push the machine into swap.
      
      Even with these simplifications, this seems to outperform the Windows
      qsort(3) implementation, even in Windows XP (where it is "fixed" and
      doesn't trigger O(n^2) complexity on trees).
      
      [jes: moved into compat/qsort.c, as per Johannes Sixt's suggestion]
      [bcd: removed gcc-ism, thanks to Edgar Toernig.  renamed make variable
            per Junio's comment.]
      Signed-off-by: NBrian Downing <bdowning@lavos.net>
      Signed-off-by: NSteffen Prohaska <prohaska@zib.de>
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      43fe901b