git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Regulator updates for 3.3

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Jan 11, 2012, 02:47 UTC
Message-ID
<CA+55aFx5NATrpLnkMiV2vAxSAJPK7wkY2vyHbyeZGgT9+jP06w@mail.gmail.com>
In-Reply-To
<7vmx9v7z1r.fsf@alter.siamese.dyndns.org>
On Tue, Jan 10, 2012 at 6:28 PM, Junio C Hamano <gitster@pobox.com> wrote:
>
> It is a non-starter to unconditionally start an editor.

I really wonder. Because not being default will always lead to really odd ways of saying "it should have been default, so we'll make up these complex and arbitrary special rules" (like the ones you were starting to outline).

So I really suspect it would be easier and more straightforward to instead just bite the bullet, and say:

 (a) start an editor by default if both stdin/stdout matched in fstat
and were istty().
 (b) have some trivial way to disable that default behavior for people
who really want the legacy behavior. And by "trivial" I mean "set the
GIT_LEGACY_MERGE environment variable" or something.
 (c) have a "--no-editor" command line switch so that scripts and/or
users that want to make it explicit (rather than rely on the hacky
legacy workaround) can do so (and a explicit "--editor" switch to
enable people to use a GUI editor even if they aren't on a terminal -
think something IDE environment, whatever).

Where (a) is so that people will always get the editor if they aren't aware of it, and (b) is so that existing scripting environments can then *trivially* work around the fact that we changed semantics, including on a site-wide basis. With (c) being for future users. Of course, just a "git merge < /dev/null" would also do it, but sounds ridiculously hacky (and doesn't allow the "--editor" version), so that "--no-editor" flag sounds saner and much more powerful.

Of course, if you use "-m", no editor would fire up anyway, exactly like with "git commit", so that's one way to avoid the issue forever (and be backwards compatible). But if you actually *want* to get the auto-generated message and no editor, that would need that new switch.

Yes, git has been very good about not breaking semantics. But it's happened before too when it needed to happen. We've had much bigger breaks (like the whole "git-xyz" to "git xyz" transition, for example, which broke a lot of scripts).

                       Linus
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 20 in “Re: Regulator updates for 3.3”
  1. Linus TorvaldsJan 10, 2012
  2. Mark BrownJan 10, 2012
  3. Junio C HamanoJan 11, 2012
  4. Linus TorvaldsJan 11, 2012
  5. Junio C HamanoJan 11, 2012
  6. Linus TorvaldsJan 11, 2012
  7. Re* Regulator updates for 3.3Junio C Hamano, Jan 11, 2012
  8. Phil HordJan 11, 2012
  9. Linus TorvaldsJan 11, 2012
  10. Pete HarlanJan 16, 2012
  11. Junio C HamanoJan 16, 2012
  12. Martin FickJan 16, 2012
  13. Pete HarlanJan 17, 2012
  14. Junio C HamanoJan 17, 2012
  15. Linus TorvaldsJan 11, 2012
  16. Paul GortmakerJan 11, 2012
  17. Junio C HamanoJan 13, 2012
  18. Nguyen Thai Ngoc DuyJan 13, 2012
  19. Linus TorvaldsJan 13, 2012
  20. Miles BaderJan 17, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.