func (s *CommitsService) ListCommits(pid interface{}, opt *ListCommitsOptions, options ...OptionFunc) ([]*Commit, *Response, error) {
	project, err := parseID(pid)
	if err != nil {
		return nil, nil, err
	}
	u := fmt.Sprintf("projects/%s/repository/commits", pathEscape(project))
	req, err := s.client.NewRequest("GET", u, opt, options)
	if err != nil {
		return nil, nil, err
	}
	var c []*Commit
	resp, err := s.client.Do(req, &c)
	if err != nil {
		return nil, resp, err
	}
	return c, resp, err
}
ListCommits gets a list of repository commits in a project.

GitLab API docs: https://docs.gitlab.com/ce/api/commits.html#list-commits
package gitlab
import (
	"fmt"
	"time"
)
type CommitsService struct {
	client *Client
}
type Commit struct {
	ID             string           `json:"id"`
	ShortID        string           `json:"short_id"`
	Title          string           `json:"title"`
	AuthorName     string           `json:"author_name"`
	AuthorEmail    string           `json:"author_email"`
	AuthoredDate   *time.Time       `json:"authored_date"`
	CommitterName  string           `json:"committer_name"`
	CommitterEmail string           `json:"committer_email"`
	CommittedDate  *time.Time       `json:"committed_date"`
	CreatedAt      *time.Time       `json:"created_at"`
	Message        string           `json:"message"`
	ParentIDs      []string         `json:"parent_ids"`
	Stats          *CommitStats     `json:"stats"`
	Status         *BuildStateValue `json:"status"`
	LastPipeline   *PipelineInfo    `json:"last_pipeline"`
	ProjectID      int              `json:"project_id"`
}
type CommitStats struct {
	Additions int `json:"additions"`
	Deletions int `json:"deletions"`
	Total     int `json:"total"`
}
func (c Commit) String() string {
	return Stringify(c)
}
type ListCommitsOptions struct {
	ListOptions
	RefName   *string    `url:"ref_name,omitempty" json:"ref_name,omitempty"`
	Since     *time.Time `url:"since,omitempty" json:"since,omitempty"`
	Until     *time.Time `url:"until,omitempty" json:"until,omitempty"`
	Path      *string    `url:"path,omitempty" json:"path,omitempty"`
	All       *bool      `url:"all,omitempty" json:"all,omitempty"`
	WithStats *bool      `url:"with_stats,omitempty" json:"with_stats,omitempty"`
}