code: func gitilesHistory(c context.Context, host, project, oldRevision, newRevision string) ([]*gitpb.Commit, error) {
  	c, _ = context.WithTimeout(c, 30*time.Second)
  
  	transport, err := auth.GetRPCTransport(c, auth.AsSelf, auth.WithScopes(gitiles.OAuthScope))
  	if err != nil {
  		return nil, errors.Annotate(err, "getting RPC Transport").Err()
  	}
  	client, err := gitiles.NewRESTClient(&http.Client{Transport: transport}, host, true)
  	if err != nil {
  		return nil, errors.Annotate(err, "creating Gitiles client").Err()
  	}
  
  	req := gitilespb.LogRequest{
  		Project: project,
  		// With ~1, if newCommit.Revision == oldRevision,
  		// we'll get one commit,
  		// otherwise we will get 0 commits which is indistinguishable from
  		// oldRevision not being reachable from newRevision.
  		ExcludeAncestorsOf: oldRevision + "~1",
  		Committish:         newRevision,
  	}
  	logging.Infof(c, "Gitiles request to host %q: %q", host, &req)
  	res, err := gitiles.PagingLog(c, client, req, 0)
  	switch {
  	case err != nil:
  		return nil, grpcutil.WrapIfTransient(errors.Annotate(err, "fetching commit from Gitiles").Err())
  	case len(res) > 0 && res[0].Id != newRevision: // Sanity check.
  		return nil, errors.Reason("gitiles returned inconsistent results").Err()
  	default:
  		return res, nil
  	}
  }
docs: // gitilesHistory is an implementation of a HistoryFunc intended to be used
  // in production (not for testing).