1. 07 1月, 2007 1 次提交
    • J
      diff-index --cached --raw: show tree entry on the LHS for unmerged entries. · e9c84099
      Junio C Hamano 提交于
      This updates the way diffcore represents an unmerged pair
      somewhat.  It used to be that entries with mode=0 on both sides
      were used to represent an unmerged pair, but now it has an
      explicit flag.  This is to allow diff-index --cached to report
      the entry from the tree when the path is unmerged in the index.
      
      This is used in updating "git reset <tree> -- <path>" to restore
      absense of the path in the index from the tree.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      e9c84099
  2. 22 12月, 2006 1 次提交
  3. 21 12月, 2006 1 次提交
    • J
      simplify inclusion of system header files. · 85023577
      Junio C Hamano 提交于
      This is a mechanical clean-up of the way *.c files include
      system header files.
      
       (1) sources under compat/, platform sha-1 implementations, and
           xdelta code are exempt from the following rules;
      
       (2) the first #include must be "git-compat-util.h" or one of
           our own header file that includes it first (e.g. config.h,
           builtin.h, pkt-line.h);
      
       (3) system headers that are included in "git-compat-util.h"
           need not be included in individual C source files.
      
       (4) "git-compat-util.h" does not have to include subsystem
           specific header files (e.g. expat.h).
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      85023577
  4. 20 12月, 2006 1 次提交
  5. 16 12月, 2006 2 次提交
    • N
      make commit message a little more consistent and conforting · ebd124c6
      Nicolas Pitre 提交于
      It is nicer to let the user know when a commit succeeded all the time,
      not only the first time.  Also the commit sha1 is much more useful than
      the tree sha1 in this case.
      
      This patch also introduces a -q switch to supress this message as well
      as the summary of created/deleted files.
      Signed-off-by: NNicolas Pitre <nico@cam.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      ebd124c6
    • S
      Avoid accessing a slow working copy during diffcore operations. · 1510fea7
      Shawn O. Pearce 提交于
      The Cygwin folks have done a fine job at creating a POSIX layer
      on Windows That Just Works(tm).  However it comes with a penalty;
      accessing files in the working tree by way of stat/open/mmap can
      be slower for diffcore than inflating the data from a blob which
      is stored in a packfile.
      
      This performance problem is especially an issue in merge-recursive
      when dealing with nearly 7000 added files, as we are loading
      each file's content from the working directory to perform rename
      detection.  I have literally seen (and sadly watched) paint dry in
      less time than it takes for merge-recursive to finish such a merge.
      On the other hand this very same merge runs very fast on Solaris.
      
      If Git is compiled with NO_FAST_WORKING_DIRECTORY set then we will
      avoid looking at the working directory when the blob in question
      is available within a packfile and the caller doesn't need the data
      unpacked into a temporary file.
      
      We don't use loose objects as they have the same open/mmap/close
      costs as the working directory file access, but have the additional
      CPU overhead of needing to inflate the content before use.  So it
      is still faster to use the working tree file over the loose object.
      
      If the caller needs the file data unpacked into a temporary file
      its likely because they are going to call an external diff program,
      passing the file as a parameter.  In this case reusing the working
      tree file will be faster as we don't need to inflate the data and
      write it out to a temporary file.
      
      The NO_FAST_WORKING_DIRECTORY feature is enabled by default on
      Cygwin, as that is the platform which currently appears to benefit
      the most from this option.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      1510fea7
  6. 13 12月, 2006 1 次提交
    • A
      Allow subcommand.color and color.subcommand color configuration · a159ca0c
      Andy Parkins 提交于
      While adding colour to the branch command it was pointed out that a
      config option like "branch.color" conflicts with the pre-existing
      "branch.something" namespace used for specifying default merge urls and
      branches.  The suggested solution was to flip the order of the
      components to "color.branch", which I did for colourising branch.
      
      This patch does the same thing for
        - git-log (color.diff)
        - git-status (color.status)
        - git-diff (color.diff)
        - pager (color.pager)
      
      I haven't removed the old config options; but they should probably be
      deprecated and eventually removed to prevent future namespace
      collisions.  I've done this deprecation by changing the documentation
      for the config file to match the new names; and adding the "color.XXX"
      options to contrib/completion/git-completion.bash.
      
      Unfortunately git-svn reads "diff.color" and "pager.color"; which I
      don't like to change unilaterally.
      Signed-off-by: NAndy Parkins <andyparkins@gmail.com>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      a159ca0c
  7. 12 12月, 2006 1 次提交
  8. 14 10月, 2006 1 次提交
  9. 06 10月, 2006 1 次提交
    • J
      Turn on recursive with --summary · d7014dc0
      Johannes Schindelin 提交于
      This makes "git log/diff --summary" imply recursive behaviour,
      whose effect is summarized in one test output:
      
          --- a/t/t4013/diff.diff-tree_--pretty_--root_--summary_initial
          +++ b/t/t4013/diff.diff-tree_--pretty_--root_--summary_initial
          @@ -5,7 +5,7 @@ Date:   Mon Jun 26 00:00:00 2006 +0000
      
      	 Initial
      
          - create mode 040000 dir
          + create mode 100644 dir/sub
            create mode 100644 file0
            create mode 100644 file2
           $
      
      When a file is created in a subdirectory, we used to say just
      the directory name only when that directory also was created,
      which did not make sense from two reasons.  It is not any more
      significant to create a new file in a new directory than to
      create a new file in an existing directory, and even if it were,
      reportinging the new directory name without saying the actual
      filename is not useful.
      Signed-off-by: NJohannes Schindelin <Johannes.Schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      d7014dc0
  10. 30 9月, 2006 1 次提交
  11. 29 9月, 2006 3 次提交
  12. 27 9月, 2006 2 次提交
  13. 24 9月, 2006 1 次提交
  14. 09 9月, 2006 1 次提交
  15. 08 9月, 2006 1 次提交
  16. 07 9月, 2006 1 次提交
  17. 02 9月, 2006 1 次提交
    • S
      Replace uses of strdup with xstrdup. · 9befac47
      Shawn Pearce 提交于
      Like xmalloc and xrealloc xstrdup dies with a useful message if
      the native strdup() implementation returns NULL rather than a
      valid pointer.
      
      I just tried to use xstrdup in new code and found it to be missing.
      However I expected it to be present as xmalloc and xrealloc are
      already commonly used throughout the code.
      
      [jc: removed the part that deals with last_XXX, which I am
       finding more and more dubious these days.]
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      9befac47
  18. 24 8月, 2006 1 次提交
    • S
      Convert memcpy(a,b,20) to hashcpy(a,b). · e702496e
      Shawn Pearce 提交于
      This abstracts away the size of the hash values when copying them
      from memory location to memory location, much as the introduction
      of hashcmp abstracted away hash value comparsion.
      
      A few call sites were using char* rather than unsigned char* so
      I added the cast rather than open hashcpy to be void*.  This is a
      reasonable tradeoff as most call sites already use unsigned char*
      and the existing hashcmp is also declared to be unsigned char*.
      
      [jc: Splitted the patch to "master" part, to be followed by a
       patch for merge-recursive.c which is not in "master" yet.
      
       Fixed the cast in the latter hunk to combine-diff.c which was
       wrong in the original.
      
       Also converted ones left-over in combine-diff.c, diff-lib.c and
       upload-pack.c ]
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      e702496e
  19. 18 8月, 2006 1 次提交
  20. 17 8月, 2006 1 次提交
  21. 16 8月, 2006 2 次提交
  22. 15 8月, 2006 1 次提交
  23. 11 8月, 2006 1 次提交
  24. 10 8月, 2006 2 次提交
  25. 04 8月, 2006 1 次提交
    • J
      diff.c: do not use pathname comparison to tell renames · ef677686
      Junio C Hamano 提交于
      The final output from diff used to compare pathnames between
      preimage and postimage to tell if the filepair is a rename/copy.
      By explicitly marking the filepair created by diffcore_rename(),
      the output routine, resolve_rename_copy(), does not have to do
      so anymore.  This helps feeding a filepair that has different
      pathnames in one and two elements to the diff machinery (most
      notably, comparing two blobs).
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      ef677686
  26. 01 8月, 2006 1 次提交
  27. 24 7月, 2006 1 次提交
    • J
      Colorize 'commit' lines in log ui · ce436973
      Jeff King 提交于
      When paging through the output of git-whatchanged, the color cues help to
      visually navigate within a diff. However, it is difficult to notice when a
      new commit starts, because the commit and log are shown in the "normal"
      color. This patch colorizes the 'commit' line, customizable through
      diff.colors.commit and defaulting to yellow.
      
      As a side effect, some of the diff color engine (slot enum, get_color) has
      become accessible outside of diff.c.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      ce436973
  28. 14 7月, 2006 2 次提交
  29. 10 7月, 2006 1 次提交
    • S
      Avoid C99 initializers · 344c52ae
      Shawn Pearce 提交于
      In a handful places, we use C99 structure and array
      initializers, which some compilers do not support.
      
      This can be handy when you are trying to compile GIT on a
      Solaris system that has an older C compiler, for example.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      344c52ae
  30. 09 7月, 2006 1 次提交
    • J
      "git -p cmd" to page anywhere · 85fb65ed
      Junio C Hamano 提交于
      This allows you to say:
      
      	git -p diff v2.6.16-rc5..
      
      and the command pipes the output of any git command to your pager.
      
      [jc: this resurrects a month old RFC patch with improvement
       suggested by Linus to call it --paginate instead of --less.]
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      85fb65ed
  31. 08 7月, 2006 3 次提交
    • J
      diff: do not use configuration magic at the core-level · 83ad63cf
      Junio C Hamano 提交于
      The Porcelainish has become so much usable as the UI that there
      is not much reason people should be using the core programs by
      hand anymore.  At this point we are better off making the
      behaviour of the core programs predictable by keeping them
      unaffected by the configuration variables.  Otherwise they will
      become very hard to use as reliable building blocks.
      
      For example, "git-commit -a" internally uses git-diff-files to
      figure out the set of paths that need to be updated in the
      index, and we should never allow diff.renames that happens to be
      in the configuration to interfere (or slow down the process).
      
      The UI level configuration such as showing renamed diff and
      coloring are still honored by the Porcelainish ("git log" family
      and "git diff"), but not by the core anymore.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      83ad63cf
    • J
      colored diff: diff.color = auto fix · a0c2089c
      Junio C Hamano 提交于
      Even if the standard output is connected to a tty, do not
      colorize the diff if we are talking to a dumb terminal when
      diff.color configuration variable is set to "auto".
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      a0c2089c
    • J
      fef88bb0