unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: 12537@debbugs.gnu.org
Subject: bug#12537: support for git commit --amend/--signoff
Date: Sat, 29 Sep 2012 04:11:44 +0400	[thread overview]
Message-ID: <50663CC0.6000803@yandex.ru> (raw)

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





             reply	other threads:[~2012-09-29  0:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-29  0:11 Dmitry Gutov [this message]
     [not found] ` <handler.12537.B.134887753227659.ack@debbugs.gnu.org>
2012-09-29  0:14   ` bug#12537: Acknowledgement (support for git commit --amend/--signoff) Dmitry Gutov
2012-10-01  3:16     ` Stefan Monnier
2012-10-01  3:59       ` Dmitry Gutov
2012-10-01  4:32         ` Chong Yidong
2012-10-02  0:28           ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50663CC0.6000803@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=12537@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).