nfdi4plants / ARCitect

Cross-platform app to create and manage ARCs.
9 stars 6 forks source link

[BUG] renaming study / assay conflicts with commit reset #205

Open Brilator opened 3 months ago

Brilator commented 3 months ago
  1. rename e.g. study via context menu
  2. go to commit panel (see changes= removed files old-studyName, added files new-studyName)
  3. Click "reset" (i.e. git reset --hard)
  4. Bug: added files new-studyName still present
Brilator commented 3 months ago

tested with https://github.com/nfdi4plants/ARCitect/commit/2b23c9258474a3d868848ae4a1f33e47afbf4084

JonasLukasczyk commented 3 months ago

This is expected behavior. Git reset does only restore all tracked files form a specific commit to the state of that commit. Other untracked files (for example those generated by copies) are not deleted by git. We could offer the following feature: a one button solution that deletes the entire ARC and performs a fresh clone. Then the ARC is completely reset to the state of the remote repo. HOWEVER: Any local commits not pushed to the remote will be lost plus all untracked files. So I do not know if this does more harm than good.

JonasLukasczyk commented 1 week ago

@Brilator I suggest the following feature: if users click on the Reset button they will be presented with a dialog in which they can choose from the following options:

  1. Soft Reset: all files tracked by git will be reset to the last commited version, changes to those files are lost
  2. Hard Reset: the content of the ARC is deleted including files not tracked by git, and then the files of the last commit are restored.

Should I add this?

Brilator commented 1 week ago

Sounds good to me

Brilator commented 1 week ago

For hard reset add a clear warning about possible data loss / making sure to have a copy.