code: func (f *commitFlag) retrieveCommit(ctx context.Context, client *http.Client) (*pb.GitilesCommit, error) {
  	s := f.commit
  	if s == "" {
  		return nil, nil
  	}
  
  	if m := regexCommitCRRev.FindStringSubmatch(s); m != nil {
  		redirect, err := crrevRedirect(ctx, client, m[1])
  		if err != nil {
  			return nil, fmt.Errorf("crrev.com response for %q: %s", m[1], err)
  		}
  		s = redirect
  	}
  
  	commit, mustConfirmRef, err := parseCommit(s)
  	switch {
  	case err == errMalformedCommitString:
  		return nil, fmt.Errorf("does not match r%q or r%q", regexCommit, regexCommitCRRev)
  	case err != nil:
  		return nil, fmt.Errorf("invalid -commit: %s", err)
  
  	case mustConfirmRef:
  		fmt.Printf("Please confirm the git ref [%s] ", commit.Ref)
  		var reply string
  		fmt.Scanln(&reply)
  		reply = strings.TrimSpace(reply)
  		if reply != "" {
  			commit.Ref = reply
  		}
  	}
  
  	return commit, nil
  }
docs: // retrieveCommit retrieves a GitilesCommit from f.commit.
  // Might make RPCs.
  // Interacts with the user if necessary.