From 52b24416b2fae3add8a53a397aaa5f59a01dc03b Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Sat, 3 Dec 2011 00:24:55 +0100 Subject: [PATCH] Fixed issue #933: implement git stash --include-untracked Signed-off-by: Sven Strickroth --- src/Changelog.txt | 1 + src/Resources/TortoiseProcENG.rc | 12 +++++++----- src/TortoiseProc/AppUtils.cpp | 3 +++ src/TortoiseProc/StashSave.cpp | 8 +++++++- src/TortoiseProc/StashSave.h | 1 + src/TortoiseProc/resource.h | 1 + 6 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/Changelog.txt b/src/Changelog.txt index b7b11d4b9..5ccb7e6fd 100644 --- a/src/Changelog.txt +++ b/src/Changelog.txt @@ -10,6 +10,7 @@ * Fixed issue #985: Store status for view patch in commit dialog * Fixed issue #977: Fetch does not have an option to fetch tags * Fixed issue #801: Be able to enter a custom stash message + * Fixed issue #933: implement git stash --include-untracked == Bug Fix == * Fixed issue #747: TortoiseProc & less process not closing diff --git a/src/Resources/TortoiseProcENG.rc b/src/Resources/TortoiseProcENG.rc index 0f8af79b8..77d580fc5 100644 --- a/src/Resources/TortoiseProcENG.rc +++ b/src/Resources/TortoiseProcENG.rc @@ -1587,16 +1587,18 @@ BEGIN PUSHBUTTON "Help",IDHELP,255,44,50,14,WS_DISABLED END -IDD_STASH DIALOGEX 0, 0, 267, 66 +IDD_STASH DIALOGEX 0, 0, 267, 97 STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME CAPTION "Stash" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN GROUPBOX "Stash &Message",IDC_GROUP_STASHMESSAGE,7,7,253,32 EDITTEXT IDC_STASHMESSAGE,15,19,237,13,ES_AUTOHSCROLL - DEFPUSHBUTTON "OK",IDOK,99,45,50,14 - PUSHBUTTON "Cancel",IDCANCEL,154,45,50,14 - PUSHBUTTON "Help",IDHELP,210,45,50,14 + GROUPBOX "Options",IDC_GROUP_OPTION,7,42,253,29 + CONTROL "include &untracked",IDC_CHECK_UNTRACKED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,54,72,10 + DEFPUSHBUTTON "OK",IDOK,99,76,50,14 + PUSHBUTTON "Cancel",IDCANCEL,154,76,50,14 + PUSHBUTTON "Help",IDHELP,210,76,50,14 END ///////////////////////////////////////////////////////////////////////////// @@ -2347,7 +2349,7 @@ BEGIN LEFTMARGIN, 7 RIGHTMARGIN, 260 TOPMARGIN, 7 - BOTTOMMARGIN, 59 + BOTTOMMARGIN, 90 END END #endif // APSTUDIO_INVOKED diff --git a/src/TortoiseProc/AppUtils.cpp b/src/TortoiseProc/AppUtils.cpp index fbad4ca03..7e30b4369 100644 --- a/src/TortoiseProc/AppUtils.cpp +++ b/src/TortoiseProc/AppUtils.cpp @@ -76,6 +76,9 @@ bool CAppUtils::StashSave() CString cmd, out; cmd = _T("git.exe stash save"); + if (dlg.m_bIncludeUntracked && CAppUtils::GetMsysgitVersion() >= 0x01070700) + cmd += _T(" --include-untracked"); + if (!dlg.m_sMessage.IsEmpty()) { CString message = dlg.m_sMessage; diff --git a/src/TortoiseProc/StashSave.cpp b/src/TortoiseProc/StashSave.cpp index cce74f13d..45590cd5f 100644 --- a/src/TortoiseProc/StashSave.cpp +++ b/src/TortoiseProc/StashSave.cpp @@ -26,6 +26,7 @@ IMPLEMENT_DYNAMIC(CStashSaveDlg, CHorizontalResizableStandAloneDialog) CStashSaveDlg::CStashSaveDlg(CWnd* pParent /*=NULL*/) : CHorizontalResizableStandAloneDialog(CStashSaveDlg::IDD, pParent) + , m_bIncludeUntracked(FALSE) { } @@ -37,9 +38,9 @@ void CStashSaveDlg::DoDataExchange(CDataExchange* pDX) { CHorizontalResizableStandAloneDialog::DoDataExchange(pDX); DDX_Text(pDX, IDC_STASHMESSAGE, m_sMessage); + DDX_Check(pDX, IDC_CHECK_UNTRACKED, m_bIncludeUntracked); } - BEGIN_MESSAGE_MAP(CStashSaveDlg, CHorizontalResizableStandAloneDialog) ON_BN_CLICKED(IDOK, &CStashSaveDlg::OnBnClickedOk) ON_BN_CLICKED(IDHELP, &CStashSaveDlg::OnBnClickedHelp) @@ -55,12 +56,17 @@ BOOL CStashSaveDlg::OnInitDialog() AddAnchor(IDHELP, BOTTOM_RIGHT); AddAnchor(IDC_GROUP_STASHMESSAGE, TOP_LEFT, TOP_RIGHT); AddAnchor(IDC_STASHMESSAGE, TOP_LEFT, TOP_RIGHT); + AddAnchor(IDC_GROUP_OPTION, TOP_LEFT, TOP_RIGHT); CString sWindowTitle; GetWindowText(sWindowTitle); CAppUtils::SetWindowTitle(m_hWnd, g_Git.m_CurrentDir, sWindowTitle); this->UpdateData(false); + + if (CAppUtils::GetMsysgitVersion() < 0x01070700) + GetDlgItem(IDC_CHECK_UNTRACKED)->EnableWindow(FALSE); + return TRUE; } diff --git a/src/TortoiseProc/StashSave.h b/src/TortoiseProc/StashSave.h index 2ed4cdf72..47ec0d4c3 100644 --- a/src/TortoiseProc/StashSave.h +++ b/src/TortoiseProc/StashSave.h @@ -46,4 +46,5 @@ protected: public: CString m_sMessage; + BOOL m_bIncludeUntracked; }; diff --git a/src/TortoiseProc/resource.h b/src/TortoiseProc/resource.h index e0a2a6521..cec0cc18b 100644 --- a/src/TortoiseProc/resource.h +++ b/src/TortoiseProc/resource.h @@ -301,6 +301,7 @@ #define IDC_SORTBYCOMMITCOUNT 1126 #define IDC_DIFFBYDOUBLECLICK 1127 #define IDC_CHECK_STOPONCOPY 1130 +#define IDC_CHECK_UNTRACKED 1130 #define IDC_GRAPH 1131 #define IDC_STATBUTTON 1132 #define IDC_PATCH_TO_CLIPBOARD 1132 -- 2.11.4.GIT