-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix(git-cp): keep the history of the files #988
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
fix(git-cp): keep the history of the files #988
Conversation
bin/git-cp
Outdated
|
|
||
| # We keep the existing file on the side in a commit | ||
| git mv "${CURRENT_FILENAME}" "${INTERMEDIATE_FILENAME}" | ||
| git commit -a -nm "Keep $CURRENT_FILENAME" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to use -a after git mv?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is the test to avoid interruption because the original implementation was interrupted by conflict always. At first, it confused me and I thought something missing maybe, so the option -a was added. The option -a is useless for the current implementation and I forget to remove it. Fixed already.
0d721fa to
6e6f59b
Compare
spacewander
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried the PR and found out it will create multiple commits for a cp operation? The previous version only created one.
Keeping only one commit will overwrite the history always and I did not find a better way to keep the history and only one commit. But i think keeping the history of the file is meaningful. That is the reason the PR comes out. If the history did not keep anymore, the document of the |
spacewander
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I run git cp AUTHORS AUTHORS.txt with the new git-cp, but the AUTHORS.txt doesn't have the same history as AUTHORS.
Ah, it is my mistake. |

fix #985
The implement 91b3e47 gives a great idea to show the way to reach the goal. I just renew the way to show it clearly.