Homec4science

Don't rediscover an entire branch when a new commit appears at HEAD

Authored by epriestley <git@epriestley.com> on Jun 19 2012, 22:47.

Description

Don't rediscover an entire branch when a new commit appears at HEAD

Summary:
The autoclose logic is currently doing a little too much work. We want to parse each commit at most twice:

  1. When it first appears in the repository.
  2. When it first appears on an autoclose branch.

These two events might not be distinct (i.e., it might first appear on an autoclose branch).

Currently, to discover commits initially appearing on autoclose branches, we check each branch, determine if it's an autoclose branch or not, and determine if the HEAD is already a known commit on an autoclose branch. This is correct so far, and allows us to ignore branches which either haven't changed or have commits at HEAD which we've already examined.

However, if an autoclose branch has a new commit, we start working backward through it. Prior to this patch, we only stop when we hit commits that we've already discovered lie on this branch. If the branch is new, none of the commits will be discovered on it (they're discovered in general, and likely discovered on other autoclose branches, but not discovered on this branch), so we'll parse all the way back to the root.

Instead, we want to stop when we hit commits that we've already discovered on any autoclose branch.

So do that.

Test Plan: Pushed a new branch, then pushed a new commit at HEAD. Ran discovery, verified we rediscovered only 1 commit, not every commit in history.

Reviewers: vrana, jungejason, aurelijus

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1389

Differential Revision: https://secure.phabricator.com/D2798

Details

Committed
epriestley <git@epriestley.com>Jun 19 2012, 22:47
Pushed
aubortJan 31 2017, 17:16
Parents
rPHfabe52335e05: Add `--verbose` support to phd
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHe48830eecb95: Don't rediscover an entire branch when a new commit appears at HEAD (authored by epriestley <git@epriestley.com>).Jun 19 2012, 22:47