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

[PATCH] git gui: visually wrap lines of commit message

From
Clemens Buchacher <drizzd@aon.at>
Date
Aug 9, 2008, 16:05 UTC
Message-ID
<20080809160557.GA902@localhost>

Visually wrap lines in the commit message text box. That way we can avoid a horizontal scroll bar (which was not available anyways).

Note: This does _not_ break lines in the actual commit message.
Signed-off-by: Clemens Buchacher <drizzd@aon.at>
---

I also tried to get automatic line breaks but was unable to do so. I managed to implement a callback function triggered by the <<Modified>> event, and I also managed to query the end position of the insertion using the 'insert' index. So with this information it would be possible to implement automatic line breaks. Unfortunately, this is not enough for pasting. If there is more than one new character, the start position of the insertion is unknown.

I then tried to track cursor movement, but no luck there either. Any ideas are welcome. For now I'll simply have to "git commit --amend<CR>gqG:x<CR>" each time I use git gui.

Clemens
 git-gui/git-gui.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index 14b2d9a..3949f7d 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -2528,6 +2528,7 @@ text $ui_comm -background white -foreground black \
 	-autoseparators true \
 	-relief sunken \
 	-width $repo_config(gui.commitmsgwidth) -height 9 -wrap none \
+	-wrap char \
 	-font font_diff \
 	-yscrollcommand {.vpane.lower.commarea.buffer.sby set}
 scrollbar .vpane.lower.commarea.buffer.sby \
-- 
1.5.6.4
Next: Johannes Sixt
Message 1 of 9 in “git gui: visually wrap lines of commit message”
  1. git gui: visually wrap lines of commit messageClemens Buchacher, Aug 9, 2008
  2. Johannes SixtAug 9, 2008
  3. Clemens BuchacherAug 9, 2008
  4. Johannes SixtAug 9, 2008
  5. Clemens BuchacherAug 9, 2008
  6. Shawn O. PearceAug 10, 2008
  7. Lars NoschinskiAug 10, 2008
  8. Shawn O. PearceAug 10, 2008
  9. Clemens BuchacherAug 10, 2008

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.