-
Notifications
You must be signed in to change notification settings - Fork 404
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When I imported evil's patch cleanups on macos, the case-preserving filesystem meant the easy way to rename case didn't work in about 80 instances. So introduce a scripts/patch-tool/casecheck.py which figures out the correct case and creates git mv --force commands generating this commit set Closes #1158
- Loading branch information
Showing
78 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Checks the case of patches and corrects if needs be | ||
# https://stackoverflow.com/questions/17683458/how-do-i-commit-case-sensitive-only-filename-changes-in-git | ||
# matters a lot too Basically run this on linux if you know what you are doing | ||
|
||
import os | ||
|
||
fixes = {} | ||
for dirpath, dirnames, files in os.walk("resources/data"): | ||
for name in files: | ||
dirpath = dirpath.replace("/Users/paul/music/dev/surge-clean/", "") | ||
if name.lower().endswith(".fxp") and not (name == "µcomputer.fxp"): | ||
fxp = os.path.join(dirpath, name) | ||
sname = name.split(" ") | ||
needfix = False | ||
for n in sname: | ||
|
||
start = n[0] | ||
if n[0].islower() and not ((n == "and") or (n == "de") or (n == "du")): | ||
needfix = True | ||
|
||
if needfix: | ||
newname = "" | ||
prefix = "" | ||
for n in sname: | ||
if(n[0].islower()): | ||
n = n[0].upper() + n[1:] | ||
newname = newname + prefix + n | ||
prefix = " " | ||
|
||
fixes[fxp] = os.path.join(dirpath, newname) | ||
# print(name, "->", newname) | ||
|
||
for k, v in fixes.items(): | ||
cmd = "git mv --force \"{0}\" \"{1}\"".format(k, v) | ||
print(cmd) | ||
os.system(cmd) |