crs-al-language-extension icon indicating copy to clipboard operation
crs-al-language-extension copied to clipboard

renaming of files in a multi-root workspace : but it works :-)

Open RafaelKoch opened this issue 5 years ago • 11 comments

Using a multi-root-workspace, using the git rename option. The output says:

28.11.2019, 09:56:41 - Warning: can't rename with git because of multiroot workspace issues.  If you want to rename objects, it's best to do it in a non-multiroot environment.
28.11.2019, 09:56:41 - Rename file from Cod50915.GOBLicenseCheckSubscriber.al to Cod50915.GOBMDELicenseMock.al

Is this actually still needed? I checked 20+ instances where we renamed objects, resulting in a git rename by Your extension. All instances were a success.

RafaelKoch avatar Nov 28 '19 13:11 RafaelKoch

I'll check with latest version, but I'm afraid so, yes ... multiroot, this "git mv" could result in empty files .. which is very frustrating...

waldo1001 avatar Nov 28 '19 13:11 waldo1001

So, in case of multiroot, i'm not renaming with "git mv", but with a classic rename, which indeed works... .

waldo1001 avatar Nov 28 '19 13:11 waldo1001

I am under the impressoin that a proper mv happened, although Your extension handled the renaming.

This is one example, properly done - though the output says it did a normal rename: image

Maybe VS Codes git integration just got smarter? ' Cause if YOU did not do git mv... something did...

RafaelKoch avatar Nov 28 '19 13:11 RafaelKoch

I'll check .. thanks!

waldo1001 avatar Nov 28 '19 14:11 waldo1001

Had to rename some folders in a .NET repo today, used VS Code for the fun of it. Same here: did no git mv but just renamed the folders. Same result, have a proper history and no add/delete. So I guess You can simply test some scenarios with AL file handling by Your extension. If this looks good, maybe drop the feature?

EDIT: did it again, looked more closely now. -> rename results in unstaged add and unstaged delete. Staging both results in a staged result similar to a mv. I am pretty sure that is not what happened in the past, I like it a lot, though.

RafaelKoch avatar Nov 29 '19 10:11 RafaelKoch

Ahoi Eric!

So it was rename time also on our side! I followed the comment saying : it does work automatically - no worries on git rename. And indeed. It worked out for me! >1000 Objects renamed...history kept - everybody happy!

KristofKlein avatar Jan 27 '20 15:01 KristofKlein

Great - thanks for the feedback! So I assume you did NOT use my "renamewithgit" setting, and you "staged" all changes before you commited them to git?

waldo1001 avatar Jan 27 '20 15:01 waldo1001

Great - thanks for the feedback! So I assume you did NOT use my "renamewithgit" setting, and you "staged" all changes before you commited them to git?

Correcto! no renamewithgit was used.

KristofKlein avatar Jan 27 '20 15:01 KristofKlein

I'm thinking of removing the "renamewithgit" and add a "git stage" at the end of a "rename all" command .. makes sense?

waldo1001 avatar Jan 27 '20 15:01 waldo1001

I wouldn`t -> it is no guarantee. One more change in the same commit for one affected file and that file will have a "broken" history regardless. This is something where You will simply have to KNOW how to handle git,

RafaelKoch avatar Jan 27 '20 15:01 RafaelKoch

yeah, you're right .. but I guess removing the "renamewithgit" makes sense nevertheless.. .

May be i could just raise a confirm-message - or just an "information"-message ;-).

I'll think about it...

waldo1001 avatar Jan 27 '20 16:01 waldo1001