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

Unrelated code appears in cherrypick's PR #636

Closed
1 task done
Rustin170506 opened this issue Jul 9, 2021 · 8 comments
Closed
1 task done

Unrelated code appears in cherrypick's PR #636

Rustin170506 opened this issue Jul 9, 2021 · 8 comments
Labels
type/bug The issue is confirmed as a bug.

Comments

@Rustin170506
Copy link
Contributor

Bug Report

  • I have searched the issues of this repository and believe that this is not a duplicate.

Related link

Steps to reproduce(Optional)

I don't know how to reproduce it.

What is expected?

Do not add code that does not appear in the original PR.

What is actually happening?

https://github.com/pingcap/ticdc/pull/2181/files#diff-03f95b96b27da3637e3aa86c8c47fe140af8529f7c9c78aa34372a6f13ca9718

This file was not added to the original pr, but appears in cherry-pick's pr.

cc: @Mini256

@Rustin170506 Rustin170506 added the type/bug The issue is confirmed as a bug. label Jul 9, 2021
@Rustin170506 Rustin170506 changed the title Strange code appears in cherrypick's PR Unrelated code appears in cherrypick's PR Jul 9, 2021
@Mini256
Copy link
Member

Mini256 commented Jul 9, 2021

It seems that it is not a completely unrelated file, because it has been modified in the original pr:
https://github.com/pingcap/ticdc/pull/2172/files#diff-03f95b96b27da3637e3aa86c8c47fe140af8529f7c9c78aa34372a6f13ca9718

@Mini256
Copy link
Member

Mini256 commented Jul 9, 2021

It seems that your PR merged into the release-5.1 branch faster than the PR that added the file.

@Rustin170506
Copy link
Contributor Author

It seems that your PR merged into the release-5.1 branch faster than the PR that added the file.

What do you mean?

@Mini256
Copy link
Member

Mini256 commented Jul 9, 2021

What do you mean?

This file is added to master by https://github.com/pingcap/ticdc/pull/1621, but it doesn't seem to be cherry-picked to release-5.1, Its pick PR has not been merged, https://github.com/pingcap/ticdc/pull/2130, So when you modify a file that doesn't exist in the release-5.1 branch, it becomes an add the file.

@Rustin170506
Copy link
Contributor Author

What do you mean?

This file is added to master by pingcap/ticdc#1621, but it doesn't seem to be cherry-picked to release-5.1, Its pick PR has not been merged, pingcap/ticdc#2130, So when you modify a file that doesn't exist in the release-5.1 branch, it becomes an add the file.

Are you saying that when we apply a patch to a branch, if the file doesn't exist, it will just copy the file? Is it possible that we can try to reproduce this issue locally? Download the patch and apply it manually? if you don't have time I can try this weekend.

@Mini256
Copy link
Member

Mini256 commented Jul 9, 2021

mkdir gittest
cd gittest
git init
echo "file 1" > 1.txt
git add .
git commit -m "init commit"
git branch -v

image

git checkout -b release-5.1
git branch -v

image

git checkout master
echo "pr #1621" > 2.txt
git add .
git commit -m "pr 1621: add 2.txt file"
git log

image

git checkout -b yourbranch
echo "pr 2172" > 2.txt
git add .
git commit -m "pr 2172: update 2.txt file"
git log

image

git branch -v
git checkout master
git merge yourbranch
git log
git branch -v

image

git checkout release-5.1
ls    # only 1.txt in release-5.1 branch now
git cherry-pick f1683596d0b645c6bc1f3ba6badb045175e86e71
git add .
git commit -m "cherry-pick 2172"
git log

image

@Mini256
Copy link
Member

Mini256 commented Jul 19, 2021

@hi-rustin, Do you have any questions about this Issue?

@Rustin170506
Copy link
Contributor Author

Thanks for your help in reproducing the issue! Can you try the GitHub patch? Also does this behavior need to be written into the documentation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

2 participants