From 3e9c281e7bfacf8c5a2587fcf363896336fb2c4e Mon Sep 17 00:00:00 2001 From: Iristyle Date: Tue, 12 Mar 2013 17:53:49 -0400 Subject: [PATCH] EthanBrown.GitConfiguration - A number of "standard" Git config options on Win core.autocrlf true core.safecrlf false rebase.autosquash true help.format html push.default simple core.editor Notepad++ diff.tool DiffMerge diff.guitool DiffMerge merge.tool DiffMerge --- .../EthanBrown.GitConfiguration.nuspec | 39 ++++++++++++++ .../tools/chocolateyInstall.ps1 | 51 +++++++++++++++++++ .../tools/chocolateyUninstall.ps1 | 9 ++++ 3 files changed, 99 insertions(+) create mode 100644 EthanBrown.GitConfiguration/EthanBrown.GitConfiguration.nuspec create mode 100644 EthanBrown.GitConfiguration/tools/chocolateyInstall.ps1 create mode 100644 EthanBrown.GitConfiguration/tools/chocolateyUninstall.ps1 diff --git a/EthanBrown.GitConfiguration/EthanBrown.GitConfiguration.nuspec b/EthanBrown.GitConfiguration/EthanBrown.GitConfiguration.nuspec new file mode 100644 index 0000000..54cd1b4 --- /dev/null +++ b/EthanBrown.GitConfiguration/EthanBrown.GitConfiguration.nuspec @@ -0,0 +1,39 @@ + + + + EthanBrown.GitConfiguration + Git - Development Configuration + 0.0.1 + Various + Ethan Brown + Git configuration for Windows. + Very simple set of standard Git config on Windows + + core.autocrlf true + core.safecrlf false + rebase.autosquash true + help.format html + push.default simple + core.editor Notepad++ + + diff.tool DiffMerge + diff.guitool DiffMerge + merge.tool DiffMerge + + http://github.com/Iristyle/ChocolateyPackages/ + Git + + false + https://github.com/ferventcoder/chocolateyautomaticpackages/raw/master/git/git.png + + + + + + + + + + diff --git a/EthanBrown.GitConfiguration/tools/chocolateyInstall.ps1 b/EthanBrown.GitConfiguration/tools/chocolateyInstall.ps1 new file mode 100644 index 0000000..0178014 --- /dev/null +++ b/EthanBrown.GitConfiguration/tools/chocolateyInstall.ps1 @@ -0,0 +1,51 @@ +$package = 'EthanBrown.GitConfiguration' + +try { + # Set up git diff/merge tool + git config --global mergetool.DiffMerge.cmd '\"C:/Program Files/SourceGear/Common/DiffMerge/sgdm.exe\" --merge --result=\"$MERGED\" \"$LOCAL\" \"$BASE\" \"$REMOTE\" --title1=\"Mine\" --title2=\"Merging to: $MERGED\" --title3=\"Theirs\"' + git config --global mergetool.DiffMerge.trustExitCode true + git config --global difftool.DiffMerge.cmd '\"C:/Program Files/SourceGear/Common/DiffMerge/sgdm.exe\" \"$LOCAL\" \"$REMOTE\" --title1=\"Previous Version ($LOCAL)\" --title2=\"Current Version ($REMOTE)\"' + + $defaultMerge = git config --get merge.tool + if (!$defaultMerge -or ($defaultMerge -match 'kdiff')) + { + git config --global merge.tool DiffMerge + } + git config --global mergetool.keepBackup false + git config --global mergetool.prompt false + + $defaultDiff = git config --get diff.tool + if (!$defaultDiff -or ($defaultDiff -match 'kdiff')) + { + git config --global diff.tool DiffMerge + } + $defaultDiff = git config --get diff.guitool + if (!$defaultDiff -or ($defaultDiff -match 'kdiff')) + { + git config --global diff.guitool DiffMerge + } + git config --global difftool.prompt false + + $defaultPush = git config --get push.default + if (!$defaultPush) + { + git config --global push.default simple + } + + git config --global core.autocrlf true + git config --global core.safecrlf false + $defaultEditor = git config --get core.editor + if (!$defaultEditor) + { + git config --global core.editor "'C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugins" + } + + git config --global pack.packSizeLimit 2g + git config --global help.format html + git config --global rebase.autosquash true + + Write-ChocolateySuccess $package +} catch { + Write-ChocolateyFailure $package "$($_.Exception.Message)" + throw +} diff --git a/EthanBrown.GitConfiguration/tools/chocolateyUninstall.ps1 b/EthanBrown.GitConfiguration/tools/chocolateyUninstall.ps1 new file mode 100644 index 0000000..cf34564 --- /dev/null +++ b/EthanBrown.GitConfiguration/tools/chocolateyUninstall.ps1 @@ -0,0 +1,9 @@ +$package = 'EthanBrown.GitConfiguration' + +try { + Write-Host "Manually edit $ENV:USERPROFILE\.gitconfig to revert package changes" + Write-ChocolateySuccess $package +} catch { + Write-ChocolateyFailure $package "$($_.Exception.Message)" + throw +}