Can I make Subversion + TortoiseSVN case-insensitive for Windows?

前端 未结 8 1321
北荒
北荒 2020-12-10 01:03

I\'ve been using Subversion for code control with TortoiseSVN to interface with the server for the past few months, and in general it\'s been going great! However, occasion

相关标签:
8条回答
  • 2020-12-10 01:34

    Windows does support case sensitivity, but you must send it the correct POSIX flags on CreateFile from the Windows API! A registry key may need changed (SFU/Tools for Unix and Ultimate Windows 7 has this registry entry already set so windows supports case sensitive file names).

    Windows is designed off of Unix, but things such as Explorer.exe and other programs are designed to disallow case sensitivity for backwards compatibility and security (mostly when dealing with dos executing notepad.exe vs. NOTEPAD.EXE, where all caps is a virus or malware).

    But Vista+ has security attributes which makes this obsolete.

    TortiousSVN just doesn't support passing this posix flag while making and renaming files.

    0 讨论(0)
  • 2020-12-10 01:43

    Unfortunately, Subversion is case-sensitive. This is due to the fact that files from Subversion can be checked out on both case-sensitive file systems (e.g., *nix) and case-insensitive file systems (e.g., Windows, Mac).

    This pre-commit hook script may help you avoid problems when you check in files. If it doesn't solve your problem, my best suggestion is to write a little script to make sure that all extensions are lowercase and run it every time before you check in/check out. It'll be a PITA, but maybe your best bet.

    0 讨论(0)
  • 2020-12-10 01:45

    Kit, you comment above that VFP's binary-based source files are tough to work with in Subversion. The link I gave above mentions a couple of tools to make it easier, but the one I work with is Christof Wollenhaupt's TwoFox utility -- it converts a VFP project to text-only. You have to run it manually, but I don't have a problem with that.

    http://www.foxpert.com/docs/cvs.en.htm

    0 讨论(0)
  • 2020-12-10 01:47

    TortoiseSVN has a Repairing File Renames feature. It requires manual intervention and it actually issues a file rename operation to be committed but nonetheless addresses current use case by keeping file history.

    0 讨论(0)
  • 2020-12-10 01:48

    Nope you sure can't. SVN is case-sensitive unless you were to rewrite the code somehow ... it is open-source.

    0 讨论(0)
  • 2020-12-10 01:50

    We had a similar problem and I found a better solution than the ones exposed here, so I'm sharing it now:

    • For commits done manualy, now TortoiseSVN fixes the case of the file names automatically: it renames the local files to match the case of the versioned files (just by opening the commit window in that path), so there should be no problem with that.

    • For automated commits you cannot use TortoiseSVN, as it requires you to manually confirm the commit (it opens the commit window with a specific message, but you still have to click ok). But if you directly use Subversion (svn) to make an automated commit, then you will have the case-sensitive issue on that commit, as Subversion is still case-sensitive...

    How to solve this for automated commits? Well, I tried a mixed approach: creating a batch file called FixCaseSensitiveFileNames.bat that you may call passing the path you want to fix before the commit, for example: call FixCaseSensitiveFileNames.bat C:\MyRepo. The batch file opens TortoiseSVN for a manual commit, and that automatically fixes the file names, but then it closes the commit window after a predefined pause, so you can continue with the automated commit with the case-sensitive file names already fixed. The pause is emulated with a local ping, and you can change the duration by changing the -n argument, which is the number of tries. If you don't make a long enough pause, it exist the risk to close the TortoiseSVN window before it makes its magic fix. Here it is the code of the batch file:

    @echo off
    REM *** This BAT uses TortoiseSVN to fix the case-sensitive names of the files in Subversion
    REM *** Call it before an automated commit. The Tortoise commit fixes this issue for manual commits,
    REM *** so the trick is opening the commit window and close it automatically after a pause (with ping).
    REM *** %1 = path to be fixed
    
    start TortoiseProc.exe /command:commit /path:"%1"
    ping localhost -n 10 >nul
    taskkill /im TortoiseProc.exe
    

    This totally solved the issue for our automated daily build process. The only problem I see is a window will open for a few seconds, which was not a problem for our daily build, but if that is a problem for you there could be workarounds too...

    0 讨论(0)
提交回复
热议问题