1. 15 7月, 2005 1 次提交
    • L
      Split up "diff_format" into "format" and "line_termination". · e68b6f15
      Linus Torvalds 提交于
      This removes the separate "formats" for name and name-with-zero-
      termination.
      
      It also removes the difference between HUMAN and MACHINE formats, and
      they both become DIFF_FORMAT_RAW, with the difference being just in the
      line and inter-filename termination.
      
      It also makes the code easier to understand.
      e68b6f15
  2. 14 7月, 2005 2 次提交
  3. 13 6月, 2005 1 次提交
    • J
      [PATCH] Add --diff-filter= output restriction to diff-* family. · f2ce9fde
      Junio C Hamano 提交于
      This is a halfway between debugging aid and a helper to write an
      ultra-smart merge scripts.  The new option takes a string that
      consists of a list of "status" letters, and limits the diff
      output to only those classes of changes, with two exceptions:
      
       - A broken pair (aka "complete rewrite"), does not match D
         (deleted) or N (created).  Use B to look for them.
      
       - The letter "A" in the diff-filter string does not match
         anything itself, but causes the entire diff that contains
         selected patches to be output (this behaviour is similar to
         that of --pickaxe-all for the -S option).
      
      For example,
      
          $ git-rev-list HEAD |
            git-diff-tree --stdin -s -v -B -C --diff-filter=BCR
      
      shows a list of commits that have complete rewrite, copy, or
      rename.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      f2ce9fde
  4. 04 6月, 2005 1 次提交
    • J
      [PATCH] diff: Fix docs and add -O to diff-helper. · ce240675
      Junio C Hamano 提交于
      This patch updates diff documentation and usage strings:
      
       - clarify the semantics of -R.  It is not "output in reverse";
         rather, it is "I will feed diff backwards".  Semantically
         they are different when -C is involved.
      
       - describe -O in usage strings of diff-* brothers.  It was
         implemented, documented but not described in usage text.
      
      Also it adds -O to diff-helper.  Like -S (and unlike -M/-C/-B),
      this option can work on sanitized diff-raw output produced by
      the diff-* brothers.  While we are at it, the call it makes to
      diffcore is cleaned up to use the diffcore_std() like everybody
      else, and the declaration for the low level diffcore routines
      are moved from diff.h (public) to diffcore.h (private between
      diff.c and diffcore backends).
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      ce240675
  5. 02 6月, 2005 1 次提交
    • J
      [PATCH] diff: mode bits fixes · 67574c40
      Junio C Hamano 提交于
      The core GIT repository has trees that record regular file mode
      in 0664 instead of normalized 0644 pattern.  Comparing such a
      tree with another tree that records the same file in 0644
      pattern without content changes with git-diff-tree causes it to
      feed otherwise unmodified pairs to the diff_change() routine,
      which triggers a sanity check routine and barfs.  This patch
      fixes the problem, along with the fix to another caller that
      uses unnormalized mode bits to call diff_change() routine in a
      similar way.
      
      Without this patch, you will see "fatal error" from diff-tree
      when you run git-deltafy-script on the core GIT repository
      itself.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      67574c40
  6. 31 5月, 2005 3 次提交
    • J
      [PATCH] Add -O<orderfile> option to diff-* brothers. · af5323e0
      Junio C Hamano 提交于
      A new diffcore filter diffcore-order is introduced.  This takes
      a text file each of whose line is a shell glob pattern.  Patches
      that match a glob pattern on an earlier line in the file are
      output before patches that match a later line, and patches that
      do not match any glob pattern are output last.
      
      A typical orderfile for git project probably should look like
      this:
      
          README
          Makefile
          Documentation
          *.h
          *.c
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      af5323e0
    • J
      [PATCH] Add -B flag to diff-* brothers. · f345b0a0
      Junio C Hamano 提交于
      A new diffcore transformation, diffcore-break.c, is introduced.
      
      When the -B flag is given, a patch that represents a complete
      rewrite is broken into a deletion followed by a creation.  This
      makes it easier to review such a complete rewrite patch.
      
      The -B flag takes the same syntax as the -M and -C flags to
      specify the minimum amount of non-source material the resulting
      file needs to have to be considered a complete rewrite, and
      defaults to 99% if not specified.
      
      As the new test t4008-diff-break-rewrite.sh demonstrates, if a
      file is a complete rewrite, it is broken into a delete/create
      pair, which can further be subjected to the usual rename
      detection if -M or -C is used.  For example, if file0 gets
      completely rewritten to make it as if it were rather based on
      file1 which itself disappeared, the following happens:
      
          The original change looks like this:
      
      	file0     --> file0' (quite different from file0)
      	file1     --> /dev/null
      
          After diffcore-break runs, it would become this:
      
      	file0     --> /dev/null
      	/dev/null --> file0'
      	file1     --> /dev/null
      
          Then diffcore-rename matches them up:
      
      	file1     --> file0'
      
      The internal score values are finer grained now.  Earlier
      maximum of 10000 has been raised to 60000; there is no user
      visible changes but there is no reason to waste available bits.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      f345b0a0
    • J
      [PATCH] diff: consolidate various calls into diffcore. · befe8639
      Junio C Hamano 提交于
      The three diff-* brothers had a sequence of calls into diffcore
      that were almost identical.  Introduce a new diffcore_std()
      function that takes all the necessary arguments to consolidate
      it.  This will make later enhancements and changing the order of
      diffcore application simpler.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      befe8639
  7. 30 5月, 2005 3 次提交
    • J
      [PATCH] Optimize diff-tree -[CM] --stdin · f0c6b2a2
      Junio C Hamano 提交于
      This attempts to optimize "diff-tree -[CM] --stdin", which
      compares successible tree pairs.  This optimization does not
      make much sense for other commands in the diff-* brothers.
      
      When reading from --stdin and using rename/copy detection, the
      patch makes diff-tree to read the current index file first.
      This is done to reuse the optimization used by diff-cache in the
      non-cached case.  Similarity estimator can avoid expanding a
      blob if the index says what is in the work tree has an exact
      copy of that blob already expanded.
      
      Another optimization the patch makes is to check only file sizes
      first to terminate similarity estimation early.  In order for
      this to work, it needs a way to tell the size of the blob
      without expanding it.  Since an obvious way of doing it, which
      is to keep all the blobs previously used in the memory, is too
      costly, it does so by keeping the filesize for each object it
      has already seen in memory.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      f0c6b2a2
    • J
      [PATCH] Add --pickaxe-all to diff-* brothers. · 367cec1c
      Junio C Hamano 提交于
      When --pickaxe-all is given in addition to -S, pickaxe shows the
      entire diffs contained in the changeset, not just the diffs for
      the filepair that touched the sought-after string.  This is
      useful to see the changes in context.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      367cec1c
    • J
      [PATCH] Clean up diff_setup() to make it more extensible. · 19feebc8
      Junio C Hamano 提交于
      This changes the argument of diff_setup() from an integer that
      says if we are feeding reversed diff to a bitmask, so that later
      global options can be added more easily.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      19feebc8
  8. 24 5月, 2005 2 次提交
  9. 23 5月, 2005 1 次提交
    • J
      [PATCH] Diffcore updates. · 6b14d7fa
      Junio C Hamano 提交于
      This moves the path selection logic from individual programs to a new
      diffcore transformer (diff-tree still needs to have its own for
      performance reasons).  Also the header printing code in diff-tree was
      tweaked not to produce anything when pickaxe is in effect and there is
      nothing interesting to report.  An interesting example is the following
      in the GIT archive itself:
      
          $ git-whatchanged -p -C -S'or something in a real script'
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      6b14d7fa
  10. 22 5月, 2005 4 次提交
  11. 20 5月, 2005 1 次提交
    • J
      [PATCH] diff overhaul · 57fe64a4
      Junio C Hamano 提交于
      This cleans up the way calls are made into the diff core from diff-tree
      family and diff-helper.  Earlier, these programs had "if
      (generating_patch)" sprinkled all over the place, but those ugliness are
      gone and handled uniformly from the diff core, even when not generating
      patch format.
      
      This also allowed diff-cache and diff-files to acquire -R
      (reverse) option to generate diff in reverse.  Users of
      diff-tree can swap two trees easily so I did not add -R there.
      
      [ Linus' note: I'll add -R to "diff-tree" too, since a "commit
        diff" doesn't have another tree to switch around: the other
        tree is always the parent(s) of the commit ]
      
      Also -M<digits-as-mantissa> suggestion made by Linus has been
      implemented.
      
      Documentation updates are also included.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      57fe64a4
  12. 19 5月, 2005 2 次提交
    • J
      [PATCH] Detect renames in diff family. · 5c97558c
      Junio C Hamano 提交于
      This rips out the rename detection engine from diff-helper and moves it
      to the diff core, and updates the internal calling convention used by
      diff-tree family into the diff core.  In order to give the same option
      name to diff-tree family as well as to diff-helper, I've changed the
      earlier diff-helper '-r' option to '-M' (stands for Move; sorry but the
      natural abbreviation 'r' for 'rename' is already taken for 'recursive').
      
      Although I did a fair amount of test with the git-diff-tree with
      existing rename commits in the core GIT repository, this should still be
      considered beta (preview) release.  This patch depends on the diff-delta
      infrastructure just committed.
      
      This implements almost everything I wanted to see in this series of
      patch, except a few minor cleanups in the calling convention into diff
      core, but that will be a separate cleanup patch.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      5c97558c
    • J
      [PATCH] Diff-helper update · 915838c3
      Junio C Hamano 提交于
      This patch adds a framework and a stub implementation of rename
      detection to diff-helper program.
      
      The current stub code is just enough to detect pure renames in
      diff-tree output and not fancier.  The plan is perhaps to use
      the same delta code when Nico's delta storage patch is merged
      for similarity evaluation purposes.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      915838c3
  13. 15 5月, 2005 1 次提交
    • J
      [PATCH 2/3] Rename git-diff-tree-helper to git-diff-helper. · 99665af5
      Junio C Hamano 提交于
      It used to be that diff-tree needed helper support to parse its
      raw output to generate diffs, but these days git-diff-* family
      produces the same output and the helper is not tied to diff-tree
      anymore.  Drop "tree" from its name.
      
      This commit is done separately to record just the rename and no
      file content changes. The changes in the renamed files are recorded
      in the next commit.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      
      Bundled with the changes in the unrenamed files.
      Signed-off-by: NPetr Baudis <pasky@ucw.cz>
      99665af5
  14. 04 5月, 2005 1 次提交
    • J
      Optimize diff-cache -p --cached · b46f0b6d
      Junio C Hamano 提交于
      This patch optimizes "diff-cache -p --cached" by avoiding to
      inflate blobs into temporary files when the blob recorded in the
      cache matches the corresponding file in the work tree.  The file
      in the work tree is passed as the comparison source in such a
      case instead.
      
      This optimization kicks in only when we have already read the
      cache this optimization and this is deliberate.  Especially,
      diff-tree does not use this code, because changes are contained
      in small number of files relative to the project size most of
      the time, and reading cache is so expensive for a large project
      that the cost of reading it outweighs the savings by not
      inflating blobs.
      
      Also this patch cleans up the structure passed from diff clients
      by removing one unused structure member.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      b46f0b6d
  15. 28 4月, 2005 1 次提交
    • J
      [PATCH] Reworked external diff interface. · 77eb2720
      Junio C Hamano 提交于
      This introduces three public functions for diff-cache and friends can
      use to call out to the GIT_EXTERNAL_DIFF program when they wish to.
      
      A normal "add/remove/change" entry is turned into 7-parameter process
      invocation of GIT_EXTERNAL_DIFF program as before.  In addition, the
      program can now be called with a single parameter when diff-cache and
      friends want to report an unmerged path. 
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      77eb2720
  16. 27 4月, 2005 1 次提交
    • J
      [PATCH] Diff-tree-helper take two. · be3cfa85
      Junio C Hamano 提交于
      This reworks the diff-tree-helper and show-diff to further make external
      diff command interface simpler.
      
      These commands now honor GIT_EXTERNAL_DIFF environment variable which
      can point at an arbitrary program that takes 7 parameters:
      
        name file1 file1-sha1 file1-mode file2 file2-sha1 file2-mode
      
      The parameters for an external diff command are as follows:
      
        name        this invocation of the command is to emit diff
      	      for the named cache/tree entry.
      
        file1       pathname that holds the contents of the first
      	      file.  This can be a file inside the working
      	      tree, or a temporary file created from the blob
      	      object, or /dev/null.  The command should not
      	      attempt to unlink it -- the temporary is
      	      unlinked by the caller.
      
        file1-sha1  sha1 hash if file1 is a blob object, or "."
      	      otherwise.
      
        file1-mode  mode bits for file1, or "." for a deleted file.
      
      If GIT_EXTERNAL_DIFF environment variable is not set, the
      default is to invoke diff with the set of parameters old
      show-diff used to use.  This built-in implementation honors the
      GIT_DIFF_CMD and GIT_DIFF_OPTS environment variables as before.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      be3cfa85
  17. 26 4月, 2005 1 次提交