{"thread":{"id":"14906","subject":"[PATCH] git gui: visually wrap lines of commit message","startedAt":"2008-08-09T16:05:57Z","lastAt":"2008-08-10T09:25:10Z","messageCount":9,"participants":["Clemens Buchacher","Johannes Sixt","Shawn O. Pearce","Lars Noschinski"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"86602","messageId":"20080809160557.GA902@localhost","threadId":"14906","inReplyTo":null,"subject":"[PATCH] git gui: visually wrap lines of commit message","fromName":"Clemens Buchacher","fromEmail":"drizzd@aon.at","sentAt":"2008-08-09T16:05:57Z","receivedAt":"2008-08-09T16:05:57Z","isPatch":true,"sender":{"key":"drizzd@gmx.net","avatar":"https://avatars.githubusercontent.com/u/59082?v=4"},"body":"Visually wrap lines in the commit message text box. That way we can avoid\na horizontal scroll bar (which was not available anyways).\n\nNote: This does _not_ break lines in the actual commit message.\n\nSigned-off-by: Clemens Buchacher <drizzd@aon.at>\n---\n\nI also tried to get automatic line breaks but was unable to do so. I managed\nto implement a callback function triggered by the <<Modified>> event, and I\nalso managed to query the end position of the insertion using the 'insert'\nindex. So with this information it would be possible to implement automatic\nline breaks. Unfortunately, this is not enough for pasting. If there is more\nthan one new character, the start position of the insertion is unknown.\n\nI then tried to track cursor movement, but no luck there either. Any ideas\nare welcome. For now I'll simply have to \"git commit --amend<CR>gqG:x<CR>\"\neach time I use git gui.\n\nClemens\n\n git-gui/git-gui.sh |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh\nindex 14b2d9a..3949f7d 100755\n--- a/git-gui/git-gui.sh\n+++ b/git-gui/git-gui.sh\n@@ -2528,6 +2528,7 @@ text $ui_comm -background white -foreground black \\\n \t-autoseparators true \\\n \t-relief sunken \\\n \t-width $repo_config(gui.commitmsgwidth) -height 9 -wrap none \\\n+\t-wrap char \\\n \t-font font_diff \\\n \t-yscrollcommand {.vpane.lower.commarea.buffer.sby set}\n scrollbar .vpane.lower.commarea.buffer.sby \\\n-- \n1.5.6.4\n"},{"id":"86616","messageId":"200808092344.33332.johannes.sixt@telecom.at","threadId":"14906","inReplyTo":"20080809160557.GA902@localhost","subject":"Re: [PATCH] git gui: visually wrap lines of commit message","fromName":"Johannes Sixt","fromEmail":"johannes.sixt@telecom.at","sentAt":"2008-08-09T21:44:33Z","receivedAt":"2008-08-09T21:44:33Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"On Samstag, 9. August 2008, Clemens Buchacher wrote:\n> Visually wrap lines in the commit message text box. That way we can avoid\n> a horizontal scroll bar (which was not available anyways).\n>\n> Note: This does _not_ break lines in the actual commit message.\n\nPlease don't do that. I want to get what I see.\n\n-- Hannes\n"},{"id":"86619","messageId":"20080809220637.GA20963@localhost","threadId":"14906","inReplyTo":"200808092344.33332.johannes.sixt@telecom.at","subject":"Re: [PATCH] git gui: visually wrap lines of commit message","fromName":"Clemens Buchacher","fromEmail":"drizzd@aon.at","sentAt":"2008-08-09T22:06:37Z","receivedAt":"2008-08-09T22:06:37Z","isPatch":true,"sender":{"key":"drizzd@gmx.net","avatar":"https://avatars.githubusercontent.com/u/59082?v=4"},"body":"On Sat, Aug 09, 2008 at 11:44:33PM +0200, Johannes Sixt wrote:\n> On Samstag, 9. August 2008, Clemens Buchacher wrote:\n> > Visually wrap lines in the commit message text box. That way we can avoid\n> > a horizontal scroll bar (which was not available anyways).\n> >\n> > Note: This does _not_ break lines in the actual commit message.\n> \n> Please don't do that. I want to get what I see.\n\nCurrently you don't see the whole message anyways if the box is too small\nfor the text. I find that quite annoying, especially since there are neither\nkeys nor a scrollbar to scroll horizontally.\n\nAnd if you break the lines manually, it really doesn't make a difference.\nUnless you \"forget\" to do so, which is unlikely, because the virtual wrap\nwill wrap per-character and not per-word.\n\nClemens\n"},{"id":"86620","messageId":"200808100014.13408.johannes.sixt@telecom.at","threadId":"14906","inReplyTo":"20080809220637.GA20963@localhost","subject":"Re: [PATCH] git gui: visually wrap lines of commit message","fromName":"Johannes Sixt","fromEmail":"johannes.sixt@telecom.at","sentAt":"2008-08-09T22:14:13Z","receivedAt":"2008-08-09T22:14:13Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"On Sonntag, 10. August 2008, Clemens Buchacher wrote:\n> On Sat, Aug 09, 2008 at 11:44:33PM +0200, Johannes Sixt wrote:\n> > On Samstag, 9. August 2008, Clemens Buchacher wrote:\n> > > Visually wrap lines in the commit message text box. That way we can\n> > > avoid a horizontal scroll bar (which was not available anyways).\n> > >\n> > > Note: This does _not_ break lines in the actual commit message.\n> >\n> > Please don't do that. I want to get what I see.\n>\n> Currently you don't see the whole message anyways if the box is too small\n> for the text. I find that quite annoying, especially since there are\n> neither keys nor a scrollbar to scroll horizontally.\n\nIn this case, I use the middle mouse button to pan around. And then I do see \nwhat I will get.\n\nThe width of the box was chosen wisely: It takes a bit less than 80 columns, \nto leave room for quoting in emails and to avoid wrapping of git log output.\n\n-- Hannes\n"},{"id":"86622","messageId":"20080809224150.GA21530@localhost","threadId":"14906","inReplyTo":"200808100014.13408.johannes.sixt@telecom.at","subject":"Re: [PATCH] git gui: visually wrap lines of commit message","fromName":"Clemens Buchacher","fromEmail":"drizzd@aon.at","sentAt":"2008-08-09T22:41:50Z","receivedAt":"2008-08-09T22:41:50Z","isPatch":true,"sender":{"key":"drizzd@gmx.net","avatar":"https://avatars.githubusercontent.com/u/59082?v=4"},"body":"On Sun, Aug 10, 2008 at 12:14:13AM +0200, Johannes Sixt wrote:\n> > Currently you don't see the whole message anyways if the box is too small\n> > for the text. I find that quite annoying, especially since there are\n> > neither keys nor a scrollbar to scroll horizontally.\n> \n> In this case, I use the middle mouse button to pan around. And then I do\n> see what I will get.\n\nOk, that's not bad. But nevertheless I think we should at least add a\nscrollbar.\n\n> The width of the box was chosen wisely: It takes a bit less than 80\n> columns, to leave room for quoting in emails and to avoid wrapping of git\n> log output.\n\nMaybe I'm doing something wrong, but on my system (wish8.5) the box width\nchanges with the window size, and gui.commitmsgwidth appears to be ignored.\nEven if I close and restart git gui, the old window size is kept.\n\nClemens\n"},{"id":"86631","messageId":"20080810022504.GA22137@spearce.org","threadId":"14906","inReplyTo":"20080809224150.GA21530@localhost","subject":"Re: [PATCH] git gui: visually wrap lines of commit message","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-08-10T02:25:04Z","receivedAt":"2008-08-10T02:25:04Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Clemens Buchacher <drizzd@aon.at> wrote:\n> On Sun, Aug 10, 2008 at 12:14:13AM +0200, Johannes Sixt wrote:\n> > > Currently you don't see the whole message anyways if the box is too small\n> > > for the text. I find that quite annoying, especially since there are\n> > > neither keys nor a scrollbar to scroll horizontally.\n> > \n> > In this case, I use the middle mouse button to pan around. And then I do\n> > see what I will get.\n> \n> Ok, that's not bad. But nevertheless I think we should at least add a\n> scrollbar.\n\nI thought the scrollbar took up too much vertical space, so I did\nnot want to put in a horizontal scrollbar on a box that never should\nrequire horizontal scrolling.  As Johannes points out...\n \n> > The width of the box was chosen wisely: It takes a bit less than 80\n> > columns, to leave room for quoting in emails and to avoid wrapping of git\n> > log output.\n> \n> Maybe I'm doing something wrong, but on my system (wish8.5) the box width\n> changes with the window size, and gui.commitmsgwidth appears to be ignored.\n> Even if I close and restart git gui, the old window size is kept.\n\nThat's a bug, and I now understand why you have a problem.  That box\nshould not be resizing itself.  Its supposed to be using a fixed\nwidth font, and have a fixed number of columns, so you can format\na message including drawing ASCII art to explain yourself clearly\nas you write a change.\n\nI'll consider a patch that fixes the box so it doesn't resize under\n8.5, but I won't apply one that applies virtual line wrapping as\nthen we lose the what-you-see-is-what-you-get property of the editor,\nand that is a very important property for git-gui users.\n\n-- \nShawn.\n"},{"id":"86640","messageId":"20080810075602.GA5381@lars.home.noschinski.de","threadId":"14906","inReplyTo":"20080810022504.GA22137@spearce.org","subject":"Re: [PATCH] git gui: visually wrap lines of commit message","fromName":"Lars Noschinski","fromEmail":"lars-2008-1@usenet.noschinski.de","sentAt":"2008-08-10T07:56:03Z","receivedAt":"2008-08-10T07:56:03Z","isPatch":true,"sender":{"key":"lars-2008-1@usenet.noschinski.de","avatar":null},"body":"* Shawn O. Pearce <spearce@spearce.org> [08-08-10 04:25]:\n>> Maybe I'm doing something wrong, but on my system (wish8.5) the box width\n>> changes with the window size, and gui.commitmsgwidth appears to be ignored.\n>> Even if I close and restart git gui, the old window size is kept.\n>\n>That's a bug, and I now understand why you have a problem.  That box\n>should not be resizing itself.  Its supposed to be using a fixed\n>width font, and have a fixed number of columns, so you can format\n>a message including drawing ASCII art to explain yourself clearly\n>as you write a change.\n\nThe box always resizes, unless the window is wide enough. But I do not\nsee a good way to fix that.\n"},{"id":"86641","messageId":"20080810075913.GB24229@spearce.org","threadId":"14906","inReplyTo":"20080810075602.GA5381@lars.home.noschinski.de","subject":"Re: [PATCH] git gui: visually wrap lines of commit message","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-08-10T07:59:13Z","receivedAt":"2008-08-10T07:59:13Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Lars Noschinski <lars-2008-1@usenet.noschinski.de> wrote:\n> * Shawn O. Pearce <spearce@spearce.org> [08-08-10 04:25]:\n>>> Maybe I'm doing something wrong, but on my system (wish8.5) the box width\n>>> changes with the window size, and gui.commitmsgwidth appears to be ignored.\n>>> Even if I close and restart git gui, the old window size is kept.\n>>\n>> That's a bug, and I now understand why you have a problem.  That box\n>> should not be resizing itself.  Its supposed to be using a fixed\n>> width font, and have a fixed number of columns, so you can format\n>> a message including drawing ASCII art to explain yourself clearly\n>> as you write a change.\n>\n> The box always resizes, unless the window is wide enough. But I do not\n> see a good way to fix that.\n\nOh, you mean the window isn't large enough to show the full column\nwidth of the text area?  But if you make it large enough, the box\nstops expanding?\n\n-- \nShawn.\n"},{"id":"86657","messageId":"20080810092510.GA25942@localhost","threadId":"14906","inReplyTo":"20080810075913.GB24229@spearce.org","subject":"Re: [PATCH] git gui: visually wrap lines of commit message","fromName":"Clemens Buchacher","fromEmail":"drizzd@aon.at","sentAt":"2008-08-10T09:25:10Z","receivedAt":"2008-08-10T09:25:10Z","isPatch":true,"sender":{"key":"drizzd@gmx.net","avatar":"https://avatars.githubusercontent.com/u/59082?v=4"},"body":"On Sun, Aug 10, 2008 at 12:59:13AM -0700, Shawn O. Pearce wrote:\n> Oh, you mean the window isn't large enough to show the full column\n> width of the text area?  But if you make it large enough, the box\n> stops expanding?\n\nYes, that is indeed the case. Sorry I missed that.\n\nKnowing the trick with the middle mouse button, I can also live without a\nscrollbar. So this issue is resolved for me.\n\nClemens\n"}]}