mirror of
https://github.com/go-gitea/gitea.git
synced 2026-03-12 10:39:38 -05:00
Merging pull requests on repository with LFS not working #2067
Closed
opened 2025-11-02 04:23:03 -06:00 by GiteaMirror
·
28 comments
No Branch/Tag Specified
main
release/v1.25
release/v1.24
release/v1.23
release/v1.22
release/v1.21
release/v1.20
release/v1.19
release/v1.18
release/v1.17
release/v1.16
release/v1.15
release/v1.14
release/v1.13
release/v1.12
release/v1.11
release/v1.10
release/v1.9
release/v1.8
v1.25.3
v1.25.2
v1.25.1
v1.25.0
v1.24.7
v1.25.0-rc0
v1.26.0-dev
v1.24.6
v1.24.5
v1.24.4
v1.24.3
v1.24.2
v1.24.1
v1.24.0
v1.23.8
v1.24.0-rc0
v1.25.0-dev
v1.23.7
v1.23.6
v1.23.5
v1.23.4
v1.23.3
v1.23.2
v1.23.1
v1.23.0
v1.23.0-rc0
v1.24.0-dev
v1.22.6
v1.22.5
v1.22.4
v1.22.3
v1.22.2
v1.22.1
v1.22.0
v1.23.0-dev
v1.22.0-rc1
v1.21.11
v1.22.0-rc0
v1.21.10
v1.21.9
v1.21.8
v1.21.7
v1.21.6
v1.21.5
v1.21.4
v1.21.3
v1.21.2
v1.20.6
v1.21.1
v1.21.0
v1.21.0-rc2
v1.21.0-rc1
v1.20.5
v1.22.0-dev
v1.21.0-rc0
v1.20.4
v1.20.3
v1.20.2
v1.20.1
v1.20.0
v1.19.4
v1.21.0-dev
v1.20.0-rc2
v1.20.0-rc1
v1.20.0-rc0
v1.19.3
v1.19.2
v1.19.1
v1.19.0
v1.19.0-rc1
v1.20.0-dev
v1.19.0-rc0
v1.18.5
v1.18.4
v1.18.3
v1.18.2
v1.18.1
v1.18.0
v1.17.4
v1.18.0-rc1
v1.19.0-dev
v1.18.0-rc0
v1.17.3
v1.17.2
v1.17.1
v1.17.0
v1.17.0-rc2
v1.16.9
v1.17.0-rc1
v1.18.0-dev
v1.16.8
v1.16.7
v1.16.6
v1.16.5
v1.16.4
v1.16.3
v1.16.2
v1.16.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-rc1
v1.3.2
v1.3.1
v1.3.0
v1.3.0-rc2
v1.3.0-rc1
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.2.0-rc3
v1.2.0-rc2
v1.1.4
v1.2.0-rc1
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.2
v1.0.1
v1.0.0
v0.9.99
Labels
Clear labels
$20
$250
$50
$500
backport/done
💎 Bounty
docs-update-needed
good first issue
hacktoberfest
issue/bounty
issue/confirmed
issue/critical
issue/duplicate
issue/needs-feedback
issue/not-a-bug
issue/regression
issue/stale
issue/workaround
lgtm/need 2
modifies/api
modifies/translation
outdated/backport/v1.18
outdated/theme/markdown
outdated/theme/timetracker
performance/bigrepo
performance/cpu
performance/memory
performance/speed
pr/breaking
proposal/accepted
proposal/rejected
pr/wip
pull-request
reviewed/wontfix
💰 Rewarded
skip-changelog
status/blocked
topic/accessibility
topic/api
topic/authentication
topic/build
topic/code-linting
topic/commit-signing
topic/content-rendering
topic/deployment
topic/distribution
topic/federation
topic/gitea-actions
topic/issues
topic/lfs
topic/mobile
topic/moderation
topic/packages
topic/pr
topic/projects
topic/repo
topic/repo-migration
topic/security
topic/theme
topic/ui
topic/ui-interaction
topic/ux
topic/webhooks
topic/wiki
type/bug
type/deprecation
type/docs
type/enhancement
type/feature
type/miscellaneous
type/proposal
type/question
type/refactoring
type/summary
type/testing
type/upstream
Mirrored from GitHub Pull Request
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/gitea#2067
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @severgun on GitHub (Jul 18, 2018).
[x]):Description
Merging pull requests from web interface not working on repository with LFS.
I can commit, merge and push branches on local machine with git CLI or Github for Windows, but not in gitea web.
Web Interface just fall to error 500 page after pressing Merge button.
Gitea.log:
Seems like something related to lfs.url on server side, but what and how to fix?
@lunny commented on GitHub (Jul 20, 2018):
Have you installed git-lfs on your sever?
@severgun commented on GitHub (Jul 20, 2018):
Yes.
Also, broken once LFS pull request broke all webui merges for that repo.
@severgun commented on GitHub (Jul 21, 2018):
After I add
lfs.url = http://94.000.000.000:3000/Liquid/Test.git/info/lfsin .lfsconfig and push it to master I got new error.From
batch request: missing protocol:toMerge: git push: Invalid remote name "/home/git/gitea-repositories/liquid/Test.git"@gerroon commented on GitHub (Aug 7, 2018):
@severgun
Did you solve this issue? I am facing it as well.
@severgun commented on GitHub (Aug 10, 2018):
Nope. Tagged as a bug. Waiting for a fix.
Seems like gitea now in pre-alpha unstable test because there is dozens of new issues per day.
@gerroon commented on GitHub (Aug 10, 2018):
@severgun thanks
@chowey commented on GitHub (Sep 12, 2018):
I'm getting the following error log when merging a pull request with LFS:
I'm using Gitea on Windows.
@Haixing-Hu commented on GitHub (Nov 22, 2018):
same problem. any solution?
@ghost commented on GitHub (Nov 27, 2018):
same problem.
OS:centos7
gitea.log
@stale[bot] commented on GitHub (Jan 26, 2019):
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
@linghu86 commented on GitHub (May 13, 2019):
same problem
@Begounet commented on GitHub (May 23, 2019):
same problem
@zeripath commented on GitHub (May 23, 2019):
Which version of Gitea are you using?
@Begounet commented on GitHub (May 23, 2019):
Gitea Version: 1.7.1
Edit: Do you think the issue has been fixed since?
Edit2: We just saw that the Gitea version goes from 1.7.1 to 1.8.1 in 5 months! You are so efficient!
Our admin has been told about it and will update the version tonight. I will be able to tell you about it tomorrow.
Edit3: Got an emergency, we had to delay the update. We will go back to you when it will be done :)
@Begounet commented on GitHub (May 24, 2019):
Ok, so we updated to 1.8.1 but the issue is still present.
Edit: the issue occured when I tried a "merge with rebase" but not with a "standard merge". Still investigating on reproducing the issue.
Edit: I made a new test by just adding one single 4x4 image (so it is filtered by Git LFS) and the merge didn't work.
@zeripath commented on GitHub (May 25, 2019):
OK so I bet this is same issue as #4760 and #732
@zeripath commented on GitHub (May 25, 2019):
Now I am willing to bet that you have git-lfs version greater than 2.3.4 installed on your server and gitea user has a .gitconfig file containing:
If you remove that that should act as a workaround.
OK so that's not enough. Do your repos have .lfsconfig or is there an additional lfsconfig you're running?In particular I'm highly suspicious that the there islfs.storageset.@zeripath commented on GitHub (May 25, 2019):
I bet if you remove that - the problem will disappear.@zeripath commented on GitHub (May 25, 2019):
Which is obviously not a complete solution but if it works then I know that I am at least on the right track.@zeripath commented on GitHub (May 25, 2019):
OK, I think I've looked at this a bit more I think this is due to us previously cloning without setting --shared and without adding an alternative object dir reference for the pulled branch. What doesn't make sense though is that @Begounet has reported this on 1.8.1 - which also shouldn't be cloning without shared repository settings...
@Begounet I wonder can you reproduce this on master? What is your version of git lfs? Mine is:
@ghost commented on GitHub (May 26, 2019):
This issue is not related to the version of git-lfs.
Gitea does not store the LFS objects in repositories/xxx.git/lfs/objects, but Git transfers the files from the local directory instead of Gitea's LFS server.
local-repo/merge-xxxxx.git/.git:
Also, I don't think it's a good idea to download the LFS file to the local temp folder and merge the PR.
@zeripath commented on GitHub (May 26, 2019):
@yasuokav it might actually be related to LFS version. For example prior to 11 months ago git LFS would definitely fail on multiple alternative repositories. I don't get this problem on 2.3.4 and I know git-lfs changed their handling of local clones at some point - likely around 2.6. So if you're experiencing this bug would you please tell me what your server's version of git-lfs is? I suspect it is highly pertinent.
Now, I agree that I'm not certain that grabbing the LFS objects in order to do a merge is a good idea. I will look at stopping this. If you are experiencing this bug there are a couple of things I would like to know:
So that's 3 questions but the git-lfs version question is pertinent. So please tell me.
@ghost commented on GitHub (May 26, 2019):
@zeripath
@zeripath commented on GitHub (May 26, 2019):
Cool. I can check if I can reproduce this with 2.4 - (looking at the release information for 2.4 they rewrote their file API at that point so that's highly suspicious.)
Ok.
In terms of quick fix for this I would guess that the most sensible thing is for Gitea to have its own .gitconfig in which LFS is not installed. Either that or determine a way to commit without running filters.
The correct answer is to change to an index based merging style - then filters etc don't matter as we determine what goes in to the index. You shouldn't be experiencing this bug on repo edit, or upload is because I rewrote these sections to do their work directly with the index.
@zeripath commented on GitHub (May 26, 2019):
But this at least finally gives those of you experiencing this bug a workaround until I get a fix in.
@zeripath commented on GitHub (May 26, 2019):
Sorry this has taken so long to figure out.
@zeripath commented on GitHub (May 27, 2019):
OK, I've finally had a chance to download git-lfs 2.4.0 and git-lfs 2.7.2 and I still can't reproduce this.
If you can work out a minimal testcase that breaks for you I can try to replicate and figure out exactly what's causing the breakage, however what I might do is add a note to the troubleshooting page.
@zeripath commented on GitHub (May 27, 2019):
I also think we should mark this as a duplicate of #732