git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] diff: don't retrieve binary blobs for diffstat

From
Jeff King <peff@peff.net>
Date
Feb 22, 2011, 15:37 UTC
Message-ID
<20110222153729.GA27178@sigill.intra.peff.net>
In-Reply-To
<7v62sdhsjy.fsf@alter.siamese.dyndns.org>
On Mon, Feb 21, 2011 at 03:33:05PM -0800, Junio C Hamano wrote:
Show 9 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> > We only need the size, which is much cheaper to get,
> > especially if it is a big binary file.
> >
> > Signed-off-by: Jeff King <peff@peff.net>
> > ---
> 
> Nice ;-)  Do we want a test or two for 1/2 by the way?

Yeah, it's probably a good idea. Can you squash this in, or should I resend?

---
diff --git a/t/t4031-diff-rewrite-binary.sh b/t/t4031-diff-rewrite-binary.sh
index 7e7b307..7d7470f 100755
--- a/t/t4031-diff-rewrite-binary.sh
+++ b/t/t4031-diff-rewrite-binary.sh
@@ -44,6 +44,13 @@ test_expect_success 'rewrite diff can show binary patch' '
 	grep "GIT binary patch" diff
 '
 
+test_expect_success 'rewrite diff --stat shows binary changes' '
+	git diff -B --stat --summary >diff &&
+	grep "Bin" diff &&
+	grep "0 insertions.*0 deletions" diff &&
+	grep " rewrite file" diff
+'
+
 {
 	echo "#!$SHELL_PATH"
 	cat <<'EOF'
Previous: Junio C HamanoNext: Junio C Hamano
Message 11 of 12 in “Commit/merge messages for binary files”
  1. Piotr KrukowieckiFeb 17, 2011
  2. Matthieu MoyFeb 18, 2011
  3. Piotr KrukowieckiFeb 18, 2011
  4. Matthieu MoyFeb 18, 2011
  5. Piotr KrukowieckiFeb 18, 2011
  6. Jeff KingFeb 19, 2011
  7. Jeff KingFeb 19, 2011
  8. 1/2 diff: handle diffstat of rewritten binary filesJeff King, Feb 19, 2011
  9. 2/2 diff: don't retrieve binary blobs for diffstatJeff King, Feb 19, 2011
  10. Junio C HamanoFeb 21, 2011
  11. Jeff KingFeb 22, 2011
  12. Junio C HamanoFeb 22, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.