-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clearer output when expected file isn't a pointer #4034
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey,
Thanks for the patch, and welcome to Git LFS! Overall, I like the direction this is going but have some concerns about the length.
commands/command_filter_process.go
Outdated
@@ -203,7 +203,7 @@ func filterCommand(cmd *cobra.Command, args []string) { | |||
} | |||
|
|||
if len(malformed) > 0 { | |||
fmt.Fprintf(os.Stderr, "Encountered %d file(s) that should have been pointers, but weren't:\n", len(malformed)) | |||
fmt.Fprintf(os.Stderr, "Encountered %d file(s) that should have been Git LFS pointers, but they're Git files:\n", len(malformed)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is definitely more detailed, but it's also more than 80 characters long, which means it will wrap on some screens. Can we shorten it? Maybe Encountered %d file(s) that should have been Git LFS pointers, but weren't
? Or something else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your suggestion is definitely better as it will fit in one line. However I'm afraid it might not be clear enough. I'm now getting inspiration from the next if
condition, which displays an initial error message, then loops on a collection, then display a help message with a git lfs
command to get more details. I think we could do the same: an initial (short) but a bit clearer output message, and then instructions on what to do next.
edit: pushed a new version that reflects the above proposal.
commands/command_filter_process.go
Outdated
for _, m := range malformed { | ||
fmt.Fprintf(os.Stderr, "\t%s\n", m) | ||
} | ||
|
||
fmt.Fprintf(os.Stderr, "\Type: `git lfs ls-files` to see which files are in the Git LFS index.\n"); | ||
fmt.Fprintf(os.Stderr, "\See: `git lfs help migrate` for migrating files to the Git LFS index.\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these two lines have syntax errors.
Also, since this is a warning message, we should try to be fairly brief. I think we could just say, “See "git lfs migrate --help" for how to migrate these files to Git LFS.” I'm not sure we need the previous line, and there isn't really a Git LFS index separate from the Git index.
Hello,
Suggesting this minor output change to make the error message clearer.