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

Re: [PATCH] Re-re-re-fix common tail optimization

From
Charles Bailey <charles@hashpling.org>
Date
Dec 19, 2007, 14:37 UTC
Message-ID
<20071219143712.GA3483@hashpling.org>
In-Reply-To
<20071219142715.GB14187@coredump.intra.peff.net>
On Wed, Dec 19, 2007 at 09:27:15AM -0500, Jeff King wrote:
Show 14 quoted lines
> On Wed, Dec 19, 2007 at 02:18:45PM +0000, Charles Bailey wrote:
> 
> > Just to add to the woe on this one, this test breaks on MacOS X due to
> > the pattern length limitations of the default sed on that platform.
> > 
> > Interested in a patch?
> 
> Somebody beat you to it. :) Can you confirm that the fix in
> 
>   <1198007158-27576-1-git-send-email-win@wincent.com>
> 
> works for you?
> 
> -Peff

Ooh, the excitement, I've never had the opportunity to "git am" before.

Yes, I can confirm.  It works for me.

For reference I had the following, which is fewer lines but not inherently better in any other way.

Charles.
diff --git a/t/t4024-diff-optimize-common.sh b/t/t4024-diff-optimize-common.sh
index 20fe87b..ffb2c8f 100755
--- a/t/t4024-diff-optimize-common.sh
+++ b/t/t4024-diff-optimize-common.sh
@@ -7,8 +7,9 @@ test_description='common tail optimization'
 z=zzzzzzzz ;# 8
 z="$z$z$z$z$z$z$z$z" ;# 64
 z="$z$z$z$z$z$z$z$z" ;# 512
-z="$z$z$z$z" ;# 2048
-z2047=$(expr "$z" : '.\(.*\)') ; #2047
+z="$z$z" ;# 1024
+z1023=$(expr "$z" : '.\(.*\)') ; #1023
+z2047=$z$z1023
 
 test_expect_success setup '
 
@@ -35,8 +36,8 @@ diff --git a/file-a b/file-a
 --- a/file-a
 +++ b/file-a
 @@ -1 +1 @@
--aZ
-+AZ
+-aZZz
++AZZz
 diff --git a/file-b b/file-b
 --- a/file-b
 +++ b/file-b
@@ -47,9 +48,9 @@ diff --git a/file-c b/file-c
 --- a/file-c
 +++ b/file-c
 @@ -1 +1 @@
--cZ
+-cZZz
 \ No newline at end of file
-+CZ
++CZZz
 \ No newline at end of file
 diff --git a/file-d b/file-d
 --- a/file-d
@@ -61,7 +62,7 @@ EOF
 
 test_expect_success 'diff -U0' '
 
-	git diff -U0 | sed -e "/^index/d" -e "s/$z2047/Z/g" >actual &&
+	git diff -U0 | sed -e "/^index/d" -e "s/$z1023/Z/g" >actual &&
 	diff -u expect actual
 
 '
-- 
1.5.3.7.11.ga3d7
Previous: Jeff KingNext: Junio C Hamano
Message 26 of 30 in “trim_common_tail bug?”
  1. Jeff KingDec 15, 2007
  2. Jeff KingDec 15, 2007
  3. Junio C HamanoDec 15, 2007
  4. Jeff KingDec 15, 2007
  5. Jeff KingDec 16, 2007
  6. Junio C HamanoDec 16, 2007
  7. Junio C HamanoDec 16, 2007
  8. Jeff KingDec 16, 2007
  9. Re-re-re-fix common tail optimizationJunio C Hamano, Dec 16, 2007
  10. Jeff KingDec 16, 2007
  11. Junio C HamanoDec 16, 2007
  12. Junio C HamanoDec 16, 2007
  13. Jeff KingDec 16, 2007
  14. Wincent ColaiutaDec 17, 2007
  15. Johannes SchindelinDec 17, 2007
  16. Wincent ColaiutaDec 17, 2007
  17. Johannes SchindelinDec 17, 2007
  18. Wincent ColaiutaDec 17, 2007
  19. Jeff KingDec 17, 2007
  20. Johannes SixtDec 17, 2007
  21. Johannes SchindelinDec 17, 2007
  22. Junio C HamanoDec 17, 2007
  23. Johannes SchindelinDec 17, 2007
  24. Charles BaileyDec 19, 2007
  25. Jeff KingDec 19, 2007
  26. Charles BaileyDec 19, 2007
  27. Junio C HamanoDec 20, 2007
  28. Wincent ColaiutaDec 20, 2007
  29. Charles BaileyDec 20, 2007
  30. Junio C HamanoDec 20, 2007

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.