@@ -123,7 +123,7 @@ func newRepositoryWithoutUser(opts *RepositoryOptions) (*LocalRepository, error)
123123 if ! opts .MaybeClone {
124124 return open (opts .Dir )
125125 }
126- slog .Info ("Checking for repository" , "dir" , opts .Dir )
126+ slog .Info ("checking for repository" , "dir" , opts .Dir )
127127 _ , err := os .Stat (opts .Dir )
128128 if err == nil {
129129 return open (opts .Dir )
@@ -135,14 +135,14 @@ func newRepositoryWithoutUser(opts *RepositoryOptions) (*LocalRepository, error)
135135 if opts .RemoteBranch == "" {
136136 return nil , fmt .Errorf ("gitrepo: remote branch is required when cloning" )
137137 }
138- slog .Info ("Repository not found, executing clone" )
138+ slog .Info ("repository not found, executing clone" )
139139 return clone (opts .Dir , opts .RemoteURL , opts .RemoteBranch , opts .CI , opts .Depth )
140140 }
141141 return nil , fmt .Errorf ("failed to check for repository at %q: %w" , opts .Dir , err )
142142}
143143
144144func open (dir string ) (* LocalRepository , error ) {
145- slog .Info ("Opening repository" , "dir" , dir )
145+ slog .Info ("opening repository" , "dir" , dir )
146146 repo , err := git .PlainOpen (dir )
147147 if err != nil {
148148 return nil , err
@@ -155,7 +155,7 @@ func open(dir string) (*LocalRepository, error) {
155155}
156156
157157func clone (dir , url , branch , ci string , depth int ) (* LocalRepository , error ) {
158- slog .Info ("Cloning repository" , "url" , url , "dir" , dir )
158+ slog .Info ("cloning repository" , "url" , url , "dir" , dir )
159159 options := & git.CloneOptions {
160160 URL : url ,
161161 ReferenceName : plumbing .NewBranchReferenceName (branch ),
@@ -197,7 +197,7 @@ func (r *LocalRepository) AddAll() error {
197197// Commit creates a new commit with the provided message and author
198198// information.
199199func (r * LocalRepository ) Commit (msg string ) error {
200- slog .Info ("Committing " , "message" , msg )
200+ slog .Info ("committing " , "message" , msg )
201201 worktree , err := r .repo .Worktree ()
202202 if err != nil {
203203 return err
@@ -239,7 +239,7 @@ func (r *LocalRepository) IsClean() (bool, error) {
239239// ChangedFiles returns a list of files that have been modified, added, or deleted
240240// in the working tree, including both staged and unstaged changes.
241241func (r * LocalRepository ) ChangedFiles () ([]string , error ) {
242- slog .Debug ("Getting changed files" )
242+ slog .Debug ("getting changed files" )
243243 worktree , err := r .repo .Worktree ()
244244 if err != nil {
245245 return nil , err
@@ -301,7 +301,7 @@ func (r *LocalRepository) GetCommit(commitHash string) (*Commit, error) {
301301
302302// GetLatestCommit returns the latest commit of the given path in the repository.
303303func (r * LocalRepository ) GetLatestCommit (path string ) (* Commit , error ) {
304- slog .Info ("Retrieving the latest commit" , "path" , path )
304+ slog .Info ("retrieving the latest commit" , "path" , path )
305305 opt := & git.LogOptions {
306306 Order : git .LogOrderCommitterTime ,
307307 FileName : & path ,
@@ -450,7 +450,7 @@ func getHashForPath(commit *object.Commit, path string) (string, error) {
450450
451451// ChangedFilesInCommit returns the files changed in the given commit.
452452func (r * LocalRepository ) ChangedFilesInCommit (commitHash string ) ([]string , error ) {
453- slog .Debug ("Getting changed files in commit" , "hash" , commitHash )
453+ slog .Debug ("getting changed files in commit" , "hash" , commitHash )
454454 commit , err := r .repo .CommitObject (plumbing .NewHash (commitHash ))
455455 if err != nil {
456456 return nil , fmt .Errorf ("failed to get commit object for hash %s: %w" , commitHash , err )
@@ -500,7 +500,7 @@ func (r *LocalRepository) ChangedFilesInCommit(commitHash string) ([]string, err
500500// CreateBranchAndCheckout creates a new git branch and checks out the
501501// branch in the local git repository.
502502func (r * LocalRepository ) CreateBranchAndCheckout (name string ) error {
503- slog .Info ("Creating branch and checking out" , "name" , name )
503+ slog .Info ("creating branch and checking out" , "name" , name )
504504 worktree , err := r .repo .Worktree ()
505505 if err != nil {
506506 return err
@@ -516,7 +516,7 @@ func (r *LocalRepository) CreateBranchAndCheckout(name string) error {
516516func (r * LocalRepository ) Push (branchName string ) error {
517517 // https://stackoverflow.com/a/75727620
518518 refSpec := fmt .Sprintf ("+refs/heads/%s:refs/heads/%s" , branchName , branchName )
519- slog .Info ("Pushing changes" , "branch name" , branchName , slog .Any ("refspec" , refSpec ))
519+ slog .Info ("pushing changes" , "branch name" , branchName , slog .Any ("refspec" , refSpec ))
520520 return r .pushRefSpec (refSpec )
521521}
522522
@@ -527,7 +527,7 @@ func (r *LocalRepository) DeleteBranch(branchName string) error {
527527}
528528
529529func (r * LocalRepository ) pushRefSpec (refSpec string ) error {
530- slog .Info ("Pushing changes" , "refSpec" , refSpec )
530+ slog .Info ("pushing changes" , "refSpec" , refSpec )
531531
532532 // Check for the configured URI for the `origin` remote.
533533 // If there are multiple URLs, the first one is selected.
@@ -558,7 +558,7 @@ func (r *LocalRepository) pushRefSpec(refSpec string) error {
558558 }); err != nil {
559559 return err
560560 }
561- slog .Info ("Successfully pushed changes" , "refSpec" , refSpec )
561+ slog .Info ("successfully pushed changes" , "refSpec" , refSpec )
562562 return nil
563563}
564564
@@ -593,7 +593,7 @@ func canUseSSH(remoteURI string) bool {
593593// remote repository. The useSSH determines if Basic Auth or SSH is used.
594594func (r * LocalRepository ) authCreds (useSSH bool ) (transport.AuthMethod , error ) {
595595 if useSSH {
596- slog .Info ("Authenticating with SSH" )
596+ slog .Info ("authenticating with SSH" )
597597 // This is the generic `git` username when cloning via SSH. It is the value
598598 // that exists before the URL. e.g. [email protected] :googleapis/librarian.git 599599 auth , err := ssh .DefaultAuthBuilder ("git" )
@@ -602,7 +602,7 @@ func (r *LocalRepository) authCreds(useSSH bool) (transport.AuthMethod, error) {
602602 }
603603 return auth , nil
604604 }
605- slog .Info ("Authenticating with basic auth" )
605+ slog .Info ("authenticating with basic auth" )
606606 return & httpAuth.BasicAuth {
607607 // GitHub's authentication needs the username set to a non-empty value, but
608608 // it does not need to match the token
@@ -619,7 +619,7 @@ func (r *LocalRepository) authCreds(useSSH bool) (transport.AuthMethod, error) {
619619func (r * LocalRepository ) Restore (paths []string ) error {
620620 args := []string {"restore" }
621621 args = append (args , paths ... )
622- slog .Info ("Restoring uncommitted changes" , "paths" , strings .Join (paths , "," ))
622+ slog .Info ("restoring uncommitted changes" , "paths" , strings .Join (paths , "," ))
623623 cmd := exec .Command ("git" , args ... )
624624 cmd .Stderr = os .Stderr
625625 cmd .Stdout = os .Stdout
@@ -629,7 +629,7 @@ func (r *LocalRepository) Restore(paths []string) error {
629629
630630// CleanUntracked removes untracked files within the given paths.
631631func (r * LocalRepository ) CleanUntracked (paths []string ) error {
632- slog .Info ("Cleaning untracked files" , "paths" , strings .Join (paths , "," ))
632+ slog .Info ("cleaning untracked files" , "paths" , strings .Join (paths , "," ))
633633 worktree , err := r .repo .Worktree ()
634634 if err != nil {
635635 return err
0 commit comments