Commit c35ab9e4 authored by Sven Strickroth's avatar Sven Strickroth

Print a warning on a merge commit in order to prevent problems

(fixes issue #2270)
Signed-off-by: Sven Strickroth's avatarSven Strickroth <email@cs-ware.de>
parent 984788d5
......@@ -9363,6 +9363,10 @@ msgstr ""
msgid "The commit message must not be empty."
msgstr ""
#. Resource IDs: (IDS_COMMIT_MERGE_HINT)
msgid "The commit you are composing is a special commit. It is a merge commit and, thus contains your changes as well as the changes of a merged branch.\n\nYou should NOT uncheck files unless you know what you are doing.\n\nWhile merging conflicts can occur which need to be resolved manually (i.e., integrate your changes into a file which was also modified on another branch).\n\nSee help for more information."
msgstr ""
#. Resource IDs: (IDS_GITCREDENTIAL_OVERWRITEHELPER)
#, c-format
msgid "The credential helper URL \"%s\" already exists.\nDo you want to overwrite it?"
......
......@@ -20,6 +20,7 @@ Released: unreleased
* Fixed issue #2630: TGitBlame: Allow to blame files of different working trees w/o restarting
* Fixed issue #2679: Unnecessary horizontal scrollbar is shown in case logwidthmarker is set
* Rebase dialog now honors rebase.autostash=true
* Fixed issue #2270: Print a warning on a merge commit, so that changes are not unchecked unintentionally
== Bug Fixes ==
* Fixed issue #2647: TortoiseGitBlame does not display files correctly with mixed line endings (such as CRCRLF)
......
......@@ -4730,6 +4730,7 @@ STRINGTABLE
BEGIN
IDS_GLOBAL_GCM "manager - current Windows user"
IDS_SYSTEM_GCM "manager - all Windows users"
IDS_COMMIT_MERGE_HINT "The commit you are composing is a special commit. It is a merge commit and, thus contains your changes as well as the changes of a merged branch.\n\nYou should NOT uncheck files unless you know what you are doing.\n\nWhile merging conflicts can occur which need to be resolved manually (i.e., integrate your changes into a file which was also modified on another branch).\n\nSee help for more information."
IDS_REBASE_PRESERVEMERGES_TT
"This preserves merge commits, however, it has known bugs as re-ordering commits is not working properly (same limitation as for vanilla git rebase), see help."
END
......
......@@ -198,13 +198,6 @@ BOOL CCommitDlg::OnInitDialog()
}
RunStartCommitHook();
if (CTGitPath(g_Git.m_CurrentDir).IsMergeActive())
{
DialogEnableWindow(IDC_CHECK_NEWBRANCH, FALSE);
m_bCreateNewBranch = FALSE;
GetDlgItem(IDC_MERGEACTIVE)->ShowWindow(SW_SHOW);
}
m_regAddBeforeCommit = CRegDWORD(_T("Software\\TortoiseGit\\AddBeforeCommit"), TRUE);
m_bShowUnversioned = m_regAddBeforeCommit;
......@@ -458,6 +451,14 @@ BOOL CCommitDlg::OnInitDialog()
if (g_Git.GetConfigValueBool(_T("tgit.commitshowpatch")))
OnStnClickedViewPatch();
if (CTGitPath(g_Git.m_CurrentDir).IsMergeActive())
{
DialogEnableWindow(IDC_CHECK_NEWBRANCH, FALSE);
m_bCreateNewBranch = FALSE;
GetDlgItem(IDC_MERGEACTIVE)->ShowWindow(SW_SHOW);
CMessageBox::ShowCheck(GetSafeHwnd(), IDS_COMMIT_MERGE_HINT, IDS_APPNAME, MB_ICONINFORMATION, L"CommitMergeHint", IDS_MSGBOX_DONOTSHOWAGAIN);
}
return FALSE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
......
......@@ -359,6 +359,7 @@ void CSetSavedDataPage::OnBnClickedStoreddecisionsclear()
L"HintHierarchicalConfig",
L"TagOptNoTagsWarning",
L"NoStashIncludeUntrackedWarning",
L"CommitMergeHint",
};
for (const auto& value : tgitvalues)
{
......
......@@ -1240,6 +1240,7 @@
#define IDC_BRANCH_CHECK 1586
#define IDC_SMTP_USER 1586
#define IDC_PARAMSLABEL 1586
#define IDS_COMMIT_MERGE_HINT 1586
#define IDC_SUBMODULE_BRANCH 1587
#define IDC_CHECK_SENDMAIL 1587
#define IDS_REBASE_PRESERVEMERGES_TT 1587
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment