# [PATCH] gitk: Ensure that "Reset branch" menu entry is enabled

2 messages from 2008-12-03 to 2008-12-18. Participants: Johannes Sixt.
Thread: https://gitlist.dev/t/16578

## Johannes Sixt, 2008-12-03 12:43

Subject: [PATCH] gitk: Ensure that "Reset branch" menu entry is enabled
Message-ID: <1228308200-28693-1-git-send-email-j6t@kdbg.org>
URL: https://gitlist.dev/e/1228308200-28693-1-git-send-email-j6t%40kdbg.org

```
Consider this sequence of events:

1. Detach HEAD and fire up gitk
2. Call the context menu on some commit. Notice that the last menu entry
   says "Detached HEAD: can't reset" and it is disabled.
3. Now checkout some regular branch (e.g. 'master') using the context menu.
4. Call the context menu again on some commit.

Previously, at this point the last menu entry said "Reset master branch
to here", but it was still disabled. With this fix it is now enabled again.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 gitk |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gitk b/gitk
index f7f1776..6c4022a 100755
--- a/gitk
+++ b/gitk
@@ -7950,7 +7950,7 @@ proc rowmenu {x y id} {
     if {$id ne $nullid && $id ne $nullid2} {
 	set menu $rowctxmenu
 	if {$mainhead ne {}} {
-	    $menu entryconfigure 7 -label [mc "Reset %s branch to here" $mainhead]
+	    $menu entryconfigure 7 -label [mc "Reset %s branch to here" $mainhead] -state normal
 	} else {
 	    $menu entryconfigure 7 -label [mc "Detached head: can't reset" $mainhead] -state disabled
 	}
-- 
1.6.1.rc1

```

## Johannes Sixt, 2008-12-18 10:42

Subject: Re: [PATCH] gitk: Ensure that "Reset branch" menu entry is enabled
Message-ID: <494A2916.6010405@viscovery.net>
URL: https://gitlist.dev/e/494A2916.6010405%40viscovery.net
In-Reply-To: <1228308200-28693-1-git-send-email-j6t@kdbg.org>

```
Johannes Sixt schrieb:
> Consider this sequence of events:
> 
> 1. Detach HEAD and fire up gitk
> 2. Call the context menu on some commit. Notice that the last menu entry
>    says "Detached HEAD: can't reset" and it is disabled.
> 3. Now checkout some regular branch (e.g. 'master') using the context menu.
> 4. Call the context menu again on some commit.
> 
> Previously, at this point the last menu entry said "Reset master branch
> to here", but it was still disabled. With this fix it is now enabled again.

Did you consider this patch?

-- Hannes

> 
> Signed-off-by: Johannes Sixt <j6t@kdbg.org>
> ---
>  gitk |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/gitk b/gitk
> index f7f1776..6c4022a 100755
> --- a/gitk
> +++ b/gitk
> @@ -7950,7 +7950,7 @@ proc rowmenu {x y id} {
>      if {$id ne $nullid && $id ne $nullid2} {
>  	set menu $rowctxmenu
>  	if {$mainhead ne {}} {
> -	    $menu entryconfigure 7 -label [mc "Reset %s branch to here" $mainhead]
> +	    $menu entryconfigure 7 -label [mc "Reset %s branch to here" $mainhead] -state normal
>  	} else {
>  	    $menu entryconfigure 7 -label [mc "Detached head: can't reset" $mainhead] -state disabled
>  	}

```
