@@ -161,10 +161,32 @@ If neither of the above exist then
`$XDG_CONFIG_HOME/git/gitk` is created and
used by default. If '$XDG_CONFIG_HOME' is not set it defaults to
`$HOME/.config` in all cases.
+The following are some options that are configurable by updating the
contents
+of the above configuration file. To set an option to a specific value add a
+line containing "set <option> <value>".
+
+wrapcomment::
+
+ Describes whether the comment section of a commit should be displayed
+ with (word) wrapded lines or without any wrapping of the lines.
+ Vaild options are none (default setting) and word.
+
+wraplines::
+
+ Describes whether the source section in the gitk viewer should be
displayed
+ with (word) wrapded lines or should be scrollaple with unwrapped lines.
+ Vaild options are none (default setting) and word.
+
+worddiffdefault::
+
+ Sets the default diff view mode for gitk. Valid options are:
+ lines -- for "Line diff" (default setting)
+ markup -- for "Markup words"
+ color -- for "Color words"
+
History
-------
-Gitk was the first graphical repository browser. It's written in
-tcl/tk.
+Gitk was the first graphical repository browser. It's written in tcl/tk.
'gitk' is actually maintained as an independent project, but stable
versions are distributed as part of the Git suite for the convenience
@@ -2089,7 +2089,7 @@ proc makewindow {} {
global diffcontextstring diffcontext
global ignorespace
global maincursor textcursor curtextcursor
- global rowctxmenu fakerowmenu mergemax wrapcomment
+ global rowctxmenu fakerowmenu mergemax wrapcomment wraplines
global highlight_files gdttype
global searchstring sstring
global bgcolor fgcolor bglist fglist diffcolors diffbgcolors
Using gitk for tracking changes in large text files, which often have very long lines consisting of, e.g., a paragarph of an article, it is highly desirable to wrap the lines in the diff view and also to set the default diff mode to "Markup words" or "Color lines". There is a configurable option "wrapcomment" to make the comments wrap in gitk, and now an additional "wraplines" option is introduced for warpping lines in the source files. Similarly, an option "worddiffdefault" is introduced which sets the default diff view mode to "Markup words" or "Color lines". These options can be set by editing gitk's configuration file. The default behaviours are unchanged. The new options are documented in Documentation/gitk, where the formerly undocumented feature "wrapcomment" also got explained, which was introduced by Commit f1b8629453 ([PATCH] gitk: Display commit messages with word wrap, 2006-05-15). Suggested-by: Ailin Nemui <ailin.nemui@xxxxxxxxx> (https://www.spinics.net/lists/git/msg274761.html ) Signed-off-by: András Gilyén <gilyen@renyi.hu> --- Documentation/gitk.txt | 26 ++++++++++++++++++++++++-- gitk-git/gitk | 36 ++++++++++++++++++++++-------------- 2 files changed, 46 insertions(+), 16 deletions(-) selectbgcolor @@ -2101,7 +2101,7 @@ proc makewindow {} { global rprogitem rprogcoord rownumsel numcommits global have_tk85 use_ttk NS global git_version - global worddiff + global worddiff worddiffdefault # The "mc" arguments here are purely so that xgettext # sees the following string as needing to be translated @@ -2420,7 +2420,13 @@ proc makewindow {} { -command changeignorespace -variable ignorespace pack .bleft.mid.ignspace -side left -padx 5 - set worddiff [mc "Line diff"] + if {$worddiffdefault == "color" && [package vcompare $git_version "1.7.2"] >= 0} { + set worddiff [mc "Color words"] + } elseif {$worddiffdefault == "markup" && [package vcompare $git_version "1.7.2"] >= 0} { + set worddiff [mc "Markup words"] + } else { + set worddiff [mc "Line diff"] + } if {[package vcompare $git_version "1.7.2"] >= 0} { makedroplist .bleft.mid.worddiff worddiff [mc "Line diff"] \ [mc "Markup words"] [mc "Color words"] @@ -2431,7 +2437,7 @@ proc makewindow {} { set ctext .bleft.bottom.ctext text $ctext -background $bgcolor -foreground $fgcolor \ -state disabled -undo 0 -font textfont \ - -yscrollcommand scrolltext -wrap none \ + -yscrollcommand scrolltext -wrap $wraplines \ -xscrollcommand ".bleft.bottom.sbhorizontal set" if {$have_tk85} { $ctext conf -tabstyle wordprocessor @@ -12392,6 +12398,7 @@ set downarrowlen 5 set mingaplen 100 set cmitmode "patch" set wrapcomment "none" +set wraplines "none" set showneartags 1 set hideremotes 0 set maxrefs 20 @@ -12438,6 +12445,7 @@ set diffbgcolors {"#fff3f3" "#f0fff0"} set diffcontext 3 set mergecolors {red blue "#00ff00" purple brown "#009090" magenta "#808000" "#009000" "#ff0080" cyan "#b07070" "#70b0f0" "#70f0b0" "#f0b070" "#ff70b0"} set ignorespace 0 +set worddiffdefault "line" set worddiff "" set markbgcolor "#e0e0ff" @@ -12497,16 +12505,16 @@ config_check_tmp_exists 50 set config_variables { mainfont textfont uifont tabstop findmergefiles maxgraphpct maxwidth - cmitmode wrapcomment autoselect autosellen showneartags maxrefs visiblerefs - hideremotes showlocalchanges datetimeformat limitdiffs uicolor want_ttk - bgcolor fgcolor uifgcolor uifgdisabledcolor colors diffcolors mergecolors - markbgcolor diffcontext selectbgcolor foundbgcolor currentsearchhitbgcolor - extdifftool perfile_attrs headbgcolor headfgcolor headoutlinecolor - remotebgcolor tagbgcolor tagfgcolor tagoutlinecolor reflinecolor - filesepbgcolor filesepfgcolor linehoverbgcolor linehoverfgcolor - linehoveroutlinecolor mainheadcirclecolor workingfilescirclecolor - indexcirclecolor circlecolors linkfgcolor circleoutlinecolor diffbgcolors - web_browser + cmitmode wrapcomment wraplines worddiffdefault autoselect autosellen + showneartags maxrefs visiblerefs hideremotes showlocalchanges datetimeformat + limitdiffs uicolor want_ttk bgcolor fgcolor uifgcolor uifgdisabledcolor + colors diffcolors mergecolors markbgcolor diffcontext selectbgcolor + foundbgcolor currentsearchhitbgcolor extdifftool perfile_attrs + headbgcolor headfgcolor headoutlinecolor remotebgcolor tagbgcolor + tagfgcolor tagoutlinecolor reflinecolor filesepbgcolor filesepfgcolor + linehoverbgcolor linehoverfgcolor linehoveroutlinecolor mainheadcirclecolor + workingfilescirclecolor indexcirclecolor circlecolors linkfgcolor + circleoutlinecolor diffbgcolors web_browser } foreach var $config_variables { config_init_trace $var