{endcode} 1: You will need to run =stashticket= once a month on whatever machine you ssh into. + +{subsection: Dealing with the line ending mess like Todd does} + +Unix machines and our git repo wants to see source terminated with unix-style terminations, aka just a newline. Microsoft dev studio, however, likes to terminate source code with dos-style terminations, aka a carriage-return plus a linefeed. If you aren't careful, when you commit code from windows, you will end up with messy diff that may show all sorts of lines changed that shouldn't be (just because the line termination changed), and unix users may be unhappy because they will see =\r= characters everywhere in the source. Yuck. + +So what I do is religiously run a batch file (I call it =precommit.bat=) before I add any file into the git index with the =git add= or the =git commit -a= commands. It is safe to run this batch file at any time (running it over and over isn't a problem), but important to run this batch file before adding any files into the index - just running it before you do a commit or push is too late. This batch file essentially parses the output from git status to see figure out a list of modified files, and then it runs =dos2unix.exe= on each file in turn. Here it is: +{code} +@echo off +REM Edit the path on the next line to point into your git clone +pushd c:\home\tannenba\condor\CONDOR_SRC +git status | findstr /C:"modified: src/" /C:"new file: src/" | sed.exe "s/\//\\/g" | sed.exe "s/modified:/mod ified:/" > %TEMP%\_precom.tmp +for /f "tokens=4" %%I in (%TEMP%\_precom.tmp) do (dos2unix.exe "%%I") +popd +{endcode} +You will want to edit the file path at the top of the batch file, make certain environment variable TEMP is set to a writeable subdirectory, and have git.exe, sed.exe, and dos2unix.exe in your path. For sed.exe, a good one to use is the one found in =CONDOR_SRC\msconfig\sed.exe=. For dos2unix.exe, I attached the one I use to this wiki page below.