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: Acknowledgement (support for git commit --amend/--signoff) Date: Mon, 01 Oct 2012 07:59:15 +0400 Message-ID: <50691513.6090704@yandex.ru> References: <50663CC0.6000803@yandex.ru> <50663D58.4010702@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 1349063986 14824 80.91.229.3 (1 Oct 2012 03:59:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 1 Oct 2012 03:59:46 +0000 (UTC) Cc: 12537@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 01 05:59: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 1TIXAZ-0005ge-Lh for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Oct 2012 05:59:47 +0200 Original-Received: from localhost ([::1]:36111 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TIXAU-0000GY-An for geb-bug-gnu-emacs@m.gmane.org; Sun, 30 Sep 2012 23:59:42 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:49779) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TIXAR-0000GH-Og for bug-gnu-emacs@gnu.org; Sun, 30 Sep 2012 23:59:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TIXAQ-00064d-HY for bug-gnu-emacs@gnu.org; Sun, 30 Sep 2012 23:59:39 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54032) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TIXAQ-00064Z-89 for bug-gnu-emacs@gnu.org; Sun, 30 Sep 2012 23:59:38 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TIXAn-0001Jr-T3 for bug-gnu-emacs@gnu.org; Mon, 01 Oct 2012 00:00: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: Mon, 01 Oct 2012 04:00:01 +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.13490639865027 (code B ref 12537); Mon, 01 Oct 2012 04:00:01 +0000 Original-Received: (at 12537) by debbugs.gnu.org; 1 Oct 2012 03:59:46 +0000 Original-Received: from localhost ([127.0.0.1]:35345 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TIXAY-0001J1-0d for submit@debbugs.gnu.org; Sun, 30 Sep 2012 23:59:46 -0400 Original-Received: from forward13.mail.yandex.net ([95.108.130.120]:43799) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TIXAS-0001Iq-P7 for 12537@debbugs.gnu.org; Sun, 30 Sep 2012 23:59:44 -0400 Original-Received: from smtp13.mail.yandex.net (smtp13.mail.yandex.net [95.108.130.68]) by forward13.mail.yandex.net (Yandex) with ESMTP id 69CEB1421EB; Mon, 1 Oct 2012 07:59:14 +0400 (MSK) Original-Received: from smtp13.mail.yandex.net (localhost [127.0.0.1]) by smtp13.mail.yandex.net (Yandex) with ESMTP id 3A614E4057D; Mon, 1 Oct 2012 07:59:14 +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 xDmCHGjj-xDm0J6UN; Mon, 1 Oct 2012 07:59:14 +0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1349063954; bh=ISknc8NMrj9q00qj3s2dvtO/AHUPb19otO1My4uFg7U=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=M/KAK2AeTx+RK2NHBkpI7fLz7xY293tSOJ7mmRMTlAP03nWVANfdCey8n/QjffShv KuN2FN3ZxV3otKsZqmBiBVuwanHDJHt0+3HWv4w+o9wjC5z7bTG3Lozb/1i3Tafo7h Br0iYAWPpx+JFrlHiY78Y364U3iJXoH5YbJVQEa4= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 In-Reply-To: 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:65046 Archived-At: On 01.10.2012 7:16, Stefan Monnier wrote: >> - (,(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:]-]. Ok. How about I also add the limitation that the first character must be a capital letter? message-font-lock-keywords has that. >> +(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"? Works for me. >> +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"))) Okay. That's definitely less awkward than my proposed change. >> +(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? Sure, will do. I like the "Log-Edit/git" option better. >> + "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. I think we're entering the feature freeze period right about now. Is it okay if I install the updated patch 16 hours or so later?