git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Diane Gasselin <diane.gasselin@ensimag.imag.fr>
Cc: git@vger.kernel.org, "Axel Bonnet" <axel.bonnet@ensimag.imag.fr>,
	"Clément Poulain" <clement.poulain@ensimag.imag.fr>
Subject: Re: [RFC/ PATCH 1/5] tree-walk: do not stop when an error is detected
Date: Wed, 09 Jun 2010 09:49:47 -0700	[thread overview]
Message-ID: <7vaar4p2vo.fsf@alter.siamese.dyndns.org> (raw)
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.

  parent reply	other threads:[~2010-06-09 16:50 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-09 12:44 [RFC/ PATCH 0/5] unpack_trees: nicer error messages Diane Gasselin
2010-06-09 12:44 ` Diane Gasselin
2010-06-09 12:44   ` [RFC/ PATCH 1/5] tree-walk: do not stop when an error is detected Diane Gasselin
2010-06-09 12:44     ` [RFC/ PATCH 2/5] unpack_trees: group errors by type Diane Gasselin
2010-06-09 12:44       ` [RFC/ PATCH 3/5] unpack_trees_options: update porcelain messages Diane Gasselin
2010-06-09 12:44         ` [RFC/ PATCH 4/5] t3030: update porcelain expected message Diane Gasselin
2010-06-09 12:44           ` [RFC/ PATCH 5/5] t7609: test merge and checkout error messages Diane Gasselin
2010-06-09 20:47             ` Matthieu Moy
2010-06-09 21:10               ` Diane Gasselin
2010-06-09 21:31                 ` Matthieu Moy
2010-06-09 16:51           ` [RFC/ PATCH 4/5] t3030: update porcelain expected message Junio C Hamano
2010-06-09 20:40           ` Matthieu Moy
2010-06-10  1:59             ` Jeff King
2010-06-10  7:47               ` Diane Gasselin
2010-06-09 13:19       ` [RFC/ PATCH 2/5] unpack_trees: group errors by type Diane Gasselin
2010-06-09 16:50       ` Junio C Hamano
2010-06-10  9:21         ` Diane Gasselin
2010-06-09 20:59       ` Matthieu Moy
2010-06-09 16:49     ` Junio C Hamano [this message]
2010-06-09 17:18       ` [RFC/ PATCH 1/5] tree-walk: do not stop when an error is detected Diane Gasselin
2010-06-09 20:54         ` Matthieu Moy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vaar4p2vo.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=axel.bonnet@ensimag.imag.fr \
    --cc=clement.poulain@ensimag.imag.fr \
    --cc=diane.gasselin@ensimag.imag.fr \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).