From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#12537: support for git commit --amend/--signoff Date: Sat, 29 Sep 2012 04:11:44 +0400 Message-ID: <50663CC0.6000803@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1348877576 19644 80.91.229.3 (29 Sep 2012 00:12:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 29 Sep 2012 00:12:56 +0000 (UTC) To: 12537@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Sep 29 02:13:01 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1THkg0-0005jt-8a for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Sep 2012 02:13:00 +0200 Original-Received: from localhost ([::1]:51176 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THkfu-0005zu-Qr for geb-bug-gnu-emacs@m.gmane.org; Fri, 28 Sep 2012 20:12:54 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51814) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THkfr-0005zn-PA for bug-gnu-emacs@gnu.org; Fri, 28 Sep 2012 20:12:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1THkfq-00070n-DH for bug-gnu-emacs@gnu.org; Fri, 28 Sep 2012 20:12:51 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51520) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THkfq-00070j-9x for bug-gnu-emacs@gnu.org; Fri, 28 Sep 2012 20:12:50 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1THkg2-0007D7-8a for bug-gnu-emacs@gnu.org; Fri, 28 Sep 2012 20:13:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 Sep 2012 00:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 12537 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.134887753227659 (code B ref -1); Sat, 29 Sep 2012 00:13:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 Sep 2012 00:12:12 +0000 Original-Received: from localhost ([127.0.0.1]:32833 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1THkfD-0007C4-7v for submit@debbugs.gnu.org; Fri, 28 Sep 2012 20:12:11 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51296) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1THkf9-0007Bu-R1 for submit@debbugs.gnu.org; Fri, 28 Sep 2012 20:12:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1THkew-0006mQ-CB for submit@debbugs.gnu.org; Fri, 28 Sep 2012 20:11:55 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:60749) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THkew-0006mM-4N for submit@debbugs.gnu.org; Fri, 28 Sep 2012 20:11:54 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51688) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THkeu-0005xh-VB for bug-gnu-emacs@gnu.org; Fri, 28 Sep 2012 20:11:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1THket-0006lC-As for bug-gnu-emacs@gnu.org; Fri, 28 Sep 2012 20:11:52 -0400 Original-Received: from forward12.mail.yandex.net ([95.108.130.94]:59106) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THkes-0006l8-R5 for bug-gnu-emacs@gnu.org; Fri, 28 Sep 2012 20:11:51 -0400 Original-Received: from smtp13.mail.yandex.net (smtp13.mail.yandex.net [95.108.130.68]) by forward12.mail.yandex.net (Yandex) with ESMTP id BE721C22A28 for ; Sat, 29 Sep 2012 04:11:38 +0400 (MSK) Original-Received: from smtp13.mail.yandex.net (localhost [127.0.0.1]) by smtp13.mail.yandex.net (Yandex) with ESMTP id AB0A7E405AD for ; Sat, 29 Sep 2012 04:11:38 +0400 (MSK) Original-Received: from 5x166x253x130.dynamic.spb.ertelecom.ru (5x166x253x130.dynamic.spb.ertelecom.ru [5.166.253.130]) by smtp13.mail.yandex.net (nwsmtp/Yandex) with ESMTP id BbmCcVEF-Bcmmsv6b; Sat, 29 Sep 2012 04:11:38 +0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1348877498; bh=2pd9rbcEOa+zuwrf29qoZc/8QI6T4mg4P6PF3iaaopI=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: Content-Type:Content-Transfer-Encoding; b=LCwHxcYlPOS1WLVgotMKXenLbz9AyKkyj79pwXJAtaxIod5Lz+z7WppKEzZ96ZPjb syFbXMl+b9A5KH6H6Jfv8/ad22w3AAmG/2MPH2BW3RcoQMjKaeIpk92fXyaRCOCPYW fGi2H4lmEgZBo4QtWb55Vamo/M0iw/1mJ3tYVVu8= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:64995 Archived-At: Tags: patch This is based on Dan Nicolaescu's patch from here: http://lists.gnu.org/archive/html/emacs-devel/2010-06/msg00784.html I modified it according to Stefan's request, and made some other tweaks. Notes: 1) Magit handles the Amend action in a similar way: it also inserts a header at the top of the message edit buffer. I haven't seen any complaints from users. 2) I haven't been able to make menu-bar keymap work as intended. I copied log-edit-menu to the local menu-map variable, and it shows, but if I don't set the parent keymap of vc-git-log-edit-mode-map to log-edit-mode-map, the menu popup doesn't show the latter's keybindings (and they likely don't work, haven't tried). If I do set it as parent, then the "*VC-log*" mode line element menu only contains two elements, but submenus, one for each keymap. I don't think that's optimal, so I discarded the menu-map part altogether. 3) Toggling Amend on/off repeatedly may lead to slightly different behavior if the commit message subject looks like a "header: value" string, and especially if that's the only line in the message. The difference would be in the added newlines, and the commit subject will become highlighted as a header line. To counteract this, Magit inserts a "-- magit header ends here --" line after the headers. Not sure if we should do the same. 4) The new first argument format of log-edit-extract-headers is kinda awkward, but it's the only way I could think of to make it backwards-compatible, and I do think that this is the function that should handle the yes/no headers logic. The third element in the new form ("yes") is more or less superfluous (we could just hardcode it everywhere as the only possible value for "true"), but without it, the new form would look even more awkward. Suggestions welcome. --Dmitry