git-lfs/commands
Chris Darroch 2830d39ef4 avoid extra message format parsing where possible
Because the tr.Tr.Get() family of methods insert arguments
into printf(3)-style format strings after translating the
format string, we can in a few cases drop a surrounding call
to fmt.Sprintf() or a similar method, as those now take no
arguments and so are redundant.

Moreover, this will help us avoid situations where either
the translated string or the argument values interpolated
by tr.Tr.Get() produce an output string which itself happens
to contain character sequences that resemble Go format
specifiers (e.g., "%s", "%d", etc.)  In such cases passing the
string at runtime to a method such as fmt.Fprintf() will result
in the output containing a warning such as "%!s(MISSING)", which
is not ideal.

Note that in one case, in lfs/attribute.go, we can now also
simplify the format string to use standard format specifiers
instead of double-escaped ones (e.g., "%%q") since we can just
allow tr.Tr.Get() to do the interpolation.

We also take the opportunity to remove explicit leading or
trailing newlines from translation messages wherever it is
possible to convert the surrounding call to fmt.Print(),
fmt.Fprint(), fmt.Println(), or fmt.Fprintln().

Finally, in the commands/run.go file, we can replace two calls
to fmt.Fprintf() with fmt.Println() because they are just
printing output to os.Stdout, not os.Stderr, and in the
lfs/extension.go file, we can make better use of fmt.Errorf().

Note that at least one of these messages is not yet actually
passed as a translation string, but we will address that issue
in a subsequent commit.
2022-01-29 22:32:58 -08:00
..
command_checkout.go commands/checkout: make strings translatable 2022-01-18 17:03:24 +00:00
command_clean.go commands,t: use Git LFS project name in messages 2022-01-29 22:30:22 -08:00
command_clone.go commands/clone: make strings translatable 2022-01-18 17:03:25 +00:00
command_dedup.go commands/command_dedup.go,t: consistent messages 2022-01-29 22:32:57 -08:00
command_env.go commands,t: use capitalized Git in messages 2022-01-29 22:30:22 -08:00
command_ext.go commands/command_ext.go: translate ext header only 2022-01-29 22:32:57 -08:00
command_fetch.go commands/command_fetch.go: separate message prefix 2022-01-29 21:59:22 -08:00
command_filter_process.go avoid extra message format parsing where possible 2022-01-29 22:32:58 -08:00
command_fsck.go avoid extra message format parsing where possible 2022-01-29 22:32:58 -08:00
command_install.go revise some informational and error messages 2022-01-29 22:10:48 -08:00
command_lock.go commands,locking: remove lfs message prefixes 2022-01-29 20:21:39 -08:00
command_locks.go commands/locks: make strings translatable 2022-01-18 17:03:26 +00:00
command_logs.go commands/logs: make strings translatable 2022-01-18 17:03:27 +00:00
command_ls_files.go commands/ls-files: make strings translatable 2022-01-18 17:03:36 +00:00
command_migrate_export.go commands/migrate: make strings translatable 2022-01-18 17:03:37 +00:00
command_migrate_import.go avoid extra message format parsing where possible 2022-01-29 22:32:58 -08:00
command_migrate_info.go avoid extra message format parsing where possible 2022-01-29 22:32:58 -08:00
command_migrate.go commands: separate migrate prefix from messages 2022-01-26 22:59:55 -08:00
command_pointer.go avoid extra message format parsing where possible 2022-01-29 22:32:58 -08:00
command_post_checkout.go commands/post-checkout: make strings translatable 2022-01-18 17:03:37 +00:00
command_post_commit.go commands/post-checkout: make strings translatable 2022-01-18 17:03:37 +00:00
command_post_merge.go commands/post-merge: make strings translatable 2022-01-18 17:03:37 +00:00
command_pre_push.go commands/pre-push: make strings translatable 2022-01-18 17:03:37 +00:00
command_prune.go commands/prune: make strings translatable 2022-01-18 17:03:38 +00:00
command_pull.go commands/pull: make strings translatable 2022-01-18 17:03:38 +00:00
command_push.go commands/push: make strings translatable 2022-01-18 17:03:38 +00:00
command_smudge.go commands/smudge: make strings translatable 2022-01-18 17:03:47 +00:00
command_standalone_file.go Set package version to v3 2021-09-02 20:41:08 +00:00
command_status.go commands/status: make strings translatable 2022-01-18 17:03:47 +00:00
command_track.go commands,t: use capitalized Git in messages 2022-01-29 22:30:22 -08:00
command_uninstall.go commands/uninstall: make strings translatable 2022-01-18 17:03:48 +00:00
command_unlock.go commands/unlock: make strings translatable 2022-01-18 17:03:27 +00:00
command_untrack.go commands/command_untrack.go: print fixed usage msg 2022-01-29 22:32:57 -08:00
command_update.go commands,t: use capitalized Git in messages 2022-01-29 22:30:22 -08:00
command_version.go Set package version to v3 2021-09-02 20:41:08 +00:00
commands_test.go Set package version to v3 2021-09-02 20:41:08 +00:00
commands.go commands/commands.go: use fmt to concat strings 2022-01-29 22:32:57 -08:00
lockverifier.go commands/lockverifier.go: restore message indent 2022-01-29 22:32:57 -08:00
multiwriter.go tasklog: check for connected tty on the actual writer 2018-11-14 14:35:29 -08:00
path_nix.go Update formatting for Go 1.17 2021-08-17 20:24:58 +02:00
path_windows.go Set package version to v3 2021-09-02 20:41:08 +00:00
path.go track: use default line endings for core.autocrlf=input 2019-07-16 16:57:21 +00:00
pointers.go Set package version to v3 2021-09-02 20:41:08 +00:00
pull.go commands,t: use capitalized Git in messages 2022-01-29 22:30:22 -08:00
run.go avoid extra message format parsing where possible 2022-01-29 22:32:58 -08:00
uploader_test.go commands: extract lockVerifier from uploadContext 2017-11-01 17:35:43 -06:00
uploader.go commands/uploader.go: separate translation text 2022-01-29 22:32:57 -08:00