git / git-scm.com

The git-scm.com website. Note that this repository is only for the website; issues with git itself should go to https://git-scm.com/community.
https://git-scm.com/
MIT License
2.16k stars 1.21k forks source link

The git automatically fills in deleted information. #1816

Closed shiming570 closed 10 months ago

shiming570 commented 10 months ago

Which download is failing?

version 2.27.0

Problem

I didn't find the entry for submitting issues to Git for errors, so I have to give feedback here. I found a Git logic bug. I want to discuss it with you. The scenario is as follows: When I patch the kernel 5.10 branch code to the 4.19 branch, a commit node of cherry-pick 5.10 to my own personal branch based on the 4.19 branch. The commit modifies many files, and I encounter a file conflict, the reason is that the file does not exist in the 4.19 branch. In this case, I only need to delete the file because I do not need it. Later, someone synchronized the file from the 5.10 branch to the 4.19 branch. At this time, I pulled a new personal branch based on the new 4.19 branch, and cherry-pick the patch that I merged on the old personal branch, when the commit node is integrated, it automatically carries the conflict information that has been deleted. For the source code, no error is reported. However, for the user, it does not meet the expectation because the conflict point has been deleted, later, because the file exists, the information is automatically filled in, which seems very intelligent and helps the user to automatically fill in the file, and the user does not need to resolve the conflict herein. However, a problem of a new scenario exists. For example, for Linux-based open-source communities such as OpenEuller and Red Hat, they have independent artifact repositories. The source code repository is synchronized to the artifact repository periodically. In this case, the time difference causes inconsistency between the artifact repository and the source code repository, in this case, if I compile the kernel in the source code repository, the problem is not found because Git automatically fills in the modification part. When I submit the patch to the product repository, the patch failure occurs because the product repository does not contain the file. In conclusion, the git system should avoid the behavior that the user has deleted the conflict information and then the information is automatically filled in because of the addition of the file. This is not as expected for the user. The problem scenario is complex and the description is vague. If you have any questions, please contact me.

Operating system and browser

linux

Steps to reproduce

  1. Run the git cherry-pick commit_id command to manually delete the conflict because a file does not exist.
  2. Pull out an update branch again. At this time, the branch already has the file that does not exist. When the commit operation of the old branch on cherry-pick is performed, the deleted information is automatically filled in because the file that does not exist before is identified.

Other details

No response

pedrorijo91 commented 10 months ago

As you can see in the issue template, this repository issue tracker should only be used to report problems found on the git-scm website (https://git-scm.com/).

Git specific issues should be raised with the community (https://git-scm.com/community).