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

Re: [PATCH] update-server-info: avoid needless overwrites

From
Jeff King <peff@peff.net>
Date
May 14, 2019, 12:29 UTC
Message-ID
<20190514122957.GC27276@sigill.intra.peff.net>
In-Reply-To
<87ftphw7mv.fsf@evledraar.gmail.com>
On Tue, May 14, 2019 at 02:19:36PM +0200, Ævar Arnfjörð Bjarmason wrote:
> Aside from this change, I wonder if making "fetch" optionally "exit 1"
> if no refs were updated would be useful, as in the below WIP. Of course
> it would be better to distinguish errors from "no refs to update".

That seems very sensible to me, as long as it's an optional flag as you have it here.

Show 6 quoted lines
> @@ -133,6 +135,8 @@ static struct option builtin_fetch_options[] = {
>  	{ OPTION_CALLBACK, 0, "recurse-submodules", &recurse_submodules, N_("on-demand"),
>  		    N_("control recursive fetching of submodules"),
>  		    PARSE_OPT_OPTARG, option_fetch_parse_recurse_submodules },
> +	OPT_BOOL(0, "exit-code", &exit_code,
> +		 N_("exit successfully if refs are updated")),

I think it makes sense to flip this explanation: "exit non-zero if no refs are updated" or "treat it as an error if no refs are updated". Since the default behavior is already to exit successfully in this case. :)

We may also want to advertise a particular result code so callers can distinguish it from regular die() errors.

-Peff
Previous: Ævar Arnfjörð BjarmasonNext: Eric Wong
Message 17 of 26 in “update-server-info: avoid needless overwrites”
  1. update-server-info: avoid needless overwritesEric Wong, May 11, 2019
  2. Eric SunshineMay 11, 2019
  3. update-server-info: avoid needless overwritesEric Wong, May 11, 2019
  4. Eric WongMay 11, 2019
  5. Ævar Arnfjörð BjarmasonMay 11, 2019
  6. Eric WongMay 12, 2019
  7. Jeff KingMay 12, 2019
  8. Ævar Arnfjörð BjarmasonMay 12, 2019
  9. Jeff KingMay 14, 2019
  10. Ævar Arnfjörð BjarmasonMay 14, 2019
  11. Jeff KingMay 14, 2019
  12. Ævar Arnfjörð BjarmasonMay 14, 2019
  13. Eric WongMay 14, 2019
  14. dumb HTTP things I want to doEric Wong, May 14, 2019
  15. Jeff KingMay 14, 2019
  16. Ævar Arnfjörð BjarmasonMay 14, 2019
  17. Jeff KingMay 14, 2019
  18. 2/1 server-info: conditionally update on fetchEric Wong, May 15, 2019
  19. [WIP] repack leaving stale entries in objects/info/packsEric Wong, May 15, 2019
  20. Jeff KingMay 15, 2019
  21. server-info: do not list unlinked packsEric Wong, May 23, 2019
  22. Jeff KingMay 23, 2019
  23. server-info: do not list unlinked packsEric Wong, May 23, 2019
  24. Jeff KingMay 24, 2019
  25. Ævar Arnfjörð BjarmasonMay 24, 2019
  26. update-server-info: avoid needless overwritesEric Wong, May 13, 2019

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.