From 3f00dfc2b5a6e787570f7e7189b5b058813bd067 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Tue, 24 Jan 2017 19:53:30 +0000 Subject: [PATCH] Add basic Windows-specific git configs (#72) --- .gitconfig.linux | 1 - .gitconfig.mac | 1 - .gitconfig.windows | 3 ++ .gitconfig_includes.cygwin | 2 ++ .gitconfig_includes.windows | 11 ++++++++ common/configure_fresh_system.sh | 2 +- windows/build.bat | 47 ++++++++++++++++++++------------ windows/build_insider.sh | 3 ++ 8 files changed, 50 insertions(+), 20 deletions(-) create mode 100644 .gitconfig.windows create mode 100644 .gitconfig_includes.windows diff --git a/.gitconfig.linux b/.gitconfig.linux index 7371af72..4998347e 100644 --- a/.gitconfig.linux +++ b/.gitconfig.linux @@ -1,4 +1,3 @@ [include] path = dev/dotfiles/.gitconfig_includes.common path = dev/dotfiles/.gitconfig_includes.linux - diff --git a/.gitconfig.mac b/.gitconfig.mac index 93bd2ab4..93e599b8 100644 --- a/.gitconfig.mac +++ b/.gitconfig.mac @@ -1,4 +1,3 @@ [include] path = dev/dotfiles/.gitconfig_includes.common path = dev/dotfiles/.gitconfig_includes.mac - diff --git a/.gitconfig.windows b/.gitconfig.windows new file mode 100644 index 00000000..7ae150a8 --- /dev/null +++ b/.gitconfig.windows @@ -0,0 +1,3 @@ +[include] + path = dev/dotfiles/.gitconfig_includes.common + path = dev/dotfiles/.gitconfig_includes.windows diff --git a/.gitconfig_includes.cygwin b/.gitconfig_includes.cygwin index 2aa43a69..f6994b09 100644 --- a/.gitconfig_includes.cygwin +++ b/.gitconfig_includes.cygwin @@ -1,3 +1,5 @@ +[core] + autocrlf = false [difftool "winmerge"] cmd = 'C:/Program Files (x86)/WinMerge/WinMergeU.exe' "$(cygpath -wla $LOCAL)" "$(cygpath -wla $REMOTE)" trustExitCode = false diff --git a/.gitconfig_includes.windows b/.gitconfig_includes.windows new file mode 100644 index 00000000..c55f98fe --- /dev/null +++ b/.gitconfig_includes.windows @@ -0,0 +1,11 @@ +[core] + autocrlf = false +[merge] + tool = p4merge +[mergetool "p4merge"] + path = C:/Program Files/Perforce/p4merge.exe +[diff] + tool = kdiff3 +[difftool "kdiff3"] + path = C:/Program Files/KDiff3/kdiff3.exe + trustExitCode = false diff --git a/common/configure_fresh_system.sh b/common/configure_fresh_system.sh index 919508ba..d55c4641 100755 --- a/common/configure_fresh_system.sh +++ b/common/configure_fresh_system.sh @@ -136,7 +136,7 @@ if [[ -z $NORUBY ]]; then source ~/.rvm/scripts/rvm set -e echo "Installing Ruby..." - rvm install 2.3.1 --disable-binary + rvm install ruby --disable-binary fi if [[ -z $NOVIM ]]; then diff --git a/windows/build.bat b/windows/build.bat index 10a01533..d05ecd5d 100644 --- a/windows/build.bat +++ b/windows/build.bat @@ -1,17 +1,30 @@ -@echo on -choco install -y --allowEmptyChecksum firefox googlechrome wget notepadplusplus sublimetext3 mono monodevelop gtksharp visualstudiocode p4merge dotnet4.5 nodejs.install conemu dejavufonts ag golang wireshark procexp procmon drmemory.install WinPcap keepass.install nextcloud-client f.lux -call refreshenv - -wget -c https://cygwin.com/setup-x86_64.exe -setup-x86_64.exe -R "C:\cygwin64" -s http://mirror.switch.ch/ftp/mirror/cygwin/ -q -g -P curl,zsh,git,vim,wget,xz,tar,gawk,bzip2,subversion,zlib,fontconfig,clang,cmake,lua,perl,the_silver_searcher,gnupg,patch,zlib-devel,openssl-devel,libyaml-devel,libyaml0_2,sqlite3,make,libtool,autoconf,automake,bison,m4,mingw64-i686-gcc-core,mingw64-x86_64-gcc-core,patch,cygwin32-readline,libcrypt-devel,libcrypt0,ncurses,libncurses-devel,python-devel,libxslt,libxslt-devel,libjpeg-devel - -copy /Y conemu.xml %appdata%\Roaming\ConEmu.xml - -set script_path=%~dp0 -set repo_path=%script_path%\..\ -set bash=c:\cygwin64\bin\bash.exe --login -c - -for /f "delims=" %%A in ('%bash% "cd `cygpath $HOMEPATH`/dev/dotfiles && git rev-parse --abbrev-ref HEAD"') do set "branch=%%A" -%bash% 'echo "branch is $branch"' -%bash% "cp -vr `cygpath $HOMEPATH`/.ssh $HOME/" -%bash% "export OUTER_CLONE=`cygpath $repo_path` && $script_path/build_insider.sh" +@echo on +choco install -y --allowEmptyChecksum firefox googlechrome wget notepadplusplus sublimetext3 mono monodevelop gtksharp visualstudiocode p4merge dotnet4.5 nodejs.install conemu dejavufonts ag golang wireshark procexp procmon drmemory.install WinPcap keepass.install nextcloud-client f.lux +choco upgrade -y all +call refreshenv + +wget -c https://cygwin.com/setup-x86_64.exe +setup-x86_64.exe -R "C:\cygwin64" -s http://mirror.switch.ch/ftp/mirror/cygwin/ -q -g -P curl,zsh,git,vim,wget,xz,tar,gawk,bzip2,subversion,zlib,fontconfig,clang,cmake,lua,perl,the_silver_searcher,gnupg,patch,zlib-devel,openssl-devel,libyaml-devel,libyaml0_2,sqlite3,make,libtool,autoconf,automake,bison,m4,mingw64-i686-gcc-core,mingw64-x86_64-gcc-core,patch,cygwin32-readline,libcrypt-devel,libcrypt0,ncurses,libncurses-devel,python-devel,libxslt,libxslt-devel,libjpeg-devel + +set script_path=%~dp0 +set repo_path=%script_path%\..\ +pushd %repo_path% +set repo_path=%CD% +popd + +set bash=c:\cygwin64\bin\bash.exe --login -c + +for /f "delims=" %%A in ('%bash% "cd `cygpath $HOMEPATH`/dev/dotfiles && git rev-parse --abbrev-ref HEAD"') do set "branch=%%A" +%bash% 'echo "branch is $branch"' +%bash% "cp -vr `cygpath $HOMEPATH`/.ssh $HOME/" +%bash% "export OUTER_CLONE=`cygpath $repo_path` && $script_path/build_insider.sh" + +echo Configuring Windows-specific settings +echo %repo_path% is repo path + +if not exist "%appdata%\Roaming\" mkdir "%appdata%\Roaming\" +IF EXIST "%appdata%\Roaming\ConEmu.xml" del /F "%appdata%\Roaming\ConEmu.xml" +mklink /h "%appdata%\Roaming\ConEmu.xml" "%repo_path%\conemu.xml" + +IF EXIST "%HOMEPATH%\.gitconfig" del /F "%HOMEPATH%\.gitconfig" +mklink /h "%HOMEPATH%\.gitconfig" "%repo_path%\.gitconfig.windows diff --git a/windows/build_insider.sh b/windows/build_insider.sh index e2ab6626..cab3da8b 100644 --- a/windows/build_insider.sh +++ b/windows/build_insider.sh @@ -40,7 +40,10 @@ python /tmp/get-pip.py # expose all the binaries fetched during the outer build export PATH="$OUTER_CLONE:$PATH" +echo "Invoking common configuration script" $DIR/common/configure_fresh_system.sh + +echo "Making symlinks" ln -vfs $DIR/windows_cygwin/.minttyrc $HOME/ ln -vfs "$DOTFILES_PATH/.gitconfig.cygwin" $HOME/.gitconfig ln -vfs $DIR/.vimrc.cygwin $HOME/.vimrc