Re: [PATCH 2/6] Add ability to follow a remote branch with a dialog

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 15, 2016 at 09:58:43PM +1030, Pierre Dumuid wrote:
> A suggested name is provided when creating a new "following" branch.
> 
> Signed-off-by: Pierre Dumuid <pmdumuid@xxxxxxxxx>
> ---
>  gitk | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----
>  1 file changed, 82 insertions(+), 4 deletions(-)
> 
> diff --git a/gitk b/gitk
> index 50d1ef4..36cba49 100755
> --- a/gitk
> +++ b/gitk
> @@ -2673,6 +2673,7 @@ proc makewindow {} {
>  	{mc "Rename this branch" command mvbranch}
>  	{mc "Remove this branch" command rmbranch}
>  	{mc "Copy branch name" command {clipboard clear; clipboard append $headmenuhead}}
> +	{mc "Follow this branch"  command follow_remote_branch_dialog}
>      }
>      $headctxmenu configure -tearoff 0
>  
> @@ -9947,23 +9948,100 @@ proc headmenu {x y id head} {
>      stopfinding
>      set headmenuid $id
>      set headmenuhead $head
> -    array set state {0 normal 1 normal 2 normal}
> +    array set state {0 normal 1 normal 2 normal 3 normal}
>      if {[string match "remotes/*" $head]} {
>  	set localhead [string range $head [expr [string last / $head] + 1] end]
>  	if {[info exists headids($localhead)]} {
>  	    set state(0) disabled
>  	}
> -	array set state {1 disabled 2 disabled}
> +	array set state {1 disabled 2 disabled 3 normal}

You set array(3) to "normal" just above, no need to do it again.

>      }
>      if {$head eq $mainhead} {
> -	array set state {0 disabled 2 disabled}
> +	array set state {0 disabled 2 disabled 3 disabled}
> +    } else {
> +	set state(3) disabled
>      }

As far as I can see, this will always end up with state(3) set to
"disabled", won't it?  Is that really what you want?

Paul.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]