code: func (old *Manifest_GitCheckout) Diff(new *Manifest_GitCheckout) *ManifestDiff_GitCheckout {
  	if old == nil && new == nil {
  		return nil
  	}
  
  	ret := &ManifestDiff_GitCheckout{}
  
  	ret.Overall = zeroCmpTwo(old, new, func() ManifestDiff_Stat {
  		if old.RepoUrl == new.RepoUrl {
  			// For now, the canoncial 'diff' URL is always the new URL. If we add
  			// support for source-of-truth migrations, this could change.
  			ret.RepoUrl = new.RepoUrl
  
  			// FetchRef doesn't matter for comparison purposes for now.
  			ret.Revision = zeroCmpTwo(old.Revision, new.Revision, nil)
  			if ret.Revision == ManifestDiff_MODIFIED {
  				ret.Revision = ManifestDiff_DIFF
  			}
  
  			// We calculate DIFF for PatchRevision iff the two checkouts both include
  			// patches from the same CL.
  			ret.PatchRevision = zeroCmpTwo(old.PatchRevision, new.PatchRevision, nil)
  			if ret.PatchRevision == ManifestDiff_MODIFIED {
  				oldCL, newCL := parseChangeRef(old.PatchFetchRef), parseChangeRef(new.PatchFetchRef)
  				if oldCL != "" && newCL != "" && oldCL == newCL {
  					ret.PatchRevision = ManifestDiff_DIFF
  				}
  			}
  
  			// If all the revisions are the same and the repo url is the same, that's
  			// good enough for the whole checkout to be equal.
  			if ret.Revision == ManifestDiff_EQUAL && ret.PatchRevision == ManifestDiff_EQUAL {
  				return ManifestDiff_EQUAL
  			}
  		}
  
  		return ManifestDiff_MODIFIED
  	})
  
  	return ret
  }
docs: // Diff generates a Stat reflecting the difference between the `old`
  // GitCheckout and the `new` one.
  //
  // This will generate a Stat of `DIFF` if the two GitCheckout's are non-nil and
  // share the same RepoUrl.
  //
  // This only calculates the pure-data differences. Notably, this will not reach
  // out to any remote services to populate the git_history field.