{"thread":{"id":"21238","subject":"git-commit feature request: pass editor command line options","startedAt":"2009-10-14T04:58:51Z","lastAt":"2009-10-14T22:12:16Z","messageCount":6,"participants":["Matthew Cline","Miklos Vajna","Junio C Hamano","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"124927","messageId":"25885354.post@talk.nabble.com","threadId":"21238","inReplyTo":null,"subject":"git-commit feature request: pass editor command line options","fromName":"Matthew Cline","fromEmail":"matt@nightrealms.com","sentAt":"2009-10-14T04:58:51Z","receivedAt":"2009-10-14T04:58:51Z","isPatch":false,"sender":{"key":"matt@nightrealms.com","avatar":"https://gravatar.com/avatar/7dbe6038081e2f6f52e8b7804b21a629e267395b31cf3c001570d04cade09c5e?d=mp&s=160"},"body":"\nI'd like to be able to have git-commit pass the commit-message editor command\nline options which aren't passed to the editor for other usages.  Right now\nI have \"co\" aliased to \"!sh -c 'GIT_EDITOR=git-commit-editor git commit'\",\nwhere git-commit-editor is a wrapper around my editor-of-choice which passes\nthe editor the command line options I want, but it'd be simpler and cleaner\nif I could just set \"commit.editor_options=-BAR\".  Or even let there be a\nseparate editor for commits, so I could do \"core.editor=foo\" and\n\"commit.editor=foo -BAR\".\n-- \nView this message in context: http://www.nabble.com/git-commit-feature-request%3A-pass-editor-command-line-options-tp25885354p25885354.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"124991","messageId":"20091014172337.GE6115@genesis.frugalware.org","threadId":"21238","inReplyTo":"25885354.post@talk.nabble.com","subject":"Re: git-commit feature request: pass editor command line options","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2009-10-14T17:23:38Z","receivedAt":"2009-10-14T17:23:38Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Tue, Oct 13, 2009 at 09:58:51PM -0700, Matthew Cline <matt@nightrealms.com> wrote:\n> \n> I'd like to be able to have git-commit pass the commit-message editor command\n> line options which aren't passed to the editor for other usages.  Right now\n> I have \"co\" aliased to \"!sh -c 'GIT_EDITOR=git-commit-editor git commit'\",\n> where git-commit-editor is a wrapper around my editor-of-choice which passes\n> the editor the command line options I want, but it'd be simpler and cleaner\n> if I could just set \"commit.editor_options=-BAR\".  Or even let there be a\n> separate editor for commits, so I could do \"core.editor=foo\" and\n> \"commit.editor=foo -BAR\".\n\nHmm, what is the use-case when using an option --foo is useful when\ncreating a commit, but not useful when crating a tag?\n\nApart from introducing inconsistency...\n"},{"id":"125007","messageId":"7vvdihdc4f.fsf@alter.siamese.dyndns.org","threadId":"21238","inReplyTo":"20091014172337.GE6115@genesis.frugalware.org","subject":"Re: git-commit feature request: pass editor command line options","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-10-14T19:11:28Z","receivedAt":"2009-10-14T19:11:28Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Miklos Vajna <vmiklos@frugalware.org> writes:\n\n> On Tue, Oct 13, 2009 at 09:58:51PM -0700, Matthew Cline <matt@nightrealms.com> wrote:\n>> \n>> I'd like to be able to have git-commit pass the commit-message editor command\n>> line options which aren't passed to the editor for other usages.  Right now\n>> I have \"co\" aliased to \"!sh -c 'GIT_EDITOR=git-commit-editor git commit'\",\n>> where git-commit-editor is a wrapper around my editor-of-choice which passes\n>> the editor the command line options I want, but it'd be simpler and cleaner\n>> if I could just set \"commit.editor_options=-BAR\".  Or even let there be a\n>> separate editor for commits, so I could do \"core.editor=foo\" and\n>> \"commit.editor=foo -BAR\".\n>\n> Hmm, what is the use-case when using an option --foo is useful when\n> creating a commit, but not useful when crating a tag?\n>\n> Apart from introducing inconsistency...\n\nNot between commit and tag, but I can see you may want to auto-wrap for\nlog message but forbid auto-wrap when editing rebase insn sheet during\n\"rebase -i\".\n"},{"id":"125014","messageId":"200910141303.01485.matt@nightrealms.com","threadId":"21238","inReplyTo":"20091014172337.GE6115@genesis.frugalware.org","subject":"Re: git-commit feature request: pass editor command line options","fromName":"Matthew Cline","fromEmail":"matt@nightrealms.com","sentAt":"2009-10-14T20:03:01Z","receivedAt":"2009-10-14T20:03:01Z","isPatch":false,"sender":{"key":"matt@nightrealms.com","avatar":"https://gravatar.com/avatar/7dbe6038081e2f6f52e8b7804b21a629e267395b31cf3c001570d04cade09c5e?d=mp&s=160"},"body":"On Wednesday 14 October 2009 10:23:38 am Miklos Vajna wrote:\n\n> Hmm, what is the use-case when using an option --foo is useful when\n> creating a commit, but not useful when crating a tag?\n\nIn my case, it's using a commit template which starts with a comment, so I \nwant to move the cursor down to the line below the comment.\n"},{"id":"125023","messageId":"20091014211245.GA21670@sigill.intra.peff.net","threadId":"21238","inReplyTo":"7vvdihdc4f.fsf@alter.siamese.dyndns.org","subject":"Re: git-commit feature request: pass editor command line options","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-10-14T21:12:45Z","receivedAt":"2009-10-14T21:12:45Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Oct 14, 2009 at 12:11:28PM -0700, Junio C Hamano wrote:\n\n> > Hmm, what is the use-case when using an option --foo is useful when\n> > creating a commit, but not useful when crating a tag?\n> >\n> > Apart from introducing inconsistency...\n> \n> Not between commit and tag, but I can see you may want to auto-wrap for\n> log message but forbid auto-wrap when editing rebase insn sheet during\n> \"rebase -i\".\n\nI think most people who want that just have their editor automagically\nrecognize the different situations based on the file name or contents. I\ndon't think the original author is wrong to want to be able to use\ncommand-line options to do so, but if he is using a common editor like\nvim or emacs, I think such autodetection has already been written.\n\n-Peff\n"},{"id":"125025","messageId":"20091014221216.GI6115@genesis.frugalware.org","threadId":"21238","inReplyTo":"200910141303.01485.matt@nightrealms.com","subject":"Re: git-commit feature request: pass editor command line options","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2009-10-14T22:12:16Z","receivedAt":"2009-10-14T22:12:16Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Wed, Oct 14, 2009 at 01:03:01PM -0700, Matthew Cline <matt@nightrealms.com> wrote:\n> On Wednesday 14 October 2009 10:23:38 am Miklos Vajna wrote:\n> \n> > Hmm, what is the use-case when using an option --foo is useful when\n> > creating a commit, but not useful when crating a tag?\n> \n> In my case, it's using a commit template which starts with a comment, so I \n> want to move the cursor down to the line below the comment.\n\nThen rebase, tag, add -e and even commit --amend would use core.editor,\nwhile commit alone would use commit.editor, right?\n\nA minor confusion would be that git commit --amend would not use\ncommit.editor. ;-)\n"}]}