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

Re: [RFC/ PATCH 1/5] tree-walk: do not stop when an error is detected

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 9, 2010, 16:49 UTC
Message-ID
<7vaar4p2vo.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1276087446-25112-3-git-send-email-diane.gasselin@ensimag.imag.fr>
Diane Gasselin <diane.gasselin@ensimag.imag.fr> writes:
> When an error is detected, traverse_trees() is not stopped anymore.
> The whole tree is traversed so that all the merging errors can be detected.

A small worry is if we have some codepath that uses this function like this:

    if (traverse trees finishes successfully) {
    	be happy, all is well;
    } else {
	attempt a different strategy to achieve
        what we wanted to with traverse trees, if
        it worked fine.
    }

In such a case, spending extra cycles in traverse-trees only to collect more errors would actively degrade performance in the "alternative implementation" codepath. For "try 'quick but limited' version first, and if it doesn't work, try more elaborate version spending extra cycles" pattern to work well, the 'quick but limited' version needs to fail quickly without wasting extra cycles when it hits its limitation. In the original code, we deliberately returned early upon seeing the first error exactly for this reason.

I don't think of concrete examples offhand (fallbacks "merge -s resolve -s recursive" or "am -3" use come close, perhaps), though, so I may be worried needlessly in this case. I honestly don't know offhand.

With our attention focused only on UI issues, I however would agree that it makes a lot of sense to collect all errors and give them all to the user, especially because the extra cycles (compared to the current code) spent to do so is only in the error codepath.

Previous: Matthieu MoyNext: Diane Gasselin
Message 19 of 21 in “unpack_trees: nicer error messages”
  1. 0/5 unpack_trees: nicer error messagesDiane Gasselin, Jun 9, 2010
  2. 0/5 unpack_trees: nicer error messagesDiane Gasselin, Jun 9, 2010
  3. 1/5 tree-walk: do not stop when an error is detectedDiane Gasselin, Jun 9, 2010
  4. 2/5 unpack_trees: group errors by typeDiane Gasselin, Jun 9, 2010
  5. 3/5 unpack_trees_options: update porcelain messagesDiane Gasselin, Jun 9, 2010
  6. 4/5 t3030: update porcelain expected messageDiane Gasselin, Jun 9, 2010
  7. 5/5 t7609: test merge and checkout error messagesDiane Gasselin, Jun 9, 2010
  8. Matthieu MoyJun 9, 2010
  9. Diane GasselinJun 9, 2010
  10. Matthieu MoyJun 9, 2010
  11. Junio C HamanoJun 9, 2010
  12. Matthieu MoyJun 9, 2010
  13. Jeff KingJun 10, 2010
  14. Diane GasselinJun 10, 2010
  15. Diane GasselinJun 9, 2010
  16. Junio C HamanoJun 9, 2010
  17. Diane GasselinJun 10, 2010
  18. Matthieu MoyJun 9, 2010
  19. Junio C HamanoJun 9, 2010
  20. Diane GasselinJun 9, 2010
  21. Matthieu MoyJun 9, 2010

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.