1. 11 4月, 2006 2 次提交
  2. 05 4月, 2006 1 次提交
    • P
      Support for pickaxe matching regular expressions · d01d8c67
      Petr Baudis 提交于
      git-diff-* --pickaxe-regex will change the -S pickaxe to match
      POSIX extended regular expressions instead of fixed strings.
      
      The regex.h library is a rather stupid interface and I like pcre too, but
      with any luck it will be everywhere we will want to run Git on, it being
      POSIX.2 and all. I'm not sure if we can expect platforms like AIX to
      conform to POSIX.2 or if win32 has regex.h. We might add a flag to
      Makefile if there is a portability trouble potential.
      Signed-off-by: NPetr Baudis <pasky@suse.cz>
      d01d8c67
  3. 30 3月, 2006 1 次提交
    • J
      tree/diff header cleanup. · 1b0c7174
      Junio C Hamano 提交于
      Introduce tree-walk.[ch] and move "struct tree_desc" and
      associated functions from various places.
      
      Rename DIFF_FILE_CANON_MODE(mode) macro to canon_mode(mode) and
      move it to cache.h.  This macro returns the canonicalized
      st_mode value in the host byte order for files, symlinks and
      directories -- to be compared with a tree_desc entry.
      create_ce_mode(mode) in cache.h is similar but is intended to be
      used for index entries (so it does not work for directories) and
      returns the value in the network byte order.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      1b0c7174
  4. 10 2月, 2006 3 次提交
    • J
      combine-diff: Record diff status a bit more faithfully · d416df88
      Junio C Hamano 提交于
      This shows "new file mode XXXX" and "deleted file mode XXXX"
      lines like two-way diff-patch output does, by checking the
      status from each parent.
      
      The diff-raw output for combined diff is made a bit uglier by
      showing diff status letters with each parent.  While most of the
      case you would see "MM" in the output, an Evil Merge that
      touches a path that was added by inheriting from one parent is
      possible and it would be shown like these:
      
          $ git-diff-tree --abbrev -c HEAD
          2d7ca89675eb8888b0b88a91102f096d4471f09f
          ::000000 000000 100644 0000000... 0000000... 31dd686... AA	b
          ::000000 100644 100644 0000000... 6c884ae... c6d4fa8... AM	d
          ::100644 100644 100644 4f7cbe7... f8c295c... 19d5d80... RR	e
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      d416df88
    • J
      combine-diff: move formatting logic to show_combined_diff() · 0a798076
      Junio C Hamano 提交于
      This way, diff-files can make use of it.  Also implement the
      full suite of what diff_flush_raw() supports just for
      consistency.  With this, 'diff-tree -c -r --name-status' would
      show what is expected.
      
      There is no way to get the historical output (useful for
      debugging and low-level Plumbing work) anymore, so tentatively
      it makes '-m' to mean "do not combine and show individual diffs
      with parents".
      
      diff-files matches diff-tree to produce raw output for -c.  For
      textual combined diff, use -p -c.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      0a798076
    • L
      diff-tree -c raw output · ee638024
      Linus Torvalds 提交于
      NOTE! This makes "-c" be the default, which effectively means that merges 
      are never ignored any more, and "-m" is a no-op. So it changes semantics.
      
      I would also like to make "--cc" the default if you do patches, but didn't 
      actually do that.
      
      The raw output format is not wonderfully pretty, but it's distinguishable 
      from a "normal patch" in that a normal patch with just one parent has just 
      one colon at the beginning, while a multi-parent raw diff has <n> colons 
      for <n> parents.
      
      So now, in the kernel, when you do
      
      	git-diff-tree cce0cac125623f9b68f25dd1350f6d616220a8dd
      
      (to see the manual ARM merge that had a conflict in arch/arm/Kconfig), you 
      get
      
      	cce0cac125623f9b68f25dd1350f6d616220a8dd
      	::100644 100644 100644 4a63a8e2e45247a11c068c6ed66c6e7aba29ddd9 77eee38762d69d3de95ae45dd9278df9b8225e2c 2f61726d2f4b636f6e66696700dbf71a59dad287       arch/arm/Kconfig
      
      ie you see two colons (two parents), then three modes (parent modes 
      followed by result mode), then three sha1s (parent sha1s followed by
      result sha1).
      
      Which is pretty close to the normal raw diff output.
      
      Cool/stupid exercise:
      
      	$ git-whatchanged | grep '^::' | cut -f2- | sort |
      	  uniq -c | sort -n | less -S
      
      will show which files have needed the most file-level merge conflict
      resolution. Useful? Probably not. But kind of interesting.
      
      For the kernel, it's
      
           ....
           10 arch/ia64/Kconfig
           11 drivers/scsi/Kconfig
           12 drivers/net/Makefile
           17 include/linux/libata.h
           18 include/linux/pci_ids.h
           23 drivers/net/Kconfig
           24 drivers/scsi/libata-scsi.c
           28 drivers/scsi/libata-core.c
           43 MAINTAINERS
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      ee638024
  5. 07 2月, 2006 1 次提交
  6. 06 2月, 2006 1 次提交
  7. 01 2月, 2006 1 次提交
  8. 28 1月, 2006 4 次提交
    • J
      abbrev cleanup: use symbolic constants · 46a6c262
      Junio C Hamano 提交于
      The minimum length of abbreviated object name was hardcoded in
      different places to be 4, risking inconsistencies in the future.
      Also there were three different "default abbreviation
      precision".  Use two C preprocessor symbols to clean up this
      mess.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      46a6c262
    • J
      diff-files: -c and --cc options. · ea726d02
      Junio C Hamano 提交于
      This ports the "combined diff" to diff-files so that differences
      to the working tree files since stage 2 and stage 3 are shown
      the same way as combined diff output from diff-tree for the
      merge commit would be shown if the current working tree files
      are committed.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      ea726d02
    • J
      diff-tree --cc: denser combined diff output for a merge commit. · d8f4790e
      Junio C Hamano 提交于
      Building on the previous '-c' (combined) option, '--cc' option
      squelches the output further by omitting hunks that consist of
      difference with solely one parent.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      d8f4790e
    • J
      diff-tree -c: show a merge commit a bit more sensibly. · af3feefa
      Junio C Hamano 提交于
      A new option '-c' to diff-tree changes the way a merge commit is
      displayed when generating a patch output.  It shows a "combined
      diff" (hence the option letter 'c'), which looks like this:
      
          $ git-diff-tree --pretty -c -p fec9ebf1 | head -n 18
          diff-tree fec9ebf1... (from parents)
          Merge: 0620db36... 8a263aeb...
          Author: Junio C Hamano <junkio@cox.net>
          Date:   Sun Jan 15 22:25:35 2006 -0800
      
      	Merge fixes up to GIT 1.1.3
      
          diff --combined describe.c
          @@@ +98,7 @@@
      	    return (a_date > b_date) ? -1 : (a_date == b_date) ? 0 : 1;
             }
      
          -  static void describe(char *arg)
           - static void describe(struct commit *cmit, int last_one)
          ++ static void describe(char *arg, int last_one)
             {
           +      unsigned char sha1[20];
           +      struct commit *cmit;
      
      There are a few things to note about this feature:
      
       - The '-c' option implies '-p'.  It also implies '-m' halfway
         in the sense that "interesting" merges are shown, but not all
         merges.
      
       - When a blob matches one of the parents, we do not show a diff
         for that path at all.  For a merge commit, this option shows
         paths with real file-level merge (aka "interesting things").
      
       - As a concequence of the above, an "uninteresting" merge is
         not shown at all.  You can use '-m' in addition to '-c' to
         show the commit log for such a merge, but there will be no
         combined diff output.
      
       - Unlike "gitk", the output is monochrome.
      
      A '-' character in the nth column means the line is from the nth
      parent and does not appear in the merge result (i.e. removed
      from that parent's version).
      
      A '+' character in the nth column means the line appears in the
      merge result, and the nth parent does not have that line
      (i.e. added by the merge itself or inherited from another
      parent).
      
      The above example output shows that the function signature was
      changed from either parents (hence two "-" lines and a "++"
      line), and "unsigned char sha1[20]", prefixed by a " +", was
      inherited from the first parent.
      
      The code as sent to the list was buggy in few corner cases,
      which I have fixed since then.
      
      It does not bother to keep track of and show the line numbers
      from parent commits, which it probably should.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      af3feefa
  9. 20 12月, 2005 2 次提交
  10. 22 11月, 2005 1 次提交
  11. 17 11月, 2005 2 次提交
  12. 29 10月, 2005 1 次提交
  13. 23 10月, 2005 1 次提交
    • L
      Split up tree diff functions into tree-diff.c library · ac1b3d12
      Linus Torvalds 提交于
      This makes the tree diff functionality independent of the "git-diff-tree"
      program, by splitting the core functionality up into a library file.
      
      This will be needed for when we teach git-rev-list to only follow a
      specified set of pathnames, rather than the global revision history.
      
      Most of it is a fairly straightforward code move, but it also involves
      some calling convention cleanup, and moving some of the static variables
      from diff-tree.c into the options structure.
      
      The actual tree change callback routines also become paramterized by the
      diff_options structure, allowing the library functionality to do something
      else than just show the diff on stdout.
      
      Right now the only user of this functionality remains git-diff-tree
      itself.
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      ac1b3d12
  14. 05 10月, 2005 1 次提交
    • J
      Fix diff-filter All-Or-None mark. · 0b34379a
      Junio C Hamano 提交于
      When we updated the marker for new files from 'N' to 'A', we forgot to
      notice that the letter is already taken by the All-Or-None mark.
      Change the All-Or-None marker to '*' to resolve this conflict.
      
      	git-diff-tree -r --diff-filter='R*' -M
      
      shows all the changes (not just renames) that are contained in commits
      that have renames, in comparison with:
      
      	git-diff-tree -r --diff-filter='R' -M
      
      shows the same set of changes but the diff output are limited only to
      renaming changes.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      0b34379a
  15. 25 9月, 2005 3 次提交
  16. 22 9月, 2005 1 次提交
  17. 26 7月, 2005 2 次提交
  18. 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
  19. 14 7月, 2005 2 次提交
  20. 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
  21. 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
  22. 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
  23. 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
  24. 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