Skip to content

Commit 4f547e4

Browse files
committed
Merge branch 'main' into release-doc-updates
2 parents dc3e9b6 + 1735acc commit 4f547e4

File tree

4 files changed

+10
-18
lines changed

4 files changed

+10
-18
lines changed

commands/command_clean.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"github.com/git-lfs/git-lfs/v3/lfs"
99
"github.com/git-lfs/git-lfs/v3/tools"
1010
"github.com/git-lfs/git-lfs/v3/tr"
11+
"github.com/rubyist/tracerx"
1112
"github.com/spf13/cobra"
1213
)
1314

@@ -76,13 +77,13 @@ func clean(gf *lfs.GitFilter, to io.Writer, from io.Reader, fileName string, fil
7677
if stat.Size() != cleaned.Size && len(cleaned.Pointer.Extensions) == 0 {
7778
Exit("%s\n%s\n%s", tr.Tr.Get("Files don't match:"), mediafile, tmpfile)
7879
}
79-
Debug("%s exists", mediafile)
80+
tracerx.Printf("%s exists", mediafile)
8081
} else {
8182
if err := os.Rename(tmpfile, mediafile); err != nil {
8283
Panic(err, tr.Tr.Get("Unable to move %s to %s", tmpfile, mediafile))
8384
}
8485

85-
Debug(tr.Tr.Get("Writing %s", mediafile))
86+
tracerx.Printf("Writing %s", mediafile)
8687
}
8788

8889
_, err = lfs.EncodePointer(to, cleaned.Pointer)

commands/command_fsck.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
"github.com/git-lfs/git-lfs/v3/lfs"
1616
"github.com/git-lfs/git-lfs/v3/tools"
1717
"github.com/git-lfs/git-lfs/v3/tr"
18+
"github.com/rubyist/tracerx"
1819
"github.com/spf13/cobra"
1920
)
2021

@@ -170,7 +171,7 @@ func doFsckPointers(include, exclude string) []corruptPointer {
170171
var corruptPointers []corruptPointer
171172
gitscanner := lfs.NewGitScanner(cfg, func(p *lfs.WrappedPointer, err error) {
172173
if p != nil {
173-
Debug(tr.Tr.Get("Examining %v (%v)", p.Oid, p.Name))
174+
tracerx.Printf("Examining %v (%v)", p.Oid, p.Name)
174175
if !p.Canonical {
175176
cp := corruptPointer{
176177
blobOid: p.Sha1,
@@ -214,7 +215,7 @@ func doFsckPointers(include, exclude string) []corruptPointer {
214215
func fsckPointer(name, oid string, size int64) (bool, error) {
215216
path := cfg.Filesystem().ObjectPathname(oid)
216217

217-
Debug(tr.Tr.Get("Examining %v (%v)", name, path))
218+
tracerx.Printf("Examining %v (%v)", name, path)
218219

219220
f, err := os.Open(path)
220221
if pErr, pOk := err.(*os.PathError); pOk {

commands/command_logs.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66

77
"github.com/git-lfs/git-lfs/v3/errors"
88
"github.com/git-lfs/git-lfs/v3/tr"
9+
"github.com/rubyist/tracerx"
910
"github.com/spf13/cobra"
1011
)
1112

@@ -37,7 +38,7 @@ func logsShowCommand(cmd *cobra.Command, args []string) {
3738
Exit(tr.Tr.Get("Error reading log: %s", name))
3839
}
3940

40-
Debug(tr.Tr.Get("Reading log: %s", name))
41+
tracerx.Printf("Reading log: %s", name)
4142
os.Stdout.Write(by)
4243
}
4344

@@ -51,7 +52,7 @@ func logsClearCommand(cmd *cobra.Command, args []string) {
5152
}
5253

5354
func logsBoomtownCommand(cmd *cobra.Command, args []string) {
54-
Debug(tr.Tr.Get("Sample debug message"))
55+
tracerx.Printf("Sample trace message")
5556
err := errors.Wrapf(errors.New(tr.Tr.Get("Sample wrapped error message")), tr.Tr.Get("Sample error message"))
5657
Panic(err, tr.Tr.Get("Sample panic message"))
5758
}

commands/commands.go

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"bytes"
55
"fmt"
66
"io"
7-
"log"
87
"net"
98
"os"
109
"path/filepath"
@@ -29,7 +28,6 @@ import (
2928
//go:generate go run ../docs/man/mangen.go
3029

3130
var (
32-
Debugging = false
3331
ErrorBuffer = &bytes.Buffer{}
3432
ErrorWriter = newMultiWriter(os.Stderr, ErrorBuffer)
3533
OutputWriter = newMultiWriter(os.Stdout, ErrorBuffer)
@@ -237,23 +235,14 @@ func FullError(err error) {
237235
}
238236

239237
func errorWith(err error, fatalErrFn func(error, string, ...interface{}), errFn func(string, ...interface{})) {
240-
if Debugging || errors.IsFatalError(err) {
238+
if errors.IsFatalError(err) {
241239
fatalErrFn(err, "%s", err)
242240
return
243241
}
244242

245243
errFn("%s", err)
246244
}
247245

248-
// Debug prints a formatted message if debugging is enabled. The formatted
249-
// message also shows up in the panic log, if created.
250-
func Debug(format string, args ...interface{}) {
251-
if !Debugging {
252-
return
253-
}
254-
log.Printf(format, args...)
255-
}
256-
257246
// LoggedError prints the given message formatted with its arguments (if any) to
258247
// Stderr. If an empty string is passed as the "format" argument, only the
259248
// standard error logging message will be printed, and the error's body will be

0 commit comments

Comments
 (0)