LeetHub
LeetHub copied to clipboard
Duplicates because of leading zeros introduced in #348
Please review previous closed issues before filling out a new one! Duplicate issues will be closed without comment.
Describe the bug In https://github.com/QasimWani/LeetHub/pull/348#issuecomment-1263449338 I highlighted that the changes proposed in #348 will break the folder structure and will lead to inconsistencies for people who used this extension for a long time already and regularly revisit questions.
For example I completed the problem 15-3Sum
before the update and now after the update again. I now have two folders for basically the same problem and two different versions (not version controlled). See screenshot.
To Reproduce Steps to reproduce the behavior:
- Use version before the leading zeros where introduces ( for example a36191a8ac39356a80d55b90690fbf1cfede774e ) and solve a problem
- Upgrade to the newest version after introducing leading zeros ( for example b46b4d5a4648ce8cf085c7ccf8dc3baf5669a0bc )
- Solve the same problem from step 1 again
- See that there are two folders for the same problem.
Expected behavior There should be a migration function. (and an option to use leading or the old format)
Additional context Two folders sounds not that bad but imagine you solved 100+ problems and some of them twice and you want to take a look at your code and suddenly see two folders. To find out which folder is now the newest one and how your code evolved over time is harder now.
Keeping leading zeros in the name doesn't seem to be a good idea It doesn't solve any problem either. The name is already unique, the results by GitHub are already sorted, you can search any question easily
good point, @ankit729. I'll make a hotfix later today.
@QasimWani , I still got a leading zero in of the submits on leetcode today. As I had already submitted that code few weeks back, I submitted it again and a new folder got created in repo.
New folder name: 0283-move-zeroes Old folder name: 283-move-zeroes
I had similar issue; i used a bash script to clean out the names;
this is how i did for my personal use;
ls > file_names.txt
sed 's/^[0]*//' file_names.txt > file_names_without_zeros.txt
paste file_names.txt file_names_without_zeros.txt > combined.txt
while read line; do mv line; done > combined.txt
the last line in above code would give some warnings if the names are unchanged but in my case this worked.
bump
Still hve this issue, along with some files don't have the number, which was prob from 2 years~ ago.