I do not do Porcelain, but wouldn't it be nicer if we had a
Porcelain neutral "commit log template file" under $GIT_DIR
somewhere? 'vim: textwidth=75' is completely useless for
somebody like me (I almost always work inside Emacs).
StGIT uses .git/patchdescr.tmpl as the template, where people can put
the a line like "STG: vim: textwidth=75" which will be automatically
removed. I won't include this patch since it is up to the user to
define whatever setting he/she wants for his editor (I use emacs
myself and add something like "STG: -*- mode: text; -*-" on the first
line)
Cogito seems to use $GIT_DIR/commit-template for that purpose.
Can't users put that "vim:" hint there, and if StGIT does not
use a commit template, patch it to use the same file as Cogito
does?
I would use a neutral commit template, only that it should have a
neutral prefix as well for the lines to be removed (neither STG nor CG
but GIT maybe). The $GIT_DIR/commit-template is fine as a file name.
--
Catalin
From: Sam Ravnborg <hidden> Date: 2016-06-15 22:42:02
I would use a neutral commit template, only that it should have a
neutral prefix as well for the lines to be removed (neither STG nor CG
but GIT maybe). The $GIT_DIR/commit-template is fine as a file name.
How about $GIT_DIR/commit-template-`basename $EDITOR`
Then we could have different templates for vim, emacs, kade etc.
Sam
From: Petr Baudis <hidden> Date: 2016-06-15 22:42:02
Dear diary, on Fri, Jul 22, 2005 at 12:37:05PM CEST, I got a letter
where Catalin Marinas [off-list ref] told me that...
quoted
Cogito seems to use $GIT_DIR/commit-template for that purpose.
Can't users put that "vim:" hint there, and if StGIT does not
use a commit template, patch it to use the same file as Cogito
does?
I would use a neutral commit template, only that it should have a
neutral prefix as well for the lines to be removed (neither STG nor CG
but GIT maybe). The $GIT_DIR/commit-template is fine as a file name.
This unfortunately isn't that simple, since this file substitutes only
the
CG: -----------------------------------------------------------------------
CG: Lines beginning with the CG: prefix are removed automatically.
snippet of the file. The trouble is, Cogito autogenerates most of the
rest of it. Would the acceptable solution be that I would have
@CG_FILELIST@-style placeholders there, and any tool processing the
file would simply drop lines containing @ directives it does not
understand? (@@ is escaped @)
I have nothing against changing the prefix to GIT:.
Then, Cogito's default commit-template would look like
GIT: -----------------------------------------------------------------------
GIT: Lines beginning with the GIT: prefix are removed automatically.
GIT:
GIT: Author: @AUTHOR_NAME@
GIT: Email: @AUTHOR_EMAIL@
GIT: Date: @AUTHOR_DATE@
GIT:@CG_SHOWFILES@@CG_NOMERGE@
GIT:@CG_SHOWFILES@@CG_NOMERGE@ By deleting lines beginning with GIT:F, the associated file
GIT:@CG_SHOWFILES@@CG_NOMERGE@ will be removed from the commit list.
GIT:@CG_SHOWFILES@
GIT:@CG_SHOWFILES@ Modified files:
GIT:@CG_SHOWFILES@F @FILELIST@
GIT: -----------------------------------------------------------------------
GIT: vim: textwidth=75
(where CG_SHOWFILES is defined only when the list of the files is to be
shown and CG_NOMERGE only when there is no merge going on).
--
Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
If you want the holes in your knowledge showing up try teaching
someone. -- Alan Cox
On Fri, 2005-07-22 at 19:24 +0000, Sam Ravnborg wrote:
quoted
I would use a neutral commit template, only that it should have a
neutral prefix as well for the lines to be removed (neither STG nor CG
but GIT maybe). The $GIT_DIR/commit-template is fine as a file name.
How about $GIT_DIR/commit-template-`basename $EDITOR`
Then we could have different templates for vim, emacs, kade etc.
I'm not sure this is worth the hassle since a person usually sticks with
one editor, I don't see why one would use different $EDITOR variables
with the same project.
--
Catalin