Skip to content
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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

tinanigro
Copy link

Hello,

Suggesting this minor output change to make the error message clearer.

Copy link
Member

@bk2204 bk2204 left a 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.

@@ -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))
Copy link
Member

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?

Copy link
Author

@tinanigro tinanigro Feb 21, 2020

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.

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");
Copy link
Member

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.

Base automatically changed from master to main February 2, 2021 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants