Skip to content

Instantly share code, notes, and snippets.

@silicontrip
Created July 25, 2016 04:39
Show Gist options
  • Select an option

  • Save silicontrip/f2bb2fbe82b537f9fc19e5c4b9ee6627 to your computer and use it in GitHub Desktop.

Select an option

Save silicontrip/f2bb2fbe82b537f9fc19e5c4b9ee6627 to your computer and use it in GitHub Desktop.
task 1 remove duplicates;
make list of duplicates
duplicate_list[] = file[2]
for duplicate_list:
# get both parents of each file.
path1 = file[0].parent
path2 = file[1].parent
# perform path ordering so same 2 paths make the same key
parents[path1;path2] ++
sort_highest_first(parents)
for sort parents[]:
res = path_diff (path1,path2)
if res == identical { prompt for path to delete; }
if res != identical { prompt for direction to sync; delete source; }
task 2 merge repository source -> destination;
make list of duplicates
for sort parents[]:
if res != identical { copy from source to destination; delete source; }
sync remaining files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment