* [PATCH] Add gui.displayuntracked option
@ 2013-08-21 3:29 Max Kirillov
2013-08-21 3:38 ` [PATCH] git-gui: right half window is paned Max Kirillov
2013-08-27 9:31 ` [PATCH] Add gui.displayuntracked option Pat Thoyts
0 siblings, 2 replies; 4+ messages in thread
From: Max Kirillov @ 2013-08-21 3:29 UTC (permalink / raw)
To: Pat Thoyts; +Cc: git
When git is used to track only a subset of a directory, or
there is no sure way to divide files to ignore from files to track,
git user have to live with large number of untracked files. These files
present in file list, and should always be scrolled through
to handle real changes. Situation can become even worse, then number
of the untracked files grows above the maxfilesdisplayed limit. In the
case, even staged can be hidden by git-gui.
This change introduces new configuration variable gui.displayuntracked,
which, when set to false, instructs git-gui not to show untracked files
in files list. They can be staged from commandline or other tools (like
IDE of file manager), then they become visible. Default value of the
option is true, which is compatible with current behavior.
Signed-off-by: Max Kirillov <max@max630.net>
---
Hi. I've been using git for some time and have collected a
number of changes which might worth sharing.
Please consider adding them to the upstream.
Thanks,
Max
Documentation/config.txt | 4 ++++
git-gui/git-gui.sh | 14 ++++++++++----
git-gui/lib/option.tcl | 1 +
3 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index bbba728..7a786b2 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -1277,6 +1277,10 @@ gui.diffcontext::
Specifies how many context lines should be used in calls to diff
made by the linkgit:git-gui[1]. The default is "5".
+gui.displayuntracked::
+ Determines if linkgit::git-gui[1] shows untracked files
+ in the file list. The defaulit is "true".
+
gui.encoding::
Specifies the default encoding to use for displaying of
file contents in linkgit:git-gui[1] and linkgit:gitk[1].
diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index 89f636f..42c35ad 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -898,6 +898,7 @@ set font_descs {
{fontdiff font_diff {mc "Diff/Console Font"}}
}
set default_config(gui.stageuntracked) ask
+set default_config(gui.displayuntracked) true
######################################################################
##
@@ -1536,18 +1537,23 @@ proc rescan_stage2 {fd after} {
set buf_rdf {}
set buf_rlo {}
- set rescan_active 3
+ set rescan_active 2
ui_status [mc "Scanning for modified files ..."]
set fd_di [git_read diff-index --cached -z [PARENT]]
set fd_df [git_read diff-files -z]
- set fd_lo [eval git_read ls-files --others -z $ls_others]
fconfigure $fd_di -blocking 0 -translation binary -encoding binary
fconfigure $fd_df -blocking 0 -translation binary -encoding binary
- fconfigure $fd_lo -blocking 0 -translation binary -encoding binary
+
fileevent $fd_di readable [list read_diff_index $fd_di $after]
fileevent $fd_df readable [list read_diff_files $fd_df $after]
- fileevent $fd_lo readable [list read_ls_others $fd_lo $after]
+
+ if {[is_config_true gui.displayuntracked]} {
+ set fd_lo [eval git_read ls-files --others -z $ls_others]
+ fconfigure $fd_lo -blocking 0 -translation binary -encoding binary
+ fileevent $fd_lo readable [list read_ls_others $fd_lo $after]
+ incr rescan_active
+ }
}
proc load_message {file {encoding {}}} {
diff --git a/git-gui/lib/option.tcl b/git-gui/lib/option.tcl
index 0cf1da1..2177db6 100644
--- a/git-gui/lib/option.tcl
+++ b/git-gui/lib/option.tcl
@@ -159,6 +159,7 @@ proc do_options {} {
{c gui.encoding {mc "Default File Contents Encoding"}}
{b gui.warndetachedcommit {mc "Warn before committing to a detached head"}}
{s gui.stageuntracked {mc "Staging of untracked files"} {list "yes" "no" "ask"}}
+ {b gui.displayuntracked {mc "Show untracked files"}}
} {
set type [lindex $option 0]
set name [lindex $option 1]
--
1.8.4.rc3.902.g80a4b9e
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] git-gui: right half window is paned
2013-08-21 3:29 [PATCH] Add gui.displayuntracked option Max Kirillov
@ 2013-08-21 3:38 ` Max Kirillov
2013-08-27 9:32 ` Pat Thoyts
2013-08-27 9:31 ` [PATCH] Add gui.displayuntracked option Pat Thoyts
1 sibling, 1 reply; 4+ messages in thread
From: Max Kirillov @ 2013-08-21 3:38 UTC (permalink / raw)
To: Pat Thoyts; +Cc: git
For long descriptions it would be nice to be able to resize
the comment text field.
Signed-off-by: Max Kirillov <max@max630.net>
---
git-gui/git-gui.sh | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index 89f636f..e2e710e 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -3196,13 +3196,19 @@ unset i
# -- Diff and Commit Area
#
-${NS}::frame .vpane.lower -height 300 -width 400
+${NS}::panedwindow .vpane.lower -orient vertical
${NS}::frame .vpane.lower.commarea
-${NS}::frame .vpane.lower.diff -relief sunken -borderwidth 1
-pack .vpane.lower.diff -fill both -expand 1
-pack .vpane.lower.commarea -side bottom -fill x
+${NS}::frame .vpane.lower.diff -relief sunken -borderwidth 1 -height 500
+.vpane.lower add .vpane.lower.diff
+.vpane.lower add .vpane.lower.commarea
.vpane add .vpane.lower
-if {!$use_ttk} {.vpane paneconfigure .vpane.lower -sticky nsew}
+if {$use_ttk} {
+ .vpane.lower pane .vpane.lower.diff -weight 1
+ .vpane.lower pane .vpane.lower.commarea -weight 0
+} else {
+ .vpane.lower paneconfigure .vpane.lower.diff -stretch always
+ .vpane.lower paneconfigure .vpane.lower.commarea -stretch never
+}
# -- Commit Area Buttons
#
--
1.8.4.rc3.902.g80a4b9e
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] git-gui: right half window is paned
2013-08-21 3:38 ` [PATCH] git-gui: right half window is paned Max Kirillov
@ 2013-08-27 9:32 ` Pat Thoyts
0 siblings, 0 replies; 4+ messages in thread
From: Pat Thoyts @ 2013-08-27 9:32 UTC (permalink / raw)
To: Max Kirillov; +Cc: git
Max Kirillov <max@max630.net> writes:
>For long descriptions it would be nice to be able to resize
>the comment text field.
>
>Signed-off-by: Max Kirillov <max@max630.net>
>---
> git-gui/git-gui.sh | 16 +++++++++++-----
> 1 file changed, 11 insertions(+), 5 deletions(-)
>
>diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
>index 89f636f..e2e710e 100755
>--- a/git-gui/git-gui.sh
>+++ b/git-gui/git-gui.sh
>@@ -3196,13 +3196,19 @@ unset i
>
> # -- Diff and Commit Area
> #
>-${NS}::frame .vpane.lower -height 300 -width 400
>+${NS}::panedwindow .vpane.lower -orient vertical
> ${NS}::frame .vpane.lower.commarea
>-${NS}::frame .vpane.lower.diff -relief sunken -borderwidth 1
>-pack .vpane.lower.diff -fill both -expand 1
>-pack .vpane.lower.commarea -side bottom -fill x
>+${NS}::frame .vpane.lower.diff -relief sunken -borderwidth 1 -height 500
>+.vpane.lower add .vpane.lower.diff
>+.vpane.lower add .vpane.lower.commarea
> .vpane add .vpane.lower
>-if {!$use_ttk} {.vpane paneconfigure .vpane.lower -sticky nsew}
>+if {$use_ttk} {
>+ .vpane.lower pane .vpane.lower.diff -weight 1
>+ .vpane.lower pane .vpane.lower.commarea -weight 0
>+} else {
>+ .vpane.lower paneconfigure .vpane.lower.diff -stretch always
>+ .vpane.lower paneconfigure .vpane.lower.commarea -stretch never
>+}
>
> # -- Commit Area Buttons
> #
Also fine and applied. Thank you.
--
Pat Thoyts http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97 10 CE 11 E6 04 E0 B9 DD
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Add gui.displayuntracked option
2013-08-21 3:29 [PATCH] Add gui.displayuntracked option Max Kirillov
2013-08-21 3:38 ` [PATCH] git-gui: right half window is paned Max Kirillov
@ 2013-08-27 9:31 ` Pat Thoyts
1 sibling, 0 replies; 4+ messages in thread
From: Pat Thoyts @ 2013-08-27 9:31 UTC (permalink / raw)
To: Max Kirillov; +Cc: git
Max Kirillov <max@max630.net> writes:
>When git is used to track only a subset of a directory, or
>there is no sure way to divide files to ignore from files to track,
>git user have to live with large number of untracked files. These files
>present in file list, and should always be scrolled through
>to handle real changes. Situation can become even worse, then number
>of the untracked files grows above the maxfilesdisplayed limit. In the
>case, even staged can be hidden by git-gui.
>
>This change introduces new configuration variable gui.displayuntracked,
>which, when set to false, instructs git-gui not to show untracked files
>in files list. They can be staged from commandline or other tools (like
>IDE of file manager), then they become visible. Default value of the
>option is true, which is compatible with current behavior.
>
>Signed-off-by: Max Kirillov <max@max630.net>
>---
>Hi. I've been using git for some time and have collected a
>number of changes which might worth sharing.
>Please consider adding them to the upstream.
>
>Thanks,
>Max
>
> Documentation/config.txt | 4 ++++
> git-gui/git-gui.sh | 14 ++++++++++----
> git-gui/lib/option.tcl | 1 +
> 3 files changed, 15 insertions(+), 4 deletions(-)
>
>diff --git a/Documentation/config.txt b/Documentation/config.txt
>index bbba728..7a786b2 100644
>--- a/Documentation/config.txt
>+++ b/Documentation/config.txt
>@@ -1277,6 +1277,10 @@ gui.diffcontext::
> Specifies how many context lines should be used in calls to diff
> made by the linkgit:git-gui[1]. The default is "5".
>
>+gui.displayuntracked::
>+ Determines if linkgit::git-gui[1] shows untracked files
>+ in the file list. The defaulit is "true".
>+
> gui.encoding::
> Specifies the default encoding to use for displaying of
> file contents in linkgit:git-gui[1] and linkgit:gitk[1].
>diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
>index 89f636f..42c35ad 100755
>--- a/git-gui/git-gui.sh
>+++ b/git-gui/git-gui.sh
>@@ -898,6 +898,7 @@ set font_descs {
> {fontdiff font_diff {mc "Diff/Console Font"}}
> }
> set default_config(gui.stageuntracked) ask
>+set default_config(gui.displayuntracked) true
>
> ######################################################################
> ##
>@@ -1536,18 +1537,23 @@ proc rescan_stage2 {fd after} {
> set buf_rdf {}
> set buf_rlo {}
>
>- set rescan_active 3
>+ set rescan_active 2
> ui_status [mc "Scanning for modified files ..."]
> set fd_di [git_read diff-index --cached -z [PARENT]]
> set fd_df [git_read diff-files -z]
>- set fd_lo [eval git_read ls-files --others -z $ls_others]
>
> fconfigure $fd_di -blocking 0 -translation binary -encoding binary
> fconfigure $fd_df -blocking 0 -translation binary -encoding binary
>- fconfigure $fd_lo -blocking 0 -translation binary -encoding binary
>+
> fileevent $fd_di readable [list read_diff_index $fd_di $after]
> fileevent $fd_df readable [list read_diff_files $fd_df $after]
>- fileevent $fd_lo readable [list read_ls_others $fd_lo $after]
>+
>+ if {[is_config_true gui.displayuntracked]} {
>+ set fd_lo [eval git_read ls-files --others -z $ls_others]
>+ fconfigure $fd_lo -blocking 0 -translation binary -encoding binary
>+ fileevent $fd_lo readable [list read_ls_others $fd_lo $after]
>+ incr rescan_active
>+ }
> }
>
> proc load_message {file {encoding {}}} {
>diff --git a/git-gui/lib/option.tcl b/git-gui/lib/option.tcl
>index 0cf1da1..2177db6 100644
>--- a/git-gui/lib/option.tcl
>+++ b/git-gui/lib/option.tcl
>@@ -159,6 +159,7 @@ proc do_options {} {
> {c gui.encoding {mc "Default File Contents Encoding"}}
> {b gui.warndetachedcommit {mc "Warn before committing to a detached head"}}
> {s gui.stageuntracked {mc "Staging of untracked files"} {list "yes" "no" "ask"}}
>+ {b gui.displayuntracked {mc "Show untracked files"}}
> } {
> set type [lindex $option 0]
> set name [lindex $option 1]
Looks fine to me. The Documentation part of the patch will need to be
sent separately to the git project later when this is merged in as
git-gui is managed in a separate repository. It also has a typo in
'default'. I'll make a note to forward this part of the patch at
request-pull time.
--
Pat Thoyts http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97 10 CE 11 E6 04 E0 B9 DD
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-08-27 9:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-21 3:29 [PATCH] Add gui.displayuntracked option Max Kirillov
2013-08-21 3:38 ` [PATCH] git-gui: right half window is paned Max Kirillov
2013-08-27 9:32 ` Pat Thoyts
2013-08-27 9:31 ` [PATCH] Add gui.displayuntracked option Pat Thoyts
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).