All of lore.kernel.org
 help / color / mirror / Atom feed
* git-commit feature request: pass editor command line options
@ 2009-10-14  4:58 Matthew Cline
  2009-10-14 17:23 ` Miklos Vajna
  0 siblings, 1 reply; 6+ messages in thread
From: Matthew Cline @ 2009-10-14  4:58 UTC (permalink / raw)
  To: git


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".
-- 
View this message in context: http://www.nabble.com/git-commit-feature-request%3A-pass-editor-command-line-options-tp25885354p25885354.html
Sent from the git mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: git-commit feature request: pass editor command line options
  2009-10-14  4:58 git-commit feature request: pass editor command line options Matthew Cline
@ 2009-10-14 17:23 ` Miklos Vajna
  2009-10-14 19:11   ` Junio C Hamano
  2009-10-14 20:03   ` Matthew Cline
  0 siblings, 2 replies; 6+ messages in thread
From: Miklos Vajna @ 2009-10-14 17:23 UTC (permalink / raw)
  To: Matthew Cline; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 831 bytes --]

On Tue, Oct 13, 2009 at 09:58:51PM -0700, Matthew Cline <matt@nightrealms.com> wrote:
> 
> 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...

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: git-commit feature request: pass editor command line options
  2009-10-14 17:23 ` Miklos Vajna
@ 2009-10-14 19:11   ` Junio C Hamano
  2009-10-14 21:12     ` Jeff King
  2009-10-14 20:03   ` Matthew Cline
  1 sibling, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2009-10-14 19:11 UTC (permalink / raw)
  To: Miklos Vajna; +Cc: Matthew Cline, git

Miklos Vajna <vmiklos@frugalware.org> writes:

> On Tue, Oct 13, 2009 at 09:58:51PM -0700, Matthew Cline <matt@nightrealms.com> wrote:
>> 
>> 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".

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: git-commit feature request: pass editor command line options
  2009-10-14 17:23 ` Miklos Vajna
  2009-10-14 19:11   ` Junio C Hamano
@ 2009-10-14 20:03   ` Matthew Cline
  2009-10-14 22:12     ` Miklos Vajna
  1 sibling, 1 reply; 6+ messages in thread
From: Matthew Cline @ 2009-10-14 20:03 UTC (permalink / raw)
  To: Miklos Vajna; +Cc: git

On Wednesday 14 October 2009 10:23:38 am Miklos Vajna wrote:

> Hmm, what is the use-case when using an option --foo is useful when
> creating a commit, but not useful when crating a tag?

In my case, it's using a commit template which starts with a comment, so I 
want to move the cursor down to the line below the comment.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: git-commit feature request: pass editor command line options
  2009-10-14 19:11   ` Junio C Hamano
@ 2009-10-14 21:12     ` Jeff King
  0 siblings, 0 replies; 6+ messages in thread
From: Jeff King @ 2009-10-14 21:12 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Miklos Vajna, Matthew Cline, git

On Wed, Oct 14, 2009 at 12:11:28PM -0700, Junio C Hamano wrote:

> > 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: git-commit feature request: pass editor command line options
  2009-10-14 20:03   ` Matthew Cline
@ 2009-10-14 22:12     ` Miklos Vajna
  0 siblings, 0 replies; 6+ messages in thread
From: Miklos Vajna @ 2009-10-14 22:12 UTC (permalink / raw)
  To: Matthew Cline; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 648 bytes --]

On Wed, Oct 14, 2009 at 01:03:01PM -0700, Matthew Cline <matt@nightrealms.com> wrote:
> On Wednesday 14 October 2009 10:23:38 am Miklos Vajna wrote:
> 
> > Hmm, what is the use-case when using an option --foo is useful when
> > creating a commit, but not useful when crating a tag?
> 
> In my case, it's using a commit template which starts with a comment, so I 
> want to move the cursor down to the line below the comment.

Then rebase, tag, add -e and even commit --amend would use core.editor,
while commit alone would use commit.editor, right?

A minor confusion would be that git commit --amend would not use
commit.editor. ;-)

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-10-14 22:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-14  4:58 git-commit feature request: pass editor command line options Matthew Cline
2009-10-14 17:23 ` Miklos Vajna
2009-10-14 19:11   ` Junio C Hamano
2009-10-14 21:12     ` Jeff King
2009-10-14 20:03   ` Matthew Cline
2009-10-14 22:12     ` Miklos Vajna

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.