{"thread":{"id":"12780","subject":"[Qgit PATCH] Add ability to commit --amend","startedAt":"2008-03-20T19:39:57Z","lastAt":"2008-03-21T02:11:50Z","messageCount":2,"participants":["Jan Hudec","Marco Costalba"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"72537","messageId":"20080320193957.GA12119@efreet.light.src","threadId":"12780","inReplyTo":null,"subject":"[Qgit PATCH] Add ability to commit --amend","fromName":"Jan Hudec","fromEmail":"bulb@ucw.cz","sentAt":"2008-03-20T19:39:57Z","receivedAt":"2008-03-20T19:39:57Z","isPatch":true,"sender":{"key":"bulb@ucw.cz","avatar":null},"body":"Introduces separate menu entry to commit --amend. The dialog is the same, but\ncalls commit --amend rather than just commit in the end. The stg refresh is\nmoved here. The menu entry is always available, because user might just want\nto change the commit message.\n\nSigned-off-by: Jan Hudec <bulb@ucw.cz>\n---\n\nLast summer I tried to add ability to commit --amend to qgit -- and failed\nbecause git commit didn't support --amend and -F together and rewrite using\nlower level plumbing started to get really ugly. Now that there is git 1.5.4\nwith builtin commit, which does not have this quirk, I resurrected the patch\nand here it is.\n\nIt seems to work for me. I didn't try any particularly nasty cases, but on\nthe other hand I didn't change the commit logic itself, so it should not have\neffect on this. Please review and apply if it looks OK.\n\n---\n\nI have to say I don't like one thing on it---the way if(isStGITStack())\nappears all over the place. Besides there is actually a bug in the\ndetection of the stgit stack. A tree is considered to have stgit if any\nbranch has stgit stack, even if that branch is currently checked out.\n\nSo what I'd like to look into now is introducing two classes, one for plain\ngit core branches and one for stgit repositories. They will create the\nactions that depend on repository type (so they would no longer be designed,\nbut QActions are quite simple, so I don't think it's critical). They will\nshare code as appropriate via inheritance or delegation to current Git class.\nThis should make the code a little more modular and make it possible if some\nday someone decides to add support for guilt or other git extension.\n\nRegards,\n\nJan\n\nPS: Is this the right way to submit QGit patches, or should I be using some\nother channel (like sf.net patch tracker or something)?\n\n--->8---\n\n README             |    8 +++-\n src/commit.ui      |   16 -------\n src/commitimpl.cpp |  118 ++++++++++++++++++++++++++++++++++++++--------------\n src/commitimpl.h   |    9 +++-\n src/git.cpp        |   44 ++++++++++++++-----\n src/git.h          |    6 ++-\n src/mainimpl.cpp   |   23 +++++-----\n src/mainimpl.h     |    1 +\n src/mainview.ui    |   37 ++++++++++++++---\n 9 files changed, 177 insertions(+), 85 deletions(-)\n\ndiff --git a/README b/README\nindex aa3c799..1fb221b 100644\n--- a/README\n+++ b/README\n@@ -227,6 +227,10 @@ In commit dialog select the files to commit or, simply, to sync with index\n (call 'git update-index' on them). A proper commit message may be entered and,\n after confirmation, changes are committed and a new revision is created.\n +\n+It is also possible to amend last commit. The Edit->Amend commit opens the\n+same dialog, but changes are added to the head commit instead of creating new\n+commit.\n++\n The core commit function is performed by 'git commit'.\n +\n TIP: It is possible to use a template for commit message, use\n@@ -381,8 +385,8 @@ Integration with StGIT is implemented both by new and modified functions.\n \n .Existing functions change behavior:\n \n- - Commit dialog refreshes top stack patch with modified files instead\n-   of sync the cache.\n+ - Amend commit dialog refreshes top stack patch with modified files instead\n+   of amending the commit. It is appropriately renamed in the menu.\n  - Commit dialog creates a new patch on the top of the stack filled with\n    modified working directory content instead of commit a new revision to\n    git repository.\ndiff --git a/src/commit.ui b/src/commit.ui\nindex 253ac07..3b85187 100644\n--- a/src/commit.ui\n+++ b/src/commit.ui\n@@ -286,22 +286,6 @@\n  </resources>\n  <connections>\n   <connection>\n-   <sender>pushButtonOk</sender>\n-   <signal>clicked()</signal>\n-   <receiver>CommitBase</receiver>\n-   <slot>pushButtonOk_clicked()</slot>\n-   <hints>\n-    <hint type=\"sourcelabel\" >\n-     <x>20</x>\n-     <y>20</y>\n-    </hint>\n-    <hint type=\"destinationlabel\" >\n-     <x>20</x>\n-     <y>20</y>\n-    </hint>\n-   </hints>\n-  </connection>\n-  <connection>\n    <sender>pushButtonCancel</sender>\n    <signal>clicked()</signal>\n    <receiver>CommitBase</receiver>\ndiff --git a/src/commitimpl.cpp b/src/commitimpl.cpp\nindex f628c70..a6612b8 100644\n--- a/src/commitimpl.cpp\n+++ b/src/commitimpl.cpp\n@@ -22,7 +22,7 @@\n \n using namespace QGit;\n \n-CommitImpl::CommitImpl(Git* g) : git(g) {\n+CommitImpl::CommitImpl(Git* g, bool amend) : git(g) {\n \n \t// adjust GUI\n \tsetAttribute(Qt::WA_DeleteOnClose);\n@@ -77,8 +77,8 @@ CommitImpl::CommitImpl(Git* g) : git(g) {\n \ttextEditMsg_cursorPositionChanged();\n \n \t// setup textEditMsg with default value\n-\tQString status(git->getDefCommitMsg());\n-\tstatus.prepend('\\n').replace(QRegExp(\"\\\\n([^#])\"), \"\\n#\\\\1\"); // comment all the lines\n+\tQString status;\n+\tstatus = amend ? git->getLastCommitMsg() : git->getNewCommitMsg();\n \tmsg.append(status.trimmed());\n \ttextEditMsg->setPlainText(msg);\n \n@@ -87,13 +87,26 @@ CommitImpl::CommitImpl(Git* g) : git(g) {\n \torigMsg = msg;\n \n \t// setup button functions\n-\tif (git->isStGITStack()) {\n-\t\tpushButtonOk->setText(\"&New patch\");\n-\t\tpushButtonOk->setShortcut(QKeySequence(\"Alt+N\"));\n-\t\tpushButtonOk->setToolTip(\"Create a new patch\");\n-\t\tpushButtonUpdateCache->setText(\"&Add to top\");\n-\t\tpushButtonOk->setShortcut(QKeySequence(\"Alt+A\"));\n-\t\tpushButtonUpdateCache->setToolTip(\"Refresh top stack patch\");\n+\tif (amend) {\n+\t\tif (git->isStGITStack()) {\n+\t\t\tpushButtonOk->setText(\"&Add to top\");\n+\t\t\tpushButtonOk->setShortcut(QKeySequence(\"Alt+A\"));\n+\t\t\tpushButtonOk->setToolTip(\"Refresh top stack patch\");\n+\t\t} else {\n+\t\t\tpushButtonOk->setText(\"&Amend\");\n+\t\t\tpushButtonOk->setShortcut(QKeySequence(\"Alt+A\"));\n+\t\t\tpushButtonOk->setToolTip(\"Amend latest commit\");\n+\t\t}\n+\t\tconnect(pushButtonOk, SIGNAL(clicked()),\n+\t\t\tthis, SLOT(pushButtonAmend_clicked()));\n+\t} else {\n+\t\tif (git->isStGITStack()) {\n+\t\t\tpushButtonOk->setText(\"&New patch\");\n+\t\t\tpushButtonOk->setShortcut(QKeySequence(\"Alt+N\"));\n+\t\t\tpushButtonOk->setToolTip(\"Create a new patch\");\n+\t\t}\n+\t\tconnect(pushButtonOk, SIGNAL(clicked()),\n+\t\t\tthis, SLOT(pushButtonCommit_clicked()));\n \t}\n \tconnect(treeWidgetFiles, SIGNAL(customContextMenuRequested(const QPoint&)),\n \t        this, SLOT(contextMenuPopup(const QPoint&)));\n@@ -129,7 +142,7 @@ void CommitImpl::checkUncheck(bool checkAll) {\n \t}\n }\n \n-bool CommitImpl::checkFiles(SList selFiles) {\n+bool CommitImpl::getFiles(SList selFiles) {\n \n \t// check for files to commit\n \tselFiles.clear();\n@@ -139,13 +152,26 @@ bool CommitImpl::checkFiles(SList selFiles) {\n \t\t\tselFiles.append((*it)->text(0));\n \t\t++it;\n \t}\n-\tif (selFiles.isEmpty())\n-\t\tQMessageBox::warning(this, \"Commit changes - QGit\",\n-\t\t                     \"Sorry, no files are selected for updating.\",\n-\t\t                     QMessageBox::Ok, QMessageBox::NoButton);\n+\n \treturn !selFiles.isEmpty();\n }\n \n+void CommitImpl::warnNoFiles() {\n+\n+\tQMessageBox::warning(this, \"Commit changes - QGit\",\n+\t\t\t     \"Sorry, no files are selected for updating.\",\n+\t\t\t     QMessageBox::Ok, QMessageBox::NoButton);\n+}\n+\n+bool CommitImpl::checkFiles(SList selFiles) {\n+\n+\tif (getFiles(selFiles))\n+\t\treturn true;\n+\n+\twarnNoFiles();\n+\treturn false;\n+}\n+\n bool CommitImpl::checkMsg(QString& msg) {\n \n \tmsg = textEditMsg->toPlainText();\n@@ -189,12 +215,16 @@ bool CommitImpl::checkPatchName(QString& patchName) {\n \treturn false;\n }\n \n-bool CommitImpl::checkConfirm(SCRef msg, SCRef patchName, SCList selFiles) {\n+bool CommitImpl::checkConfirm(SCRef msg, SCRef patchName, SCList selFiles, bool amend) {\n \n \tQTextCodec* tc = QTextCodec::codecForCStrings();\n \tQTextCodec::setCodecForCStrings(0); // set temporary Latin-1\n \n-\tQString whatToDo = (git->isStGITStack() ? \"create a new patch with\" : \"commit\");\n+\t// NOTEME: i18n-ugly\n+\tQString whatToDo = amend ? \n+\t    (git->isStGITStack() ? \"refresh top patch with\" :\n+\t     \t\t\t   \"amend last commit with\") :\n+\t    (git->isStGITStack() ? \"create a new patch with\" : \"commit\");\n \tQString text(\"Do you want to \" + whatToDo + \" the following file(s)?\\n\\n\" +\n \t             selFiles.join(\"\\n\") + \"\\n\\nwith the message:\\n\\n\");\n \ttext.append(msg);\n@@ -219,7 +249,7 @@ void CommitImpl::pushButtonCancel_clicked() {\n \tclose();\n }\n \n-void CommitImpl::pushButtonOk_clicked() {\n+void CommitImpl::pushButtonCommit_clicked() {\n \n \tQStringList selFiles; // retrieve selected files\n \tif (!checkFiles(selFiles))\n@@ -233,7 +263,8 @@ void CommitImpl::pushButtonOk_clicked() {\n \tif (git->isStGITStack() && !checkPatchName(patchName))\n \t\treturn;\n \n-\tif (!checkConfirm(msg, patchName, selFiles)) // ask for confirmation\n+\t// ask for confirmation\n+\tif (!checkConfirm(msg, patchName, selFiles, !Git::optAmend))\n \t\treturn;\n \n \t// ok, let's go\n@@ -243,7 +274,7 @@ void CommitImpl::pushButtonOk_clicked() {\n \tif (git->isStGITStack())\n \t\tok = git->stgCommit(selFiles, msg, patchName, !Git::optFold);\n \telse\n-\t\tok = git->commitFiles(selFiles, msg);\n+\t\tok = git->commitFiles(selFiles, msg, !Git::optAmend);\n \n \tQApplication::restoreOverrideCursor();\n \thide();\n@@ -251,29 +282,52 @@ void CommitImpl::pushButtonOk_clicked() {\n \tclose();\n }\n \n-void CommitImpl::pushButtonUpdateCache_clicked() {\n+void CommitImpl::pushButtonAmend_clicked() {\n \n-\tQStringList selFiles;\n-\tif (!checkFiles(selFiles))\n+\tQStringList selFiles; // retrieve selected files\n+\tgetFiles(selFiles);\n+\t// FIXME: If there are no files AND no changes to message, we should not\n+\t// commit. Disabling the commit button in such case might be preferable.\n+\n+\tQString msg(textEditMsg->toPlainText());\n+\tif (msg == origMsg && selFiles.isEmpty()) {\n+\t\twarnNoFiles();\n \t\treturn;\n+\t}\n \n-\tif (git->isStGITStack())\n-\t\tif (QMessageBox::question(this, \"Refresh stack - QGit\",\n-\t\t\t\"Do you want to refresh current top stack patch?\",\n-\t\t\t\"&Yes\", \"&No\", QString(), 0, 1) == 1)\n-\t\t\treturn;\n+\tif (msg == origMsg && git->isStGITStack())\n+\t\tmsg = \"\";\n+\telse if (!checkMsg(msg))\n+\t\t// We are going to replace the message, so it better isn't empty\n+\t\treturn;\n \n-\tQString msg(textEditMsg->toPlainText());\n-\tif (msg == origMsg)\n-\t\tmsg = \"\"; // to tell stgCommit() not to refresh patch name\n+\t// ask for confirmation\n+\t// FIXME: We don't need patch name for refresh, do we?\n+\tif (!checkConfirm(msg, \"\", selFiles, Git::optAmend))\n+\t\treturn;\n \n+\t// ok, let's go\n \tQApplication::setOverrideCursor(QCursor(Qt::WaitCursor));\n \tEM_PROCESS_EVENTS; // to close message box\n \tbool ok;\n \tif (git->isStGITStack())\n \t\tok = git->stgCommit(selFiles, msg, \"\", Git::optFold);\n \telse\n-\t\tok = git->updateIndex(selFiles);\n+\t\tok = git->commitFiles(selFiles, msg, Git::optAmend);\n+\n+\tQApplication::restoreOverrideCursor();\n+\thide();\n+\temit changesCommitted(ok);\n+\tclose();\n+}\n+\n+void CommitImpl::pushButtonUpdateCache_clicked() {\n+\n+\tQStringList selFiles;\n+\tif (!checkFiles(selFiles))\n+\t\treturn;\n+\n+\tbool ok = git->updateIndex(selFiles);\n \n \tQApplication::restoreOverrideCursor();\n \temit changesCommitted(ok);\ndiff --git a/src/commitimpl.h b/src/commitimpl.h\nindex 19cb156..d9e9649 100644\n--- a/src/commitimpl.h\n+++ b/src/commitimpl.h\n@@ -15,14 +15,15 @@ class Git;\n class CommitImpl : public QWidget, public Ui_CommitBase {\n Q_OBJECT\n public:\n-\texplicit CommitImpl(Git* git);\n+\texplicit CommitImpl(Git* g, bool amend);\n \n signals:\n \tvoid changesCommitted(bool);\n \n public slots:\n \tvirtual void closeEvent(QCloseEvent*);\n-\tvoid pushButtonOk_clicked();\n+\tvoid pushButtonCommit_clicked();\n+\tvoid pushButtonAmend_clicked();\n \tvoid pushButtonCancel_clicked();\n \tvoid pushButtonUpdateCache_clicked();\n \tvoid pushButtonSettings_clicked();\n@@ -35,10 +36,12 @@ private slots:\n \n private:\n \tvoid checkUncheck(bool checkAll);\n+\tbool getFiles(SList selFiles);\n+\tvoid warnNoFiles();\n \tbool checkFiles(SList selFiles);\n \tbool checkMsg(QString& msg);\n \tbool checkPatchName(QString& patchName);\n-\tbool checkConfirm(SCRef msg, SCRef patchName, SCList selFiles);\n+\tbool checkConfirm(SCRef msg, SCRef patchName, SCList selFiles, bool amend);\n \tvoid computePosition(int &col_pos, int &line_pos);\n \n \tGit* git;\ndiff --git a/src/git.cpp b/src/git.cpp\nindex f6df035..7fc4164 100755\n--- a/src/git.cpp\n+++ b/src/git.cpp\n@@ -1135,23 +1135,40 @@ const QStringList Git::getNearTags(bool goDown, SCRef sha) {\n \treturn tl;\n }\n \n-const QString Git::getDefCommitMsg() {\n-\n-\tQString sha(ZERO_SHA);\n-\tif (isStGIT && !getAllRefSha(APPLIED).isEmpty()) {\n-\t\tQString top;\n-\t\tif (run(\"stg top\", &top))\n-\t\t\tsha = getRefSha(top.trimmed(), APPLIED, false);\n+const QString Git::getLastCommitMsg() {\n+\n+\t// FIXME: Make sure the amend action is not called when there is\n+\t// nothing to amend. That is in empty repository or over stgit stack\n+\t// with nothing applied.\n+\tQString sha;\n+\tQString top;\n+\tif (run(\"git rev-parse --verify HEAD\", &top))\n+\t    sha = top.trimmed();\n+\telse {\n+\t\tdbs(\"ASSERT: getLastCommitMsg head is not valid\");\n+\t\treturn \"\";\n \t}\n+\t\n \tconst Rev* c = revLookup(sha);\n \tif (!c) {\n-\t\tdbp(\"ASSERT: getDefCommitMsg sha <%1> not found\", sha);\n+\t\tdbp(\"ASSERT: getLastCommitMsg sha <%1> not found\", sha);\n \t\treturn \"\";\n \t}\n-\tif (sha == ZERO_SHA)\n-\t\treturn c->longLog();\n \n-\treturn c->shortLog() + '\\n' + c->longLog().trimmed();\n+\treturn c->shortLog() + '\\n' + c->longLog().trimmed() + getNewCommitMsg();\n+}\n+\n+const QString Git::getNewCommitMsg() {\n+\n+\tconst Rev* c = revLookup(ZERO_SHA);\n+\tif (!c) {\n+\t\tdbs(\"ASSERT: getNewCommitMsg zero_sha not found\");\n+\t\treturn \"\";\n+\t}\n+\n+\tQString status = c->longLog();\n+\tstatus.prepend('\\n').replace(QRegExp(\"\\\\n([^#])\"), \"\\n#\\\\1\"); // comment all the lines\n+\treturn status;\n }\n \n const QString Git::colorMatch(SCRef txt, QRegExp& regExp) {\n@@ -1545,7 +1562,7 @@ bool Git::updateIndex(SCList selFiles) {\n \treturn true;\n }\n \n-bool Git::commitFiles(SCList selFiles, SCRef msg) {\n+bool Git::commitFiles(SCList selFiles, SCRef msg, bool amend) {\n \n \tconst QString msgFile(gitDir + \"/qgit_cmt_msg.txt\");\n \tif (!writeToFile(msgFile, msg)) // early skip\n@@ -1565,6 +1582,9 @@ bool Git::commitFiles(SCList selFiles, SCRef msg) {\n \tif (testFlag(VERIFY_CMT_F))\n \t\tcmtOptions.append(\" -v\");\n \n+\tif (amend)\n+\t\tcmtOptions.append(\" --amend\");\n+\n \tbool ret = false;\n \n \t// get not selected files but updated in index to restore at the end\ndiff --git a/src/git.h b/src/git.h\nindex e795cee..d1c8b72 100644\n--- a/src/git.h\n+++ b/src/git.h\n@@ -105,6 +105,7 @@ public:\n \tstatic const bool optOnlyLoaded  = true;\n \tstatic const bool optDragDrop    = true;\n \tstatic const bool optFold        = true;\n+\tstatic const bool optAmend       = true;\n \tstatic const bool optOnlyInIndex = true;\n \tstatic const bool optCreate      = true;\n \n@@ -165,7 +166,8 @@ public:\n \tbool getTree(SCRef ts, TreeInfo& ti, bool wd, SCRef treePath);\n \tstatic const QString getLocalDate(SCRef gitDate);\n \tconst QString getDesc(SCRef sha, QRegExp& slogRE, QRegExp& lLogRE, bool showH, FileHistory* fh);\n-\tconst QString getDefCommitMsg();\n+\tconst QString getLastCommitMsg();\n+\tconst QString getNewCommitMsg();\n \tconst QString getLaneParent(SCRef fromSHA, int laneNum);\n \tconst QStringList getChilds(SCRef parent);\n \tconst QStringList getNearTags(bool goDown, SCRef sha);\n@@ -185,7 +187,7 @@ public:\n \tQTextCodec* getTextCodec(bool* isGitArchive);\n \tbool formatPatch(SCList shaList, SCRef dirPath, SCRef remoteDir = \"\");\n \tbool updateIndex(SCList selFiles);\n-\tbool commitFiles(SCList files, SCRef msg);\n+\tbool commitFiles(SCList files, SCRef msg, bool amend);\n \tbool makeTag(SCRef sha, SCRef tag, SCRef msg);\n \tbool deleteTag(SCRef sha);\n \tbool applyPatchFile(SCRef patchPath, bool fold, bool sign);\ndiff --git a/src/mainimpl.cpp b/src/mainimpl.cpp\nindex 1edb9e6..b3439d2 100644\n--- a/src/mainimpl.cpp\n+++ b/src/mainimpl.cpp\n@@ -1024,17 +1024,8 @@ void MainImpl::fileNamesLoad(int status, int value) {\n \n void MainImpl::updateCommitMenu(bool isStGITStack) {\n \n-\tQAction* act = NULL;\n-\tQList<QAction*> al(Edit->actions());\n-\tFOREACH (QList<QAction*>, it, al) {\n-\t\tSCRef txt = (*it)->text();\n-\t\tif (txt == \"&Commit...\" || txt == \"Commit St&GIT patch...\") {\n-\t\t\tact = *it;\n-\t\t\tbreak;\n-\t\t}\n-\t}\n-\tif (act)\n-\t\tact->setText(isStGITStack ? \"Commit St&GIT patch...\" : \"&Commit...\");\n+\tActCommit->setText(isStGITStack ? \"Commit St&GIT patch...\" : \"&Commit...\");\n+\tActAmend->setText(isStGITStack ? \"Refresh St&GIT patch...\" : \"&Amend commit...\");\n }\n \n void MainImpl::updateRecentRepoMenu(SCRef newEntry) {\n@@ -1506,7 +1497,15 @@ void MainImpl::customAction_exited(const QString& name) {\n \n void MainImpl::ActCommit_activated() {\n \n-\tCommitImpl* c = new CommitImpl(git); // has Qt::WA_DeleteOnClose attribute\n+\tCommitImpl* c = new CommitImpl(git, false); // has Qt::WA_DeleteOnClose attribute\n+\tconnect(this, SIGNAL(closeAllWindows()), c, SLOT(close()));\n+\tconnect(c, SIGNAL(changesCommitted(bool)), this, SLOT(changesCommitted(bool)));\n+\tc->show();\n+}\n+\n+void MainImpl::ActAmend_activated() {\n+\n+\tCommitImpl* c = new CommitImpl(git, true); // has Qt::WA_DeleteOnClose attribute\n \tconnect(this, SIGNAL(closeAllWindows()), c, SLOT(close()));\n \tconnect(c, SIGNAL(changesCommitted(bool)), this, SLOT(changesCommitted(bool)));\n \tc->show();\ndiff --git a/src/mainimpl.h b/src/mainimpl.h\nindex fd682ec..dd28f23 100644\n--- a/src/mainimpl.h\n+++ b/src/mainimpl.h\n@@ -101,6 +101,7 @@ protected slots:\n \tvoid ActMailApplyPatch_activated();\n \tvoid ActSettings_activated();\n \tvoid ActCommit_activated();\n+\tvoid ActAmend_activated();\n \tvoid ActTag_activated();\n \tvoid ActTagDelete_activated();\n \tvoid ActPush_activated();\ndiff --git a/src/mainview.ui b/src/mainview.ui\nindex ffa8fe1..93f1d0b 100644\n--- a/src/mainview.ui\n+++ b/src/mainview.ui\n@@ -133,17 +133,12 @@\n     <addaction name=\"ActExit\" />\n     <addaction name=\"separator\" />\n    </widget>\n-   <widget class=\"QMenu\" name=\"Actions\" >\n-    <property name=\"title\" >\n-     <string>&amp;Actions</string>\n-    </property>\n-    <addaction name=\"ActCustomActionSetup\" />\n-   </widget>\n    <widget class=\"QMenu\" name=\"Edit\" >\n     <property name=\"title\" >\n      <string>&amp;Edit</string>\n     </property>\n     <addaction name=\"ActCommit\" />\n+    <addaction name=\"ActAmend\" />\n     <addaction name=\"ActTag\" />\n     <addaction name=\"ActTagDelete\" />\n     <addaction name=\"ActPush\" />\n@@ -154,6 +149,12 @@\n     <addaction name=\"separator\" />\n     <addaction name=\"ActSettings\" />\n    </widget>\n+   <widget class=\"QMenu\" name=\"Actions\" >\n+    <property name=\"title\" >\n+     <string>&amp;Actions</string>\n+    </property>\n+    <addaction name=\"ActCustomActionSetup\" />\n+   </widget>\n    <widget class=\"QMenu\" name=\"View\" >\n     <property name=\"title\" >\n      <string>&amp;View</string>\n@@ -721,6 +722,14 @@\n     <string>Show 'Select range' dialog</string>\n    </property>\n   </action>\n+  <action name=\"ActAmend\" >\n+   <property name=\"text\" >\n+    <string>Amend comit...</string>\n+   </property>\n+   <property name=\"toolTip\" >\n+    <string>Amend previous comit</string>\n+   </property>\n+  </action>\n  </widget>\n  <layoutdefault spacing=\"6\" margin=\"11\" />\n  <customwidgets>\n@@ -1326,5 +1335,21 @@\n     </hint>\n    </hints>\n   </connection>\n+  <connection>\n+   <sender>ActAmend</sender>\n+   <signal>triggered()</signal>\n+   <receiver>MainBase</receiver>\n+   <slot>ActAmend_activated()</slot>\n+   <hints>\n+    <hint type=\"sourcelabel\" >\n+     <x>-1</x>\n+     <y>-1</y>\n+    </hint>\n+    <hint type=\"destinationlabel\" >\n+     <x>452</x>\n+     <y>238</y>\n+    </hint>\n+   </hints>\n+  </connection>\n  </connections>\n </ui>\n-- \n1.5.4.4\n"},{"id":"72550","messageId":"e5bfff550803201911xf2250d2w2064a23a84b2480f@mail.gmail.com","threadId":"12780","inReplyTo":"20080320193957.GA12119@efreet.light.src","subject":"Re: [Qgit PATCH] Add ability to commit --amend","fromName":"Marco Costalba","fromEmail":"mcostalba@gmail.com","sentAt":"2008-03-21T02:11:50Z","receivedAt":"2008-03-21T02:11:50Z","isPatch":true,"sender":{"key":"mcostalba@gmail.com","avatar":null},"body":"On Thu, Mar 20, 2008 at 8:39 PM, Jan Hudec <bulb@ucw.cz> wrote:\n>\n>  It seems to work for me. I didn't try any particularly nasty cases, but on\n>  the other hand I didn't change the commit logic itself, so it should not have\n>  effect on this. Please review and apply if it looks OK.\n>\n\nPatch reviewed (It seems very good) applied and pushed.\n\n>\n>  So what I'd like to look into now is introducing two classes, one for plain\n>  git core branches and one for stgit repositories. They will create the\n>  actions that depend on repository type (so they would no longer be designed,\n>  but QActions are quite simple, so I don't think it's critical). They will\n>  share code as appropriate via inheritance or delegation to current Git class.\n>  This should make the code a little more modular and make it possible if some\n>  day someone decides to add support for guilt or other git extension.\n>\n\nThis does not seem an easy task (especially for the git part), of\ncourse you are more then welcomed ;-)\n\n>\n>  PS: Is this the right way to submit QGit patches, or should I be using some\n>  other channel (like sf.net patch tracker or something)?\n>\n\nYes it is (if people on the list does not complain), I don't expect a\nlot of bandwidth used for qgit patches and we (possible contributors)\ncommonly read git list, not sourceforge one.\n\n\nThanks\nMarco\n"}]}