Skip to content

fix: prevent cmdutils.SilentError from printing in error handler

Description

  • Prevent cmdutils.SilentError from printing out in fang.Execute error handler

Out of the discussions in #8015 (closed) it was found that in the 1.73.0 release that cmdutils.SilentError was being printed out to the terminal when in earlier versions (1.72.0 and earlier) this was suppressed (e.g. not output to the user). This appears to be a side-effect from the migration to using the go package fang.

I proposed a solution in this thread: #8015 (comment 2809193061) and in conjunction with @phikai the following patch was created.

Related Issues

Related to #8015 (closed)

How has this been tested?

  1. Ensure the glab credential helper in being used in ~/.gitconfig
$ cat ~/.gitconfig | tail -3
[credential "https://gitlab.com"]
	helper = 
  helper = !/usr/local/bin/glab auth git-credential
  1. Navigate to a repository that requires auth (private repo, etc) and run git pull
$ git pull
ERROR 

  Silenterror.
Already up to date.
  1. Navigate to the gitlab cli repo, checkout the listed branch and run make build
  2. Either replace the path in ~/.gitconfig to point to the newly compiled binary, or move the binary to the location of the old glab binary.
  3. Navigate to a repository that requires auth (private repo, etc) and run git pull again
$ git pull
Already up to date.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation
  • Chore (Related to CI or Packaging to platforms)
  • Test gap
Edited by 🤖 GitLab Bot 🤖

Merge request reports

Loading