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 20, 2007, 09:23 UTC
Message-ID
<20071220092315.GA31337@hashpling.org>
In-Reply-To
<7vy7bqrzat.fsf@gitster.siamese.dyndns.org>
On Wed, Dec 19, 2007 at 04:21:30PM -0800, Junio C Hamano wrote:
> 
> By the way, how does this rewrite look?
> 

It looks good and the test works on my fedora and Mac OS X boxes. (Just for reference I'm on 10.4.3, not 'Leopard'.)

I've snipped everything except zc that I wanted to comment on.

The only two really minor nits I have is that zc does bizarre things without warning for more than 9999 "z" ( e.g. 17000 = 9000 + 8000 = 98000 (!) ) and that, from a function responsibility point of view, the /^index/d looks rather out of place.

Perhaps a comment saying tha zc is designed for <= 9999 z's? Given this, a lot of the /g are redundant.

But hey, it's a test script and it works and I don't have any better suggestions. :)

Charles.
Show 47 quoted lines
> +zc () {
> +	sed -e "/^index/d" \
> +		-e "s/$z1000/Q/g" \
> +		-e "s/QQQQQQQQQ/Z9000/g" \
> +		-e "s/QQQQQQQQ/Z8000/g" \
> +		-e "s/QQQQQQQ/Z7000/g" \
> +		-e "s/QQQQQQ/Z6000/g" \
> +		-e "s/QQQQQ/Z5000/g" \
> +		-e "s/QQQQ/Z4000/g" \
> +		-e "s/QQQ/Z3000/g" \
> +		-e "s/QQ/Z2000/g" \
> +		-e "s/Q/Z1000/g" \
> +		-e "s/$z100/Q/g" \
> +		-e "s/QQQQQQQQQ/Z900/g" \
> +		-e "s/QQQQQQQQ/Z800/g" \
> +		-e "s/QQQQQQQ/Z700/g" \
> +		-e "s/QQQQQQ/Z600/g" \
> +		-e "s/QQQQQ/Z500/g" \
> +		-e "s/QQQQ/Z400/g" \
> +		-e "s/QQQ/Z300/g" \
> +		-e "s/QQ/Z200/g" \
> +		-e "s/Q/Z100/g" \
> +		-e "s/000Z//g" \
> +		-e "s/$z10/Q/g" \
> +		-e "s/QQQQQQQQQ/Z90/g" \
> +		-e "s/QQQQQQQQ/Z80/g" \
> +		-e "s/QQQQQQQ/Z70/g" \
> +		-e "s/QQQQQQ/Z60/g" \
> +		-e "s/QQQQQ/Z50/g" \
> +		-e "s/QQQQ/Z40/g" \
> +		-e "s/QQQ/Z30/g" \
> +		-e "s/QQ/Z20/g" \
> +		-e "s/Q/Z10/g" \
> +		-e "s/00Z//g" \
> +		-e "s/z/Q/g" \
> +		-e "s/QQQQQQQQQ/Z9/g" \
> +		-e "s/QQQQQQQQ/Z8/g" \
> +		-e "s/QQQQQQQ/Z7/g" \
> +		-e "s/QQQQQQ/Z6/g" \
> +		-e "s/QQQQQ/Z5/g" \
> +		-e "s/QQQQ/Z4/g" \
> +		-e "s/QQQ/Z3/g" \
> +		-e "s/QQ/Z2/g" \
> +		-e "s/Q/Z1/g" \
> +		-e "s/0Z//g" \
> +	;
> +}
Previous: Wincent ColaiutaNext: Junio C Hamano
Message 29 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.