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

Re: [PATCH v4] gc: call "prune --expire 2.weeks.ago" by default

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 12, 2008, 21:20 UTC
Message-ID
<7vwso74p33.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<alpine.LSU.1.00.0803122153440.1656@racer.site>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> ---prune::

I am fairly paranoid about end users wondering about what is described in ancient documentation and complaining that we do not talk about it anymore. I am tempted to suggest:

	This is a no-op but you may see it mentioned in older docs and
	scripts.  Older git-gc never ran 'prune' without being told, and
	this option was a way to tell it to.

but this would lead to littering the documentation with too much historical information in the long run. I dunno. I am inclined to favor the removal as your patch did, but somebody else may have clever ideas.

Show 6 quoted lines
> +	if (!strcmp(var, "gc.pruneexpire")) {
> +		if (!value)
> +			return config_error_nonbool(var);
> +		if (strcmp(value, "now") &&
> +				approxidate(value) - approxidate("now") >= 0)
> +			return error("Invalid gc.pruneExpire: '%s'", value);

Yuck; approxidate() returns ulong. Can subtracting a ulong from another ever go negative?

Besides, because there is no guarantee of the order of evaluation between these two approxidate() calls, you may get +1 or -1 on the second boundary.

I think the reason why you did not catch it in your test is because your tests are half complete; they test only what you wanted to catch (misconfigured case) and do not test the other half (properly working case).

Previous: Johannes SchindelinNext: Nicolas Pitre
Message 31 of 41 in “gc: call "prune --expire 2.weeks.ago"”
  1. gc: call "prune --expire 2.weeks.ago"Johannes Schindelin, Mar 11, 2008
  2. Junio C HamanoMar 12, 2008
  3. Nicolas PitreMar 12, 2008
  4. Junio C HamanoMar 12, 2008
  5. Johannes SchindelinMar 12, 2008
  6. Nicolas PitreMar 12, 2008
  7. Pieter de BieMar 12, 2008
  8. Johannes SchindelinMar 12, 2008
  9. Jeff KingMar 12, 2008
  10. Pieter de BieMar 12, 2008
  11. Junio C HamanoMar 12, 2008
  12. Johannes SchindelinMar 12, 2008
  13. Junio C HamanoMar 12, 2008
  14. Geert BoschMar 12, 2008
  15. Nicolas PitreMar 12, 2008
  16. Marko KreenMar 12, 2008
  17. gc: call "prune --expire 2.weeks.ago" by defaultJohannes Schindelin, Mar 12, 2008
  18. Brandon CaseyMar 12, 2008
  19. Jakub NarebskiMar 12, 2008
  20. Johannes SchindelinMar 12, 2008
  21. Junio C HamanoMar 12, 2008
  22. Johannes SchindelinMar 12, 2008
  23. gc: call "prune --expire 2.weeks.ago" by defaultJohannes Schindelin, Mar 12, 2008
  24. Johannes SchindelinMar 12, 2008
  25. Brandon CaseyMar 12, 2008
  26. Johannes SchindelinMar 12, 2008
  27. Brandon CaseyMar 12, 2008
  28. Junio C HamanoMar 12, 2008
  29. gc: call "prune --expire 2.weeks.ago" by defaultJohannes Schindelin, Mar 12, 2008
  30. Johannes SchindelinMar 12, 2008
  31. Junio C HamanoMar 12, 2008
  32. Nicolas PitreMar 12, 2008
  33. Johannes SchindelinMar 12, 2008
  34. Junio C HamanoMar 12, 2008
  35. Johannes SchindelinMar 12, 2008
  36. Junio C HamanoMar 12, 2008
  37. Johannes SchindelinMar 12, 2008
  38. Wincent ColaiutaMar 13, 2008
  39. Johannes SixtMar 13, 2008
  40. Wincent ColaiutaMar 13, 2008
  41. Johannes SchindelinMar 13, 2008

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.