GNU bug report logs - #12537
support for git commit --amend/--signoff

Previous Next

Package: emacs;

Reported by: Dmitry Gutov <dgutov <at> yandex.ru>

Date: Sat, 29 Sep 2012 00:13:02 UTC

Severity: wishlist

Tags: patch

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: bug-gnu-emacs <at> gnu.org
Subject: support for git commit --amend/--signoff
Date: Sat, 29 Sep 2012 04:11:44 +0400
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




This bug report was last modified 12 years and 295 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.