-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Not able to merge commit in PR when branches content is same, but different commit id #19603
Comments
I think you misunderstood Git slightly: |
can you please try the steps to reproduce? You will see it is real scenario, where the commit is created " See:
$ git diff fbc80940ac8d6a2fe1ddcfc988865eefda5b94a4 64dc9f325959c7d56f8c48c68b47607d1442d8ed As you can see, there is empty commit. But the commit is still valid and it carry the tag. |
I must did manual merge and push to develop without PR, to be able get the tag into develop. |
Are the commit IDs the same when you doing step 3 If you consider there is something unclear, please show your git branches history before merge. |
steps to reproduce:
|
They are not same, there is 1 commit. (the merge commit) |
There seems some misunderstanding.
tag is not binded to branch. it's visible to the whole git repository after push.
you shouldn't (and needn't), because now develop is the parent of master and there is no change at all. |
This comment was marked as off-topic.
This comment was marked as off-topic.
that is not about tags, sorry if I confuse you. It is about the empty merge commit, which I need merge by PR to develop branch. |
Sorry but it's beyond my knowledge. I can not understand why you need to do that. Let's re-open the issue to see if there are other suggestions. |
The code responsible for this: Lines 295 to 297 in f034ee6
More or less because the SHA1 of the merge commit is the same as the develop branch it thinks the pull request is empty... I'm not sure what the correct behavior would be here(maybe add a extra check here, or completely removing it? Changing this check to be more explicit about equal last commit of the branches?) |
What about to just take last commit id from the branches and compare them? Is it possible? What about to use: git rev-parse ? |
The commitID's are equal. I think we should check here if the amount of commits in the tree's aren't equal. Not sure about generating the diff, but seems like that would be more trickier(what's Github/Gitlab's behavior in this situation?) |
Good thing is, they are not equal :) If we take them exactly as they are by "git rev-parse" for example. |
I personally don't feel comfortable with messing the conflict checker. It's quite specialized in it's setup. So I don't think it's easy to simply change some commands to change the git repo's. AFAIK the commitID's will always be the same, no matter what. We simply have to add another check here that exclude this case. |
@Gusted Not sure what you mean by commits id will be always the same. When you try the example above, you can compare them and see they have different ID's. |
In sense of
No idea, most likely it was the best solution then. |
Actually I found it is even worst. |
Tests are done on this git repo: |
@zeripath Maybe as author will be interested? |
* Fixes issue go-gitea#19603 * fill HeadCommitID in PullRequest * compare real commits ID as check for merging
* Fixes issue go-gitea#19603 * fill HeadCommitID in PullRequest * compare real commits ID as check for merging * basd on zeripath patch
* Fixes issue go-gitea#19603 * fill HeadCommitID in PullRequest * compare real commits ID as check for merging * basd on zeripath patch
* giteaofficial/main: Fix icon margin in user/settings/repos (go-gitea#20281) Fix org label open count, including close count issue (go-gitea#20353) [skip ci] Updated translations via Crowdin Prevent context deadline error propagation in GetCommitsInfo (go-gitea#20346) Add missing return for when topic isn't found (go-gitea#20351) Upgrade to Node 18 on CI (go-gitea#20340) Fix checks in PR for empty commits go-gitea#19603 (go-gitea#20290) Use default values when provided values are empty (go-gitea#20318) Add tests for the host checking logic, clarify the behaviors (go-gitea#20328) Changelog for 1.16.9 (update) (go-gitea#20341) (go-gitea#20343) Fix various typos (go-gitea#20338) Correctly handle draft releases without a tag (go-gitea#20314) Add write check for creating Commit status (go-gitea#20332) Remove blue text on migrate page (go-gitea#20273) Updated dead link to Madeleine.js source (go-gitea#20322)
* Fixes issue go-gitea#19603 (Not able to merge commit in PR when branches content is same, but different commit id) * fill HeadCommitID in PullRequest * compare real commits ID as check for merging * based on @zeripath patch in go-gitea#19738
Description
Hi,
there is missing button for commit in pull request, when branches are same but there is commit to merge.
steps to reproduce:
PR says the files diff is empty (that is correct).
But also in PR is 1 commit with the merge info and created tag, which should be merged into "develop"
(just usual git flow)
Gitea Version
1.16.7
Can you reproduce the bug on the Gitea demo site?
Yes
https://try.gitea.io/jedi7/test_19603/pulls/1
Log Gist
No response
Screenshots
Git Version
2.25.1
Operating System
ubuntu
How are you running Gitea?
docker container
Database
MySQL
The text was updated successfully, but these errors were encountered: