Re: [RFC PATCH 2/2] gitk: Show the rev(s) the user specified on the command line in the window title.
On Tue, Jan 06, 2015 at 12:52:00PM -0500, Marc Branchaud wrote: > Signed-off-by: Marc Branchaud > --- > > I often open multiple gitk windows in the same working directory to examine > other branches or refs in the repo. This change allows me to distinguish > which window is showing what. > > This is an RFC because it doesn't behave great with views. I don't use views > at all, so this doesn't bother me. I'm not too sure what should be displayed > if the user changes views -- probably the view name, but I'm not sure how to > get a that in the code. The view name is in $viewname($curview). If that is "Command line" you probably want to show some selected command line arguments. Using $vrevs($curview) seems about right, though it will contain "--gitk-symmetric-diff-marker" in some situations, which is an internal thing that we don't want to show externally. You should probably filter it out. The patch will need a proper description before I can apply it, of course. Paul. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/2] gitk: Show the rev(s) the user specified on the command line in the window title.
Signed-off-by: Marc Branchaud --- I often open multiple gitk windows in the same working directory to examine other branches or refs in the repo. This change allows me to distinguish which window is showing what. M. gitk | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gitk b/gitk index b859879..379b13a 100755 --- a/gitk +++ b/gitk @@ -488,7 +488,7 @@ proc reset_pending_select {selid} { } proc getcommits {selid} { -global canv curview need_redisplay viewactive +global appname canv curview need_redisplay viewactive vrevs initlayout if {[start_rev_list $curview]} { @@ -498,6 +498,11 @@ proc getcommits {selid} { } else { show_status [mc "No commits selected"] } +set rev "$vrevs($curview)" +if {$rev eq ""} { + set rev "HEAD" +} +wm title . "[reponame]: $rev - $appname" } proc updatecommits {} { -- 2.3.3 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC PATCH 2/2] gitk: Show the rev(s) the user specified on the command line in the window title.
Signed-off-by: Marc Branchaud --- I often open multiple gitk windows in the same working directory to examine other branches or refs in the repo. This change allows me to distinguish which window is showing what. This is an RFC because it doesn't behave great with views. I don't use views at all, so this doesn't bother me. I'm not too sure what should be displayed if the user changes views -- probably the view name, but I'm not sure how to get a that in the code. M. gitk | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gitk b/gitk index 03de545..b8463fd 100755 --- a/gitk +++ b/gitk @@ -488,7 +488,7 @@ proc reset_pending_select {selid} { } proc getcommits {selid} { -global canv curview need_redisplay viewactive +global appname canv curview need_redisplay viewactive vrevs initlayout if {[start_rev_list $curview]} { @@ -498,6 +498,11 @@ proc getcommits {selid} { } else { show_status [mc "No commits selected"] } +set rev "$vrevs($curview)" +if {$rev eq ""} { + set rev "HEAD" +} +wm title . "[reponame]: $rev - $appname" } proc updatecommits {} { -- 2.2.1 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html