Re: git-commit feature request: pass editor command line options

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: git-commit feature request: pass editor command line options

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:47:33

Miklos Vajna [off-list ref] writes:
On Tue, Oct 13, 2009 at 09:58:51PM -0700, Matthew Cline [off-list ref] wrote:
quoted
I'd like to be able to have git-commit pass the commit-message editor command
line options which aren't passed to the editor for other usages.  Right now
I have "co" aliased to "!sh -c 'GIT_EDITOR=git-commit-editor git commit'",
where git-commit-editor is a wrapper around my editor-of-choice which passes
the editor the command line options I want, but it'd be simpler and cleaner
if I could just set "commit.editor_options=-BAR".  Or even let there be a
separate editor for commits, so I could do "core.editor=foo" and
"commit.editor=foo -BAR".
Hmm, what is the use-case when using an option --foo is useful when
creating a commit, but not useful when crating a tag?

Apart from introducing inconsistency...
Not between commit and tag, but I can see you may want to auto-wrap for
log message but forbid auto-wrap when editing rebase insn sheet during
"rebase -i".

Re: git-commit feature request: pass editor command line options

From: Jeff King <hidden>
Date: 2016-06-15 22:47:33

On Wed, Oct 14, 2009 at 12:11:28PM -0700, Junio C Hamano wrote:
quoted
Hmm, what is the use-case when using an option --foo is useful when
creating a commit, but not useful when crating a tag?

Apart from introducing inconsistency...
Not between commit and tag, but I can see you may want to auto-wrap for
log message but forbid auto-wrap when editing rebase insn sheet during
"rebase -i".
I think most people who want that just have their editor automagically
recognize the different situations based on the file name or contents. I
don't think the original author is wrong to want to be able to use
command-line options to do so, but if he is using a common editor like
vim or emacs, I think such autodetection has already been written.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help