From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#12537: Acknowledgement (support for git commit --amend/--signoff) Date: Sun, 30 Sep 2012 23:16:05 -0400 Message-ID: References: <50663CC0.6000803@yandex.ru> <50663D58.4010702@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1349061406 32046 80.91.229.3 (1 Oct 2012 03:16:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 1 Oct 2012 03:16:46 +0000 (UTC) Cc: 12537@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 01 05:16:49 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 1TIWUy-0006VT-1x for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Oct 2012 05:16:48 +0200 Original-Received: from localhost ([::1]:33102 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TIWUs-0004aK-B6 for geb-bug-gnu-emacs@m.gmane.org; Sun, 30 Sep 2012 23:16:42 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:39798) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TIWUp-0004aF-Jp for bug-gnu-emacs@gnu.org; Sun, 30 Sep 2012 23:16:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TIWUo-0001PL-Kg for bug-gnu-emacs@gnu.org; Sun, 30 Sep 2012 23:16:39 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53982) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TIWUo-0001PH-Gt for bug-gnu-emacs@gnu.org; Sun, 30 Sep 2012 23:16:38 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TIWVC-0007qG-8s for bug-gnu-emacs@gnu.org; Sun, 30 Sep 2012 23:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Oct 2012 03:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12537 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 12537-submit@debbugs.gnu.org id=B12537.134906139830107 (code B ref 12537); Mon, 01 Oct 2012 03:17:02 +0000 Original-Received: (at 12537) by debbugs.gnu.org; 1 Oct 2012 03:16:38 +0000 Original-Received: from localhost ([127.0.0.1]:35295 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TIWUn-0007pY-OE for submit@debbugs.gnu.org; Sun, 30 Sep 2012 23:16:38 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:10890) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TIWUm-0007pR-Nc for 12537@debbugs.gnu.org; Sun, 30 Sep 2012 23:16:37 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAG6Zu09FxLT4/2dsb2JhbABEtBGBCIIWAQVWIxALDiYSFBgNJIghugmQRAOjM4FYgwU X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="200341451" Original-Received: from 69-196-180-248.dsl.teksavvy.com (HELO pastel.home) ([69.196.180.248]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 30 Sep 2012 23:16:11 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id C2DF7594CA; Sun, 30 Sep 2012 23:16:05 -0400 (EDT) In-Reply-To: <50663D58.4010702@yandex.ru> (Dmitry Gutov's message of "Sat, 29 Sep 2012 04:14:16 +0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) 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:65041 Archived-At: > - (,(concat "^\\(\\([[:alpha:]]+\\):\\)" log-edit-header-contents-regexp) > + (,(concat "^\\(\\([[:alpha:]][^: \n\t]+\\):\\)" > + log-edit-header-contents-regexp) I'd prefer to only add hyphens, as in [[:alpha:]-]. > +(defun log-edit-toggle-header (name value) > + "Toggle a boolean-type header in the current buffer. > +If the value of NAME is VALUE, remove it. Otherwise, add it if > +it's not present and set it to VALUE. Afterward, if there are headers, > +make sure there is an empty line after them. If there are no headers, > +remove all empty lines at the beginning of the buffer. > +Return t if toggled on, otherwise nil." How 'bout leaving the header, just with an empty content, so you never have to deal with "remove a sole empty line if there's no header left"? > +or (HEADER CMDARG VALUE) associating header names to the corresponding > +cmdlineoption name and the result is then a list of the form > +\(MSG CMDARG1 HDRTEXT1 CMDARG2 HDRTEXT2...\) where MSG is the remaining text > +from STRING. For HEADERS elements of the second type, the header value is > +not added to the list. And CMDARG is added to the result list only if > +the header value is the same as VALUE. I think I'd rather provide something a bit more general. E.g. accept entries of the form (HEADER . FUNCTION) where function takes the header's value and returns a list of arguments where vc-git can provide as FUNCTION something like (lambda (val) (if (equal val "yes") '("--amend"))) > +(defun vc-git-log-edit-toggle-signoff () > + (interactive) > + (log-edit-toggle-header "Sign-Off" "yes")) please provide a docstring for interactive functions. > +(defun vc-git-log-edit-toggle-amend () > + (interactive) Same here. > +(define-derived-mode vc-git-log-edit-mode log-edit-mode "*VC-log*" "*VC-log*"? Really? Shouldn't that be "Log-Edit" or "Log-Edit/git" or something? > + "Major mode for editing Git log messages. > +It is based on `log-edit-mode', and has Git-specific extensions. > +\\{vc-git-log-edit-mode-map}") The \\{vc-git-log-edit-mode-map} shouldn't be needed since define-derived-mode will add it for you anyway. Other than that, it looks OK, so feel free to install it after you fixed the above details. Stefan