How to handle the change to “Salesforce DX project format” and keep the revision history?

Downloaded and took a brief look at the Force.com IDE 2 (Beta) this morning that layers on top of the Salesforce CLI (Beta).

As someone with many existing projects containing files that have been through many version control revisions (that I need to keep), I’m wondering how to handle the change to the layout of the files now that (it appears) the src folder is gone as are the component type folders. I did see Convert the Metadata API Source.

Any thoughts or strategies (on how to keep the revision history) appreciated.

PS

The change from Eclipse tooling to IntelliJ (Android Studio) tooling required similar changes for Android projects. This Migrating Git repo from Eclipse to Android Studio suggests the sort of process needed.

PPS

I think I’m looking for an sfdx plugin that instead of doing a convert:

sfdx force:mdapi:convert --rootdir <retrieve dir name>

runs a series of git mv commands.

Answer

If the changes are not to complicated Git is able to recognized files moves without explicitly calling git mv as described here https://stackoverflow.com/questions/433111/how-to-make-git-mark-a-deleted-and-a-new-file-as-a-file-move.

I tested this myself using our internally used packaged travel expense app.
A few month ago I was taking part in the DX Pilot and used

sfdx force:mdapi:convert --rootdir <retrieve dir name>

to convert the structure. Here is the commit which shows that all moves where recognized. I later reverted the structure back and the history of files is still there, across all the changes.

enter image description here

Attribution
Source : Link , Question Author : Keith C , Answer Author : Robert Sösemann

Leave a Comment