1. 25 5月, 2011 1 次提交
    • J
      combine-diff: respect textconv attributes · 0508fe53
      Jeff King 提交于
      When doing a combined diff, we did not respect textconv attributes at
      all. This generally lead to us printing "Binary files differ" when we
      could show a combined diff of the converted text.
      
      This patch converts file contents according to textconv attributes. The
      implementation is slightly ugly; because the textconv code is tightly
      linked with the diff_filespec code, we temporarily create a diff_filespec
      during conversion. In practice, though, this should not create a
      performance problem.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      0508fe53
  2. 24 5月, 2011 4 次提交
    • J
      refactor get_textconv to not require diff_filespec · 3813e690
      Jeff King 提交于
      This function actually does two things:
      
        1. Load the userdiff driver for the filespec.
      
        2. Decide whether the driver has a textconv component, and
           initialize the textconv cache if applicable.
      
      Only part (1) requires the filespec object, and some callers
      may not have a filespec at all. So let's split them it into
      two functions, and put part (2) with the userdiff code,
      which is a better fit.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      3813e690
    • J
      combine-diff: handle binary files as binary · 4d5f3471
      Jeff King 提交于
      The combined diff code path is totally different from the
      regular diff code path, and didn't handle binary files at
      all. The results of a combined diff on a binary file could
      range from annoying (since we spewed binary garbage,
      possibly upsetting the user's terminal), to wrong (embedded
      NULs caused us to show incorrect diffs, with lines truncated
      at the NUL character), to potential security problems
      (embedded NULs could interfere with "-z" output, possibly
      defeating policy hooks which parse diff output).
      
      Instead, we consider a combined diff to be binary if any of
      the input blobs is binary. To show a binary combined diff,
      we indicate "Binary blobs differ"; the "index" meta line
      will show which parents had which blob.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4d5f3471
    • J
      combine-diff: calculate mode_differs earlier · c95b99bb
      Jeff King 提交于
      One loop combined both the patch generation and checking
      whether there was any mode change to report. Let's factor
      that into two separate loops, as we may care about the mode
      change even if we are not generating patches (e.g., because
      we are showing a binary diff, which will come in a future
      patch).
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c95b99bb
    • J
      combine-diff: split header printing into its own function · 7c978a06
      Jeff King 提交于
      This is a pretty big logical chunk, so it makes the function
      a bit more readable to have it split out. In addition, it
      will make it easier to add an alternate code path for binary
      diffs in a future patch.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7c978a06
  3. 21 5月, 2011 2 次提交
  4. 20 5月, 2011 17 次提交
  5. 19 5月, 2011 1 次提交
  6. 18 5月, 2011 1 次提交
  7. 17 5月, 2011 14 次提交