-
Notifications
You must be signed in to change notification settings - Fork 12
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
restore history for Slider.js #389
Comments
@samreid said in #380 (comment): Normally WebStorm can track history across file renames. However for HSlider.js => Slider.js, it is failing to follow the history: This is confusing because
I typically find it most useful to be able to use the WebStorm history features when looking back in time, I'm not sure what is different in this case, but I thought I should point it out as soon as possible. |
@samreid said in #380 (comment): In the GitHub diff page showing the diff, it is treating Slider.js as a new file (if I'm reading this correctly): |
I'm not sure what happened here. I used WebStorm to rename the file. And for any file that was renamed, I noted it's original name in the JSdoc at the top of the file. What do you suggest? |
@samreid said in #380 (comment): It looks like something went wrong with the rename. Perhaps WebStorm had a git failure during that step. Can that step be re-done so we can easily access the history? Easy access to the history for this file seems particularly important because it crosses a11y and phet-io and is a widely used component. |
There was no git failure indicated by WebStorm. Perhaps it got confused because the file was renamed, and then a new file named HSlider was created. I have no idea how to this can be "re-done". |
@samreid said in #380 (comment): Basically, you could try:
EDIT: changed would => could |
The steps in #389 (comment) do not work. I can't commit to a detached HEAD. |
I recall a previous developer meeting where we discussed a similar problem. We couldn't figure out how to move the history, so we instituted a policy of putting a note in the renamed files indicating what the old name was. I did that for all files that were renamed in this case. @jonathanolson any ideas about how to move the history to Slider.js? |
Something like https://stackoverflow.com/questions/4114095/how-to-revert-a-git-repository-to-a-previous-commit History should only be a problem when moving repos, which we are not doing here. |
@samreid When I select Slider.js and press the "Show history" button in the WebStorm toolbar: Slider.js appears twice in the History menu for the Version Control pane: Choosing one of these entries shows me the equivalent of Various hits for Google searches "git preserve file history when renaming" (e.g. https://stackoverflow.com/questions/2314652/is-it-possible-to-move-rename-files-in-git-and-maintain-their-history) also indicate that things are behaving properly from the git command line. That is, you need to GitHub doesn't show history for renamed/moved files. It's a requested feature, see isaacs/github#900. So I'm skeptical that "History should only be a problem when moving repos" is an accurate statement. |
Very odd... After restarting Webstorm, then selecting Slider.js, then "Show History", I see Slider.js only once in the History menu. And it shows the complete history of the file ( |
According to the documentation for |
More at https://stackoverflow.com/questions/2314652/is-it-possible-to-move-rename-files-in-git-and-maintain-their-history. A few statements from that topic:
|
I'd like to get this sorted out sooner rather than later, since subsequent commits on sun (such as eb7cd2b ) could complicate things. However, if I follow the git revert strategy proposed in #389 (comment) and apply the changes in #389 (comment) myself, then it will change @pixelzoom's commits to incorrectly come from me. I could add a note in the commit message that the commits are really from @pixelzoom--I would rather have easy access to the full history with a few commits from the wrong person, than losing the history halfway through. Alternatively, @pixelzoom and I could sort this out by working together, or @pixelzoom could follow the proposed steps alone to get the commits to come from the right person. Maybe I'll check the proposed strategy on my working copy (without pushing anything) to make sure the instructions are right... |
I followed these steps: // Work in a branch, just in case (optional) // // Revert the 3 commits on this repo related to the name change, newest first. Use the default commit message that git generates Note I haven't pushed anything yet--we can push after we decide how to proceed. Observe that WebStorm can easily access the full history across the rename: Step (6) will be to reapply the other changes that were made as part of those 3 commits. @pixelzoom how would you like to proceed? |
Let's work on this together, because the above steps are not working for me. After the reverts, WebStorm tells me that I have nothing to commit. I'm also not seeing history across rename for SliderTrackIO (renamed from HSliderTrackIO). So I'd like to: (1) Make sure we address all problem files at once. |
Signed-off-by: Chris Malley <cmalley@pixelzoom.com>
Signed-off-by: Chris Malley <cmalley@pixelzoom.com>
Signed-off-by: Chris Malley <cmalley@pixelzoom.com>
Webstorm was not following history across rename for Slider.js and SliderTrackIO.js. @samreid and I collaborated on restoring history over Zoom. We followed the steps in #389 (comment), including creation of a local branch. We renamed files as one commit, then applied all other changes as a second commit. After testing working copy, we then merged the local branch into master, then tested again. For me, Webstorm is now consistently showing history across renames. And command line ( I still don't understand what Webstorm "Show history" is showing, or why it was so flakey/inconsistent. And I don't understand why Webstorm correctly handled the rename for some files (e.g. SliderTrack.js) but not others (e.g. SliderTrackIO.js). I guess I'll do further renames as a separate commit. @samreid Is going to spot check things before closing this issue. |
WebStorm can now easily access the history of Slider.js, I did not see any other issues, closing. |
I found these notes about what the JetBrains history shows:
|
As part of #380, HSlider.js was renamed Slider.js, and a new HSlider.js was created. After committing and pushing, the history is with the new HSlider file, and Slider is being treated as a new file. Everything was done using WebStorm.
The text was updated successfully, but these errors were encountered: