You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While the order of files passed to `git fast-import` do not matter, we
can help users inspect --dry-run results if we can match the order that
fast-export uses. fast-export uses a depth-first sorting order to
ensure that entries underneath a directory would appear before the
directory or some kind of file or symlink that has replaced a directory.
However, its depth-first ordering is implemented in a way that affects
things besides directories becoming symlinks or files -- in contrast to
normal lexicographic ordering where a substring would sort before a
longer string, fast-export reverses that. This means that when we try
to inspect differences after a --dry-run, we may see a spurious
difference such as:
```
$ ./git-filter-repo --dry-run --proceed
$ diff -u .git/filter-repo/fast-export.original .git/filter-repo/fast-export.filtered
...
@@ -1451,25 +1329,23 @@
D testcases/expected/case1-twenty
D testcases/inputs/case1
M 100755 0a13abf testcases/t9390-repo-filter.sh
+M 100644 de3799f testcases/t9390/case1
M 100644 e0c8845 testcases/t9390/case1-filename
M 100644 a1aa78f testcases/t9390/case1-ten
M 100644 488cbd9 testcases/t9390/case1-twenty
-M 100644 de3799f testcases/t9390/case1
```
Fix this by modifying filter-repo to use the same sorting of paths as
fast-export when --dry-run is specified.
Signed-off-by: Sylvain Beucler <[email protected]>
0 commit comments