From: "Adam Piątyszek" <ediap@users.sourceforge.net>
To: "Shawn O. Pearce" <spearce@spearce.org>
Cc: git@vger.kernel.org, "Adam Piątyszek" <ediap@users.sourceforge.net>
Subject: [PATCH] git-gui: Add option for changing the width of the commit message text box
Date: Thu, 6 Mar 2008 20:38:40 +0100 [thread overview]
Message-ID: <1204832320-22800-1-git-send-email-ediap@users.sourceforge.net> (raw)
The width of the commit message text area is currently hard-coded
to 75 characters. This value might be not optimal for some projects.
For instance users who would like to generate GNU-style ChangeLog
file from git commit message might prefer commit messages of width
no longer than 70 characters.
This patch adds a global and per repository option "Commit Message
Text Width", which could be used to change the width of the commit
message text area.
Signed-off-by: Adam Piątyszek <ediap@users.sourceforge.net>
---
Ideally, I would like to have an automated line wrapping in the commit
message text area. Unfortunately the "-wrap words" switch only wraps the
lines for displaying purposes and this has no effect on the committed message
itself.
Anyway, the patch I prepared allows at least for configuring the width of
the commit message text box, so it is easier to manually wrap lines to
expected width.
This patch is against git.git's master branch. I hope this is fine.
/Adam
git-gui/git-gui.sh | 3 ++-
git-gui/lib/option.tcl | 1 +
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index 238a239..f617a4a 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -611,6 +611,7 @@ set default_config(gui.matchtrackingbranch) false
set default_config(gui.pruneduringfetch) false
set default_config(gui.trustmtime) false
set default_config(gui.diffcontext) 5
+set default_config(gui.commitmsgwidth) 75
set default_config(gui.newbranchtemplate) {}
set default_config(gui.spellingdictionary) {}
set default_config(gui.fontui) [font configure font_ui]
@@ -2421,7 +2422,7 @@ text $ui_comm -background white -borderwidth 1 \
-maxundo 20 \
-autoseparators true \
-relief sunken \
- -width 75 -height 9 -wrap none \
+ -width $repo_config(gui.commitmsgwidth) -height 9 -wrap none \
-font font_diff \
-yscrollcommand {.vpane.lower.commarea.buffer.sby set}
scrollbar .vpane.lower.commarea.buffer.sby \
diff --git a/git-gui/lib/option.tcl b/git-gui/lib/option.tcl
index ea80df0..9270512 100644
--- a/git-gui/lib/option.tcl
+++ b/git-gui/lib/option.tcl
@@ -124,6 +124,7 @@ proc do_options {} {
{b gui.pruneduringfetch {mc "Prune Tracking Branches During Fetch"}}
{b gui.matchtrackingbranch {mc "Match Tracking Branches"}}
{i-0..99 gui.diffcontext {mc "Number of Diff Context Lines"}}
+ {i-0..99 gui.commitmsgwidth {mc "Commit Message Text Width"}}
{t gui.newbranchtemplate {mc "New Branch Name Template"}}
} {
set type [lindex $option 0]
--
1.5.4.3.450.gb92176.dirty
next reply other threads:[~2008-03-06 19:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-06 19:38 Adam Piątyszek [this message]
2008-03-08 2:00 ` [PATCH] git-gui: Add option for changing the width of the commit message text box Shawn O. Pearce
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1204832320-22800-1-git-send-email-ediap@users.sourceforge.net \
--to=ediap@users.sourceforge.net \
--cc=git@vger.kernel.org \
--cc=spearce@spearce.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).