darcs

Patch 1439 WIP handle file moves when importing from git

Title WIP handle file moves when importing from git
Superseder Nosy List gh, owst
Related Issues
Status accepted Assigned To
Milestone

Created on 2016-01-22.19:17:56 by gh, last changed 2016-02-04.17:46:51 by gh.

Files
File name Status Uploaded Type Edit Remove
patch-preview.txt gh, 2016-01-22.19:17:55 text/x-darcs-patch
patch-preview.txt gh, 2016-01-22.19:50:46 text/x-darcs-patch
patch-preview.txt gh, 2016-01-25.14:31:18 text/x-darcs-patch
tests-related-to-git-import-of-file-moves.dpatch gh, 2016-01-25.14:31:18 application/x-darcs-patch
unnamed gh, 2016-01-22.19:17:55 text/plain
unnamed gh, 2016-01-22.19:50:46 text/plain
unnamed gh, 2016-01-25.14:31:18 text/plain
wip-handle-file-moves-when-importing-from-git.dpatch gh, 2016-01-22.19:17:55 application/x-darcs-patch
wip-handle-file-moves-when-importing-from-git.dpatch gh, 2016-01-22.19:50:46 application/x-darcs-patch
See mailing list archives for discussion on individual patches.
Messages
msg18956 (view) Author: gh Date: 2016-01-22.19:17:55
Here is my current progress on porting import of file moves
from Owen's darcs-bridge. It is a feature that would help
create much better darcs imports (one can see in any big git repository
that file moves often happen: `git fast-export -M | grep "^R "`).

I need help with the compilation errors I'm getting:

<http://lpaste.net/4673015084807618560>

To port the code I looked, in the repository [1], at the following diff:

    darcs diff --from-hash b138854b72  --to-hash dd804b514f0

Which contains two patches (the first one changing InCommit so that it
contains an RL, and the second one that parses and interpret file moves).

I also looked at the latest recorded state of the darcs-bridge repository.

[1] http://hub.darcs.net/owst/darcs-bridge-export-branch

1 patch for repository http://darcs.net:

patch 0d401b983e53a52e3f8892425bb0f41c81b2292d
Author: Guillaume Hoffmann <guillaumh@gmail.com>
Date:   Fri Jan 22 16:20:56 ART 2016
  * WIP handle file moves when importing from git
Attachments
msg18957 (view) Author: gh Date: 2016-01-22.19:21:15
The correct command to see file moves is:

    git fast-export HEAD -M | grep "^R "
msg18958 (view) Author: gh Date: 2016-01-22.19:23:51
The file that does not compile:

<http://hub.darcs.net/gh/darcs-screened_1/browse/src/Darcs/UI/Commands/Convert.hs>
msg18959 (view) Author: gh Date: 2016-01-22.19:50:46
Patch now compiles, but it breaks the existing test on
deleting empty directories during import.


1 patch for repository http://darcs.net:

patch 05cc941e4a6e57a87a6c27b39f677942a8aaa27d
Author: Guillaume Hoffmann <guillaumh@gmail.com>
Date:   Fri Jan 22 16:52:57 ART 2016
  * WIP handle file moves when importing from git
Attachments
msg18961 (view) Author: gh Date: 2016-01-25.14:31:18
A working version.

I tested it with various git repositories I had on my
machine (cryptol, pandoc, gitit, git, ghc, learn you a haskell)
which helped me found cases where the interaction between file moves
and new directories could be problematic. Also (and unlike Owen's
darcs-bridge if I'm not mistaken), this current code does delete empty
directories after a file move.

In the shell tests, after converting to darcs it is important
to run "darcs check" since I had cases where I made the import code
create inconsistent pristines.

I've added an explicit dependency on the patch that modifies RL. This also
implies that the bundle will not make it to branch 2.10.

3 patches for repository http://darcs.net:

patch 21d147a476e4db70e66bc26d1259742f1f2f1215
Author: Guillaume Hoffmann <guillaumh@gmail.com>
Date:   Mon Jan 25 11:21:11 ART 2016
  * tests related to git import of file moves

patch ccaa9c41ffc77ee08eba120ca33ef47bbbc4a5a6
Author: Guillaume Hoffmann <guillaumh@gmail.com>
Date:   Mon Jan 25 11:22:08 ART 2016
  * recommend using -M flag on git fast-export

patch 2a6b06f9a17ec0bcf28cb164684e6c678bc86631
Author: Guillaume Hoffmann <guillaumh@gmail.com>
Date:   Mon Jan 25 11:40:46 ART 2016
  * handle file moves and copies when importing from git
  Ported from Owen Stephen's darcs-bridge
Attachments
msg19016 (view) Author: gh Date: 2016-02-04.17:46:51
Tried again with curl's git repository (HEAD), succesfully created a >
20K darcs repo with file moves). Self-accept.
History
Date User Action Args
2016-01-22 19:17:56ghcreate
2016-01-22 19:21:15ghsetmessages: + msg18957
2016-01-22 19:23:51ghsetmessages: + msg18958
2016-01-22 19:50:46ghsetfiles: + patch-preview.txt, wip-handle-file-moves-when-importing-from-git.dpatch, unnamed
messages: + msg18959
2016-01-25 14:31:19ghsetfiles: + patch-preview.txt, tests-related-to-git-import-of-file-moves.dpatch, unnamed
messages: + msg18961
2016-01-25 18:31:14ghsetstatus: needs-screening -> needs-review
2016-01-26 10:50:25ghsetnosy: + owst
2016-02-04 17:46:51ghsetstatus: needs-review -> accepted
messages: + msg19016