问题
I want to collapse several commits into one or two in my Mercurial repository and I'm using histedit for it. Since I was not very sure how it would turn out, I've cloned my repo and tried the operation on the clone. (I've done it many times before, but this time I had some branches, and I wasn't sure how to deal with it. In the end, I've used MQ to store the branch commits while doing the collapse).
Everything's worked fine, no conflicts or anything, as it should be. So I've gone and tried it with the original repository, and lo and behold, there are merge conflicts!
How is this possible?
I know I can take the clone and apply it on the original and forget about it, or resolve the conflicts by hand, but I would like to know why and how this can happen, and learn something on the way.
回答1:
Ok, I found it!
I have a precommit hook, to apply clang-format to the commit in the original repository, but not in the clone. It was messing (well, doing its work) with the commits, causing the conflicts. After commenting out the hook, everything works as expected.
来源:https://stackoverflow.com/questions/32946193/histedit-shows-conflicts-on-original-repo-but-not-on-clone