{"thread":{"id":"34736","subject":"[PATCH] Add gui.displayuntracked option","startedAt":"2013-08-21T03:29:13Z","lastAt":"2013-08-27T09:32:48Z","messageCount":4,"participants":["Max Kirillov","Pat Thoyts"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"225594","messageId":"20130821032913.GA6092@wheezy.local","threadId":"34736","inReplyTo":null,"subject":"[PATCH] Add gui.displayuntracked option","fromName":"Max Kirillov","fromEmail":"max@max630.net","sentAt":"2013-08-21T03:29:13Z","receivedAt":"2013-08-21T03:29:13Z","isPatch":true,"sender":{"key":"max@max630.net","avatar":"https://avatars.githubusercontent.com/u/381560?v=4"},"body":"When git is used to track only a subset of a directory, or\nthere is no sure way to divide files to ignore from files to track,\ngit user have to live with large number of untracked files. These files\npresent in file list, and should always be scrolled through\nto handle real changes. Situation can become even worse, then number\nof the untracked files grows above the maxfilesdisplayed limit. In the\ncase, even staged can be hidden by git-gui.\n\nThis change introduces new configuration variable gui.displayuntracked,\nwhich, when set to false, instructs git-gui not to show untracked files\nin files list. They can be staged from commandline or other tools (like\nIDE of file manager), then they become visible. Default value of the\noption is true, which is compatible with current behavior.\n\nSigned-off-by: Max Kirillov <max@max630.net>\n---\nHi. I've been using git for some time and have collected a\nnumber of changes which might worth sharing.\nPlease consider adding them to the upstream.\n\nThanks,\nMax\n\n Documentation/config.txt |  4 ++++\n git-gui/git-gui.sh       | 14 ++++++++++----\n git-gui/lib/option.tcl   |  1 +\n 3 files changed, 15 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex bbba728..7a786b2 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -1277,6 +1277,10 @@ gui.diffcontext::\n \tSpecifies how many context lines should be used in calls to diff\n \tmade by the linkgit:git-gui[1]. The default is \"5\".\n \n+gui.displayuntracked::\n+\tDetermines if linkgit::git-gui[1] shows untracked files\n+\tin the file list. The defaulit is \"true\".\n+\n gui.encoding::\n \tSpecifies the default encoding to use for displaying of\n \tfile contents in linkgit:git-gui[1] and linkgit:gitk[1].\ndiff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh\nindex 89f636f..42c35ad 100755\n--- a/git-gui/git-gui.sh\n+++ b/git-gui/git-gui.sh\n@@ -898,6 +898,7 @@ set font_descs {\n \t{fontdiff font_diff {mc \"Diff/Console Font\"}}\n }\n set default_config(gui.stageuntracked) ask\n+set default_config(gui.displayuntracked) true\n \n ######################################################################\n ##\n@@ -1536,18 +1537,23 @@ proc rescan_stage2 {fd after} {\n \tset buf_rdf {}\n \tset buf_rlo {}\n \n-\tset rescan_active 3\n+\tset rescan_active 2\n \tui_status [mc \"Scanning for modified files ...\"]\n \tset fd_di [git_read diff-index --cached -z [PARENT]]\n \tset fd_df [git_read diff-files -z]\n-\tset fd_lo [eval git_read ls-files --others -z $ls_others]\n \n \tfconfigure $fd_di -blocking 0 -translation binary -encoding binary\n \tfconfigure $fd_df -blocking 0 -translation binary -encoding binary\n-\tfconfigure $fd_lo -blocking 0 -translation binary -encoding binary\n+\n \tfileevent $fd_di readable [list read_diff_index $fd_di $after]\n \tfileevent $fd_df readable [list read_diff_files $fd_df $after]\n-\tfileevent $fd_lo readable [list read_ls_others $fd_lo $after]\n+\n+\tif {[is_config_true gui.displayuntracked]} {\n+\t\tset fd_lo [eval git_read ls-files --others -z $ls_others]\n+\t\tfconfigure $fd_lo -blocking 0 -translation binary -encoding binary\n+\t\tfileevent $fd_lo readable [list read_ls_others $fd_lo $after]\n+\t\tincr rescan_active\n+\t}\n }\n \n proc load_message {file {encoding {}}} {\ndiff --git a/git-gui/lib/option.tcl b/git-gui/lib/option.tcl\nindex 0cf1da1..2177db6 100644\n--- a/git-gui/lib/option.tcl\n+++ b/git-gui/lib/option.tcl\n@@ -159,6 +159,7 @@ proc do_options {} {\n \t\t{c gui.encoding {mc \"Default File Contents Encoding\"}}\n \t\t{b gui.warndetachedcommit {mc \"Warn before committing to a detached head\"}}\n \t\t{s gui.stageuntracked {mc \"Staging of untracked files\"} {list \"yes\" \"no\" \"ask\"}}\n+\t\t{b gui.displayuntracked {mc \"Show untracked files\"}}\n \t\t} {\n \t\tset type [lindex $option 0]\n \t\tset name [lindex $option 1]\n-- \n1.8.4.rc3.902.g80a4b9e\n"},{"id":"225595","messageId":"20130821033822.GB6156@wheezy.local","threadId":"34736","inReplyTo":"20130821032913.GA6092@wheezy.local","subject":"[PATCH] git-gui: right half window is paned","fromName":"Max Kirillov","fromEmail":"max@max630.net","sentAt":"2013-08-21T03:38:40Z","receivedAt":"2013-08-21T03:38:40Z","isPatch":true,"sender":{"key":"max@max630.net","avatar":"https://avatars.githubusercontent.com/u/381560?v=4"},"body":"For long descriptions it would be nice to be able to resize\nthe comment text field.\n\nSigned-off-by: Max Kirillov <max@max630.net>\n---\n git-gui/git-gui.sh | 16 +++++++++++-----\n 1 file changed, 11 insertions(+), 5 deletions(-)\n\ndiff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh\nindex 89f636f..e2e710e 100755\n--- a/git-gui/git-gui.sh\n+++ b/git-gui/git-gui.sh\n@@ -3196,13 +3196,19 @@ unset i\n \n # -- Diff and Commit Area\n #\n-${NS}::frame .vpane.lower -height 300 -width 400\n+${NS}::panedwindow .vpane.lower -orient vertical\n ${NS}::frame .vpane.lower.commarea\n-${NS}::frame .vpane.lower.diff -relief sunken -borderwidth 1\n-pack .vpane.lower.diff -fill both -expand 1\n-pack .vpane.lower.commarea -side bottom -fill x\n+${NS}::frame .vpane.lower.diff -relief sunken -borderwidth 1 -height 500\n+.vpane.lower add .vpane.lower.diff\n+.vpane.lower add .vpane.lower.commarea\n .vpane add .vpane.lower\n-if {!$use_ttk} {.vpane paneconfigure .vpane.lower -sticky nsew}\n+if {$use_ttk} {\n+\t.vpane.lower pane .vpane.lower.diff -weight 1\n+\t.vpane.lower pane .vpane.lower.commarea -weight 0\n+} else {\n+\t.vpane.lower paneconfigure .vpane.lower.diff -stretch always\n+\t.vpane.lower paneconfigure .vpane.lower.commarea -stretch never\n+}\n \n # -- Commit Area Buttons\n #\n-- \n1.8.4.rc3.902.g80a4b9e\n"},{"id":"225984","messageId":"87d2ozqy2a.fsf@fox.patthoyts.tk","threadId":"34736","inReplyTo":"20130821032913.GA6092@wheezy.local","subject":"Re: [PATCH] Add gui.displayuntracked option","fromName":"Pat Thoyts","fromEmail":"patthoyts@users.sourceforge.net","sentAt":"2013-08-27T09:31:57Z","receivedAt":"2013-08-27T09:31:57Z","isPatch":true,"sender":{"key":"patthoyts@users.sourceforge.net","avatar":"https://avatars.githubusercontent.com/u/30739?v=4"},"body":"Max Kirillov <max@max630.net> writes:\n\n>When git is used to track only a subset of a directory, or\n>there is no sure way to divide files to ignore from files to track,\n>git user have to live with large number of untracked files. These files\n>present in file list, and should always be scrolled through\n>to handle real changes. Situation can become even worse, then number\n>of the untracked files grows above the maxfilesdisplayed limit. In the\n>case, even staged can be hidden by git-gui.\n>\n>This change introduces new configuration variable gui.displayuntracked,\n>which, when set to false, instructs git-gui not to show untracked files\n>in files list. They can be staged from commandline or other tools (like\n>IDE of file manager), then they become visible. Default value of the\n>option is true, which is compatible with current behavior.\n>\n>Signed-off-by: Max Kirillov <max@max630.net>\n>---\n>Hi. I've been using git for some time and have collected a\n>number of changes which might worth sharing.\n>Please consider adding them to the upstream.\n>\n>Thanks,\n>Max\n>\n> Documentation/config.txt |  4 ++++\n> git-gui/git-gui.sh       | 14 ++++++++++----\n> git-gui/lib/option.tcl   |  1 +\n> 3 files changed, 15 insertions(+), 4 deletions(-)\n>\n>diff --git a/Documentation/config.txt b/Documentation/config.txt\n>index bbba728..7a786b2 100644\n>--- a/Documentation/config.txt\n>+++ b/Documentation/config.txt\n>@@ -1277,6 +1277,10 @@ gui.diffcontext::\n> \tSpecifies how many context lines should be used in calls to diff\n> \tmade by the linkgit:git-gui[1]. The default is \"5\".\n> \n>+gui.displayuntracked::\n>+\tDetermines if linkgit::git-gui[1] shows untracked files\n>+\tin the file list. The defaulit is \"true\".\n>+\n> gui.encoding::\n> \tSpecifies the default encoding to use for displaying of\n> \tfile contents in linkgit:git-gui[1] and linkgit:gitk[1].\n>diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh\n>index 89f636f..42c35ad 100755\n>--- a/git-gui/git-gui.sh\n>+++ b/git-gui/git-gui.sh\n>@@ -898,6 +898,7 @@ set font_descs {\n> \t{fontdiff font_diff {mc \"Diff/Console Font\"}}\n> }\n> set default_config(gui.stageuntracked) ask\n>+set default_config(gui.displayuntracked) true\n> \n> ######################################################################\n> ##\n>@@ -1536,18 +1537,23 @@ proc rescan_stage2 {fd after} {\n> \tset buf_rdf {}\n> \tset buf_rlo {}\n> \n>-\tset rescan_active 3\n>+\tset rescan_active 2\n> \tui_status [mc \"Scanning for modified files ...\"]\n> \tset fd_di [git_read diff-index --cached -z [PARENT]]\n> \tset fd_df [git_read diff-files -z]\n>-\tset fd_lo [eval git_read ls-files --others -z $ls_others]\n> \n> \tfconfigure $fd_di -blocking 0 -translation binary -encoding binary\n> \tfconfigure $fd_df -blocking 0 -translation binary -encoding binary\n>-\tfconfigure $fd_lo -blocking 0 -translation binary -encoding binary\n>+\n> \tfileevent $fd_di readable [list read_diff_index $fd_di $after]\n> \tfileevent $fd_df readable [list read_diff_files $fd_df $after]\n>-\tfileevent $fd_lo readable [list read_ls_others $fd_lo $after]\n>+\n>+\tif {[is_config_true gui.displayuntracked]} {\n>+\t\tset fd_lo [eval git_read ls-files --others -z $ls_others]\n>+\t\tfconfigure $fd_lo -blocking 0 -translation binary -encoding binary\n>+\t\tfileevent $fd_lo readable [list read_ls_others $fd_lo $after]\n>+\t\tincr rescan_active\n>+\t}\n> }\n> \n> proc load_message {file {encoding {}}} {\n>diff --git a/git-gui/lib/option.tcl b/git-gui/lib/option.tcl\n>index 0cf1da1..2177db6 100644\n>--- a/git-gui/lib/option.tcl\n>+++ b/git-gui/lib/option.tcl\n>@@ -159,6 +159,7 @@ proc do_options {} {\n> \t\t{c gui.encoding {mc \"Default File Contents Encoding\"}}\n> \t\t{b gui.warndetachedcommit {mc \"Warn before committing to a detached head\"}}\n> \t\t{s gui.stageuntracked {mc \"Staging of untracked files\"} {list \"yes\" \"no\" \"ask\"}}\n>+\t\t{b gui.displayuntracked {mc \"Show untracked files\"}}\n> \t\t} {\n> \t\tset type [lindex $option 0]\n> \t\tset name [lindex $option 1]\n\nLooks fine to me. The Documentation part of the patch will need to be\nsent separately to the git project later when this is merged in as\ngit-gui is managed in a separate repository. It also has a typo in\n'default'. I'll make a note to forward this part of the patch at\nrequest-pull time.\n\n-- \nPat Thoyts                            http://www.patthoyts.tk/\nPGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD\n"},{"id":"225985","messageId":"878uznqy0v.fsf@fox.patthoyts.tk","threadId":"34736","inReplyTo":"20130821033822.GB6156@wheezy.local","subject":"Re: [PATCH] git-gui: right half window is paned","fromName":"Pat Thoyts","fromEmail":"patthoyts@users.sourceforge.net","sentAt":"2013-08-27T09:32:48Z","receivedAt":"2013-08-27T09:32:48Z","isPatch":true,"sender":{"key":"patthoyts@users.sourceforge.net","avatar":"https://avatars.githubusercontent.com/u/30739?v=4"},"body":"Max Kirillov <max@max630.net> writes:\n\n>For long descriptions it would be nice to be able to resize\n>the comment text field.\n>\n>Signed-off-by: Max Kirillov <max@max630.net>\n>---\n> git-gui/git-gui.sh | 16 +++++++++++-----\n> 1 file changed, 11 insertions(+), 5 deletions(-)\n>\n>diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh\n>index 89f636f..e2e710e 100755\n>--- a/git-gui/git-gui.sh\n>+++ b/git-gui/git-gui.sh\n>@@ -3196,13 +3196,19 @@ unset i\n> \n> # -- Diff and Commit Area\n> #\n>-${NS}::frame .vpane.lower -height 300 -width 400\n>+${NS}::panedwindow .vpane.lower -orient vertical\n> ${NS}::frame .vpane.lower.commarea\n>-${NS}::frame .vpane.lower.diff -relief sunken -borderwidth 1\n>-pack .vpane.lower.diff -fill both -expand 1\n>-pack .vpane.lower.commarea -side bottom -fill x\n>+${NS}::frame .vpane.lower.diff -relief sunken -borderwidth 1 -height 500\n>+.vpane.lower add .vpane.lower.diff\n>+.vpane.lower add .vpane.lower.commarea\n> .vpane add .vpane.lower\n>-if {!$use_ttk} {.vpane paneconfigure .vpane.lower -sticky nsew}\n>+if {$use_ttk} {\n>+\t.vpane.lower pane .vpane.lower.diff -weight 1\n>+\t.vpane.lower pane .vpane.lower.commarea -weight 0\n>+} else {\n>+\t.vpane.lower paneconfigure .vpane.lower.diff -stretch always\n>+\t.vpane.lower paneconfigure .vpane.lower.commarea -stretch never\n>+}\n> \n> # -- Commit Area Buttons\n> #\n\nAlso fine and applied. Thank you.\n-- \nPat Thoyts                            http://www.patthoyts.tk/\nPGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD\n"}]}