-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Rename/move binary and LFS files in web UI #34350
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
base: main
Are you sure you want to change the base?
Conversation
Could you also have a screenshot for editing text files stored in LFS and binary files stored in LFS? |
I'm working on adding support for LFS (I thought it'd behave the same as non LFS files), and noticed that atm LFS files can be edited directly on the web ui if the file path is manually set in the URL. (this actually is a 20MB binary file stored in LFS) This behavior/bug will be removed in this PR, but as it's scheduled for version 1.25, it will be present in 1.24. Should I do a separate PR that fixes this for 1.24 backporting (@lunny)? |
I think the bug fix cannot be backport easily to v1.24 if the PR is complex. But maybe we can try. Please send another PR to fix the bug. |
# Conflicts: # routers/web/repo/editor.go
# Conflicts: # routers/web/repo/editor.go
It's better to display a lfs label when new/upload/update a lfs file. |
Actually, I think the text lfs file should be editable via web UI. This can be implemented in this PR or a new PR. |
I though the same, I think a new PR would be better to separate the feature additions |
Are you serious .... when a file is in LFS, it is likely quite large, would you like to edit a 10MB text file on the web UI? |
There are two conditions for a file to be editable via the web interface: it must be a text file, and its size must be small. While files stored in Git LFS are typically large, we also support editing smaller text files stored in LFS since this PR have supported rename/remove such files. |
Well, that's the question: since the files in LFS are typically large, why should we spend more time and code on supporting editing "small text files in LFS"? Why such small text files were stored in LFS, isn't it an abuse ...... |
There is an inconsistency here. If this PR is merged, it would allow a text LFS file to be created or uploaded via UI, but not edited — which is confusing. I previously mentioned that editing support could be handled in a separate PR, and we shouldn’t implement it as part of this one. |
assert.NoError(t, err) | ||
|
||
filesAfterRename, _ := temp.LsFiles(ctx, "README.txt", "README.md") | ||
assert.Equal(t, []string{"README.txt", ""}, filesAfterRename) |
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.
Could you have more tests for old file is/isnot lfs file and the new file is/isnot lfs file?
Adds the ability to rename/move binary files like binary blobs or images and files that are too large in the web ui.
This was purposed in #24722, along with the ability edit images via an upload of a new image, which I didn't implement here (could be done in a separate PR).
Binary file content:

File too large:

GitHub does the same (I've copied the text from there):
