{"thread":{"id":"9473","subject":"call external editor from git-gui?","startedAt":"2007-08-10T15:30:08Z","lastAt":"2007-08-16T07:59:41Z","messageCount":7,"participants":["Karl Hasselström","Shawn O. Pearce","Jan Hudec","Uwe Kleine-König","David Kastrup","Mike Ralphson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"50416","messageId":"20070810153008.GA31759@diana.vm.bytemark.co.uk","threadId":"9473","inReplyTo":null,"subject":"call external editor from git-gui?","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-08-10T15:30:08Z","receivedAt":"2007-08-10T15:30:08Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"git-gui is very good at composing commits. But for writing the actual\ncommit message -- especially if it's long and needs paragraph\nreflowing, indentation, and so on -- I vastly prefer emacs over\ngit-gui's text field.\n\nIt seems to me like it would be straightforward to have a button or\nsomething to launch the user's favorite editor for editing of the\ncommit message -- after all, git even knows what editor that is!\n\nUnfortunately, with my tcl expertise, this is likely a whole-weekend\nproject, so I probably won't try to build it myself in the near\nfuture.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"50676","messageId":"20070814045511.GF27913@spearce.org","threadId":"9473","inReplyTo":"20070810153008.GA31759@diana.vm.bytemark.co.uk","subject":"Re: call external editor from git-gui?","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-08-14T04:55:11Z","receivedAt":"2007-08-14T04:55:11Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Karl Hasselstrm <kha@treskal.com> wrote:\n> git-gui is very good at composing commits. But for writing the actual\n> commit message -- especially if it's long and needs paragraph\n> reflowing, indentation, and so on -- I vastly prefer emacs over\n> git-gui's text field.\n\nYea, I've been thinking about adding fancy features like those.\nBut been lazy.  Spawning the user's preferred editor would be a\nnice way to get some of that.\n \n> It seems to me like it would be straightforward to have a button or\n> something to launch the user's favorite editor for editing of the\n> commit message -- after all, git even knows what editor that is!\n\nProbably.  git-gui already has the data from .git/config loaded in\nmemory, it should be fairly simple.\n\n> Unfortunately, with my tcl expertise, this is likely a whole-weekend\n> project, so I probably won't try to build it myself in the near\n> future.\n\nWith my busy schedule its unlikely to happen anytime soon either.\nBut I've added it to my todo branch.  Sometimes things on that list\nget accomplished.  ;-)\n\nAn annoying work-around would be to run your editor to create/edit\n.git/GITGUI_MSG (or .git/MERGE_MSG) then hit Rescan in git-gui.\nIt loads that file into its editor buffer if the editor buffer is\nempty or has not been modified from within git-gui since the last\ntime the file was read.\n\n-- \nShawn.\n"},{"id":"50684","messageId":"20070814070000.GA12052@diana.vm.bytemark.co.uk","threadId":"9473","inReplyTo":"20070814045511.GF27913@spearce.org","subject":"Re: call external editor from git-gui?","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-08-14T07:00:00Z","receivedAt":"2007-08-14T07:00:00Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2007-08-14 00:55:11 -0400, Shawn O. Pearce wrote:\n\n> Karl Hasselstrm <kha@treskal.com> wrote:\n>\n> > git-gui is very good at composing commits. But for writing the\n> > actual commit message -- especially if it's long and needs\n> > paragraph reflowing, indentation, and so on -- I vastly prefer\n> > emacs over git-gui's text field.\n>\n> Yea, I've been thinking about adding fancy features like those. But\n> been lazy.\n\nYeah, every time I read the git list, I think to myself, \"Wow, Shawn\nsure is lazy!\" :-)\n\nYou do a lot of seriously useful work on git.\n\n> Spawning the user's preferred editor would be a nice way to get some\n> of that.\n\nMmm. I wouldn't call it a _nice_ way: popping up an external program\njust to get the right text editing behavior. More like the _only_ way,\nif the user is picky enough.\n\n> An annoying work-around would be to run your editor to create/edit\n> .git/GITGUI_MSG (or .git/MERGE_MSG) then hit Rescan in git-gui. It\n> loads that file into its editor buffer if the editor buffer is empty\n> or has not been modified from within git-gui since the last time the\n> file was read.\n\nI just tend to git-commit --amend to accomplish that.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"50804","messageId":"20070815182228.GA3419@efreet.light.src","threadId":"9473","inReplyTo":"20070814070000.GA12052@diana.vm.bytemark.co.uk","subject":"Re: call external editor from git-gui?","fromName":"Jan Hudec","fromEmail":"bulb@ucw.cz","sentAt":"2007-08-15T18:22:28Z","receivedAt":"2007-08-15T18:22:28Z","isPatch":false,"sender":{"key":"bulb@ucw.cz","avatar":null},"body":"On Tue, Aug 14, 2007 at 09:00:00 +0200, Karl Hasselström wrote:\n> On 2007-08-14 00:55:11 -0400, Shawn O. Pearce wrote:\n> > Spawning the user's preferred editor would be a nice way to get some\n> > of that.\n> \n> Mmm. I wouldn't call it a _nice_ way: popping up an external program\n> just to get the right text editing behavior. More like the _only_ way,\n> if the user is picky enough.\n\nIt might actually have a rather serious twist. Often the editor for\ngit-commit would use the terminal git-commit runs on. But for git-gui you may\nnot have any terminal (running git-gui from context menu of some file\nmanager) and even if you do, the user does not expect it to be used. So the\nuser may -- and quite often will -- want different editors for running from\ngit-gui and git-commit.\n\n-- \n\t\t\t\t\t\t Jan 'Bulb' Hudec <bulb@ucw.cz>\n"},{"id":"50805","messageId":"20070815183149.GD1644@informatik.uni-freiburg.de","threadId":"9473","inReplyTo":"20070815182228.GA3419@efreet.light.src","subject":"Re: call external editor from git-gui?","fromName":"Uwe Kleine-König","fromEmail":"ukleinek@informatik.uni-freiburg.de","sentAt":"2007-08-15T18:31:49Z","receivedAt":"2007-08-15T18:31:49Z","isPatch":false,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"Hello,\n\nJan Hudec wrote:\n> On Tue, Aug 14, 2007 at 09:00:00 +0200, Karl Hasselström wrote:\n> > On 2007-08-14 00:55:11 -0400, Shawn O. Pearce wrote:\n> > > Spawning the user's preferred editor would be a nice way to get some\n> > > of that.\n> > \n> > Mmm. I wouldn't call it a _nice_ way: popping up an external program\n> > just to get the right text editing behavior. More like the _only_ way,\n> > if the user is picky enough.\n> \n> It might actually have a rather serious twist. Often the editor for\n> git-commit would use the terminal git-commit runs on. But for git-gui you may\n> not have any terminal (running git-gui from context menu of some file\n> manager) and even if you do, the user does not expect it to be used. So the\n> user may -- and quite often will -- want different editors for running from\n> git-gui and git-commit.\n\nAlternatively you need to find out/let the user specify if her editor\nneeds a terminal and then use\n\n\txterm -e myfavoriteeditor\n\nor simply\n\n\tmyfavoriteeditor\n\ndepending on the result.\n\nBest regards\nUwe\n\n-- \nUwe Kleine-König\n\n$ dc -e \"5735816763073014741799356604682P\"\n"},{"id":"50807","messageId":"86ir7g4p92.fsf@lola.quinscape.zz","threadId":"9473","inReplyTo":"20070815182228.GA3419@efreet.light.src","subject":"Re: call external editor from git-gui?","fromName":"David Kastrup","fromEmail":"dak@gnu.org","sentAt":"2007-08-15T18:38:33Z","receivedAt":"2007-08-15T18:38:33Z","isPatch":false,"sender":{"key":"dak@gnu.org","avatar":"https://avatars.githubusercontent.com/u/52141349?v=4"},"body":"Jan Hudec <bulb@ucw.cz> writes:\n\n> On Tue, Aug 14, 2007 at 09:00:00 +0200, Karl Hasselström wrote:\n>> On 2007-08-14 00:55:11 -0400, Shawn O. Pearce wrote:\n>> > Spawning the user's preferred editor would be a nice way to get some\n>> > of that.\n>> \n>> Mmm. I wouldn't call it a _nice_ way: popping up an external program\n>> just to get the right text editing behavior. More like the _only_ way,\n>> if the user is picky enough.\n>\n> It might actually have a rather serious twist. Often the editor for\n> git-commit would use the terminal git-commit runs on. But for git-gui you may\n> not have any terminal (running git-gui from context menu of some file\n> manager) and even if you do, the user does not expect it to be used. So the\n> user may -- and quite often will -- want different editors for running from\n> git-gui and git-commit.\n\nThe usual convention (though _very_ hard to find anywhere explicitly,\nso it might more often than not be ignored) is that $VISUAL points to\nan editor that requires a tty to work on, while $EDITOR might get\nalong without one.\n\nSo one uses VISUAL in preference of EDITOR on ttys/proper terminals,\nbut only EDITOR when without one.  A call from git-gui would probably\nfall in the second category.  A call from tig, in contrast, in the\nfirst category.\n\nThe GIT_EDITOR variable has no way of expressing this difference,\nthough.  And I doubt that many people remember this.  I googled around\nbut failed to come up with a useful reference (of course, both\nvariable names being common words does not exactly help).\n\n-- \nDavid Kastrup\n"},{"id":"50854","messageId":"e2b179460708160059x90b0187g30f50784fbe6ac87@mail.gmail.com","threadId":"9473","inReplyTo":"86ir7g4p92.fsf@lola.quinscape.zz","subject":"Re: call external editor from git-gui?","fromName":"Mike Ralphson","fromEmail":"mike.ralphson@gmail.com","sentAt":"2007-08-16T07:59:41Z","receivedAt":"2007-08-16T07:59:41Z","isPatch":false,"sender":{"key":"mike.ralphson@gmail.com","avatar":"https://avatars.githubusercontent.com/u/21603?v=4"},"body":"It seems quite common to have a trio of environment variables:\n$EDITOR, $VISUAL and $XEDITOR, for line, tty-aware and graphical\neditors respectively.\n\n[http://xdvi.sourceforge.net/inverse-search-emacs-noauctex.html]\n[http://lists.osuosl.org/pipermail/darcs-users/2006-December/010783.html]\n\nWhether git needs to have a trio of overrides for them is a different\nmatter, or could just recommend that git be aliased or wrapped if the\neditors needed for git are different to normal.\n\nCheers, Mike\n\nOn 8/15/07, David Kastrup <dak@gnu.org> wrote:\n> The usual convention (though _very_ hard to find anywhere explicitly,\n> so it might more often than not be ignored) is that $VISUAL points to\n> an editor that requires a tty to work on, while $EDITOR might get\n> along without one.\n>\n> So one uses VISUAL in preference of EDITOR on ttys/proper terminals,\n> but only EDITOR when without one.  A call from git-gui would probably\n> fall in the second category.  A call from tig, in contrast, in the\n> first category.\n>\n> The GIT_EDITOR variable has no way of expressing this difference,\n> though.  And I doubt that many people remember this.  I googled around\n> but failed to come up with a useful reference (of course, both\n> variable names being common words does not exactly help).\n"}]}