1. 28 6月, 2006 3 次提交
  2. 27 6月, 2006 5 次提交
  3. 25 6月, 2006 2 次提交
    • J
      diff --color: use $GIT_DIR/config · 801235c5
      Junio C Hamano 提交于
      This lets you use something like this in your $GIT_DIR/config
      file.
      
      	[diff]
      		color = auto
      
      	[diff.color]
      		new = blue
      		old = yellow
      		frag = reverse
      
      When diff.color is set to "auto", colored diff is enabled when
      the standard output is the terminal.  Other choices are "always",
      and "never".  Usual boolean true/false can also be used.
      
      The colormap entries can specify colors for the following slots:
      
      	plain	- lines that appear in both old and new file (context)
      	meta	- diff --git header and extended git diff headers
      	frag	- @@ -n,m +l,k @@ lines (hunk header)
      	old	- lines deleted from old file
      	new	- lines added to new file
      
      The following color names can be used:
      
      	normal, bold, dim, l, blink, reverse, reset,
      	black, red, green, yellow, blue, magenta, cyan,
      	white
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      801235c5
    • T
      Clean up diff.c · d2543b8e
      Timo Hirvonen 提交于
      Signed-off-by: NTimo Hirvonen <tihirvon@gmail.com>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      d2543b8e
  4. 24 6月, 2006 2 次提交
  5. 23 6月, 2006 1 次提交
    • L
      Tweak diff colors · 50f575fc
      Linus Torvalds 提交于
      This patch does:
      
       - always reset the color _before_ printing out the newline.
      
         This is actually important. You (and Johannes) didn't see it, because
         it only matters if you set the background, but if you don't do this,
         you get some random and funky behaviour if you pick a color with a
         non-default background (which still potentially has problems with tabs
         etc, but less so).
      
       - allow people to have a different color for the "file headers"
         (DIFF_METAINFO) and for the "fragment header" (DIFF_FRAGINFO). Also,
         make a difference between "normal color" and "reset colors"
      
       - default to red/green for old/new lines. That's the norm, I'd think.
      
       - instead of that eye-popping (and eye-ball-with-a-fondue-fork-popping)
         purple color for metadata, use bold-face for file headers, and cyan for
         the frag headers. I actually prefer the "gray background" for that, but
         it only works well in xterms, so COLOR_CYAN it is..
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      50f575fc
  6. 20 6月, 2006 1 次提交
  7. 18 6月, 2006 1 次提交
  8. 24 5月, 2006 1 次提交
  9. 23 5月, 2006 1 次提交
  10. 22 5月, 2006 1 次提交
  11. 21 5月, 2006 3 次提交
  12. 15 5月, 2006 3 次提交
  13. 09 5月, 2006 1 次提交
    • L
      Fix "git diff --stat" with long filenames · 5d6a9f45
      Linus Torvalds 提交于
      When we cut off the front of a filename to make it fit on the line, we add
      a "..." in front. However, the way the "git diff" code was written, we
      will never reset the prefix back to the empty string, so every single
      filename afterwards will have the "..." prefix, whether appropriate or
      not.
      
      You can see this with "git diff v2.6.16.." on the current kernel tree,
      since there are filenames with long names that changed there:
      
       [ snip snip ]
       Documentation/filesystems/vfs.txt                  |  229
       .../firmware_class/firmware_sample_driver.c        |    3
       .../firmware_sample_firmware_class.c               |    1
       ...Documentation/fujitsu/frv/kernel-ABI.txt           |  192
       ...Documentation/hwmon/w83627hf                       |    4
       [ snip snip ]
      
      notice how the two Documentation/firmware** filenames caused the "..." to
      be added, but then the later filenames don't want it, and it also screws
      up the alignment of the line numbering afterwards.
      
      Trivially fixed by moving the declaration (and initial setting) of the
      "prefix" variable into the for-loop where it is used.
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      5d6a9f45
  14. 06 5月, 2006 2 次提交
    • J
      binary diff: further updates. · 0660626c
      Junio C Hamano 提交于
      This updates the user interface and generated diff data format.
      
       * "diff --binary" is used to signal that we want an e-mailable
         binary patch.  It implies --full-index and -p.
      
       * "apply --allow-binary-replacement" acquired a short synonym
         "apply --binary".
      
       * After the "GIT binary patch\n" header line there is a token
         to record which binary patch mechanism was used, so that we
         can extend it later.  Currently there are two mechanisms
         defined: "literal" and "delta".  The former records the
         deflated postimage and the latter records the deflated delta
         from the preimage to postimage.
      
         For purely implementation convenience, I added the deflated
         length after these "literal/delta" tokens (otherwise the
         decoding side needs to guess and reallocate the buffer while
         inflating).  Improvement patches are very welcomed.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      0660626c
    • J
      binary patch. · 051308f6
      Junio C Hamano 提交于
      This adds "binary patch" to the diff output and teaches apply
      what to do with them.
      
      On the diff generation side, traditionally, we said "Binary
      files differ\n" without giving anything other than the preimage
      and postimage object name on the index line.  This was good
      enough for applying a patch generated from your own repository
      (very useful while rebasing), because the postimage would be
      available in such a case.  However, this was not useful when the
      recipient of such a patch via e-mail were to apply it, even if
      the preimage was available.
      
      This patch allows the diff to generate "binary" patch when
      operating under --full-index option.  The binary patch follows
      the usual extended git diff headers, and looks like this:
      
      	"GIT binary patch\n"
      	<length byte><data>"\n"
      	...
      	"\n"
      
      Each line is prefixed with a "length-byte", whose value is upper
      or lowercase alphabet that encodes number of bytes that the data
      on the line decodes to (1..52 -- 'A' means 1, 'B' means 2, ...,
      'Z' means 26, 'a' means 27, ...).  <data> is 1 or more groups of
      5-byte sequence, each of which encodes up to 4 bytes in base85
      encoding.  Because 52 / 4 * 5 = 65 and we have the length byte,
      an output line is capped to 66 characters.  The payload is the
      same diff-delta as we use in the packfiles.
      
      On the consumption side, git-apply now can decode and apply the
      binary patch when --allow-binary-replacement is given, the diff
      was generated with --full-index, and the receiving repository
      has the preimage blob, which is the same condition as it always
      required when accepting an "Binary files differ\n" patch.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      051308f6
  15. 04 5月, 2006 1 次提交
    • L
      sha1_to_hex() usage cleanup · dcb3450f
      Linus Torvalds 提交于
      Somebody on the #git channel complained that the sha1_to_hex() thing uses
      a static buffer which caused an error message to show the same hex output
      twice instead of showing two different ones.
      
      That's pretty easily rectified by making it uses a simple LRU of a few
      buffers, which also allows some other users (that were aware of the buffer
      re-use) to be written in a more straightforward manner.
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      dcb3450f
  16. 26 4月, 2006 1 次提交
  17. 22 4月, 2006 1 次提交
    • J
      Libify diff-files. · 6973dcae
      Junio C Hamano 提交于
      This is the first installment to libify diff brothers.
      
      The updated diff-files uses revision.c::setup_revisions()
      infrastructure to parse its command line arguments, which means
      the pathname arguments are checked more strictly than before.
      The tests are adjusted to separate possibly missing paths from
      the rest of arguments with double-dashes, to show the kosher
      way.
      
      As Linus pointed out, renaming diff.c to diff-lib.c was simply
      stupid, so I am renaming it back.  The new diff-lib.c is to
      contain pieces extracted from diff brothers.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      6973dcae
  18. 20 4月, 2006 2 次提交
  19. 19 4月, 2006 3 次提交
  20. 16 4月, 2006 3 次提交
  21. 14 4月, 2006 2 次提交