All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] git-gui: fix inability to quit after closing another instance
@ 2023-02-01  8:26 Orgad Shaneh via GitGitGadget
  2023-02-01 17:22 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Orgad Shaneh via GitGitGadget @ 2023-02-01  8:26 UTC (permalink / raw)
  To: git; +Cc: Orgad Shaneh, Orgad Shaneh

From: Orgad Shaneh <orgads@gmail.com>

If you open 2 git gui instances in the same directory, then close one
of them and try to close the other, an error message pops up, saying:
'error renaming ".git/GITGUI_BCK": no such file or directory', and it
is no longer possible to close the window ever.

Fix by catching this error, and proceeding even if the file no longer
exists.

Signed-off-by: Orgad Shaneh <orgads@gmail.com>
---
    git-gui: fix inability to quit after closing another instance
    
    If you open 2 git gui instances in the same directory, then close one of
    them and try to close the other, an error message pops up, saying:
    'error renaming ".git/GITGUI_BCK": no such file or directory', and it is
    no longer possible to close the window ever.
    
    Fix by catching this error, and proceeding even if the file no longer
    exists.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1446%2Forgads%2Fgit-gui-no-quit-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1446/orgads/git-gui-no-quit-v1
Pull-Request: https://github.com/git/git/pull/1446

 git-gui/git-gui.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index 201524c34ed..b00ee691e3b 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -2307,7 +2307,7 @@ proc do_quit {{rc {1}}} {
 		#
 		set save [gitdir GITGUI_MSG]
 		if {$GITGUI_BCK_exists && ![$ui_comm edit modified]} {
-			file rename -force [gitdir GITGUI_BCK] $save
+			catch { file rename -force [gitdir GITGUI_BCK] $save }
 			set GITGUI_BCK_exists 0
 		} elseif {[$ui_comm edit modified]} {
 			set msg [string trim [$ui_comm get 0.0 end]]

base-commit: 2fc9e9ca3c7505bc60069f11e7ef09b1aeeee473
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] git-gui: fix inability to quit after closing another instance
  2023-02-01  8:26 [PATCH] git-gui: fix inability to quit after closing another instance Orgad Shaneh via GitGitGadget
@ 2023-02-01 17:22 ` Junio C Hamano
  2024-04-20 21:58   ` Orgad Shaneh
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2023-02-01 17:22 UTC (permalink / raw)
  To: Pratyush Yadav; +Cc: git, Orgad Shaneh, Orgad Shaneh via GitGitGadget

Orgad, thanks for a patch.
Yadav, this came to git@vger.kernel.org, so I'm forwarding.

cf. Documentation/SubmittingPatches

    == Subsystems with dedicated maintainers

    Some parts of the system have dedicated maintainers with their own
    repositories.

    - `git-gui/` comes from git-gui project, maintained by Pratyush Yadav:

            https://github.com/prati0100/git-gui.git

"Orgad Shaneh via GitGitGadget" <gitgitgadget@gmail.com> writes:

> From: Orgad Shaneh <orgads@gmail.com>
>
> If you open 2 git gui instances in the same directory, then close one
> of them and try to close the other, an error message pops up, saying:
> 'error renaming ".git/GITGUI_BCK": no such file or directory', and it
> is no longer possible to close the window ever.
>
> Fix by catching this error, and proceeding even if the file no longer
> exists.
>
> Signed-off-by: Orgad Shaneh <orgads@gmail.com>
> ---
>     git-gui: fix inability to quit after closing another instance
>     
>     If you open 2 git gui instances in the same directory, then close one of
>     them and try to close the other, an error message pops up, saying:
>     'error renaming ".git/GITGUI_BCK": no such file or directory', and it is
>     no longer possible to close the window ever.
>     
>     Fix by catching this error, and proceeding even if the file no longer
>     exists.
>
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1446%2Forgads%2Fgit-gui-no-quit-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1446/orgads/git-gui-no-quit-v1
> Pull-Request: https://github.com/git/git/pull/1446
>
>  git-gui/git-gui.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
> index 201524c34ed..b00ee691e3b 100755
> --- a/git-gui/git-gui.sh
> +++ b/git-gui/git-gui.sh
> @@ -2307,7 +2307,7 @@ proc do_quit {{rc {1}}} {
>  		#
>  		set save [gitdir GITGUI_MSG]
>  		if {$GITGUI_BCK_exists && ![$ui_comm edit modified]} {
> -			file rename -force [gitdir GITGUI_BCK] $save
> +			catch { file rename -force [gitdir GITGUI_BCK] $save }
>  			set GITGUI_BCK_exists 0
>  		} elseif {[$ui_comm edit modified]} {
>  			set msg [string trim [$ui_comm get 0.0 end]]
>
> base-commit: 2fc9e9ca3c7505bc60069f11e7ef09b1aeeee473

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] git-gui: fix inability to quit after closing another instance
  2023-02-01 17:22 ` Junio C Hamano
@ 2024-04-20 21:58   ` Orgad Shaneh
  0 siblings, 0 replies; 3+ messages in thread
From: Orgad Shaneh @ 2024-04-20 21:58 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Pratyush Yadav, git, Orgad Shaneh via GitGitGadget

Hi Junio/Yadav,

It's been more than a year since I opened a PR to git-gui upstream
(https://github.com/prati0100/git-gui/pull/91). I pinged several
times, but it looks like nobody's home.

Is it possible to accept it to git nevertheless? This is an annoying
issue, and the fix is trivial.

Thanks!

- Orgad


On Wed, Feb 1, 2023 at 7:22 PM Junio C Hamano <gitster@pobox.com> wrote:
>
> Orgad, thanks for a patch.
> Yadav, this came to git@vger.kernel.org, so I'm forwarding.
>
> cf. Documentation/SubmittingPatches
>
>     == Subsystems with dedicated maintainers
>
>     Some parts of the system have dedicated maintainers with their own
>     repositories.
>
>     - `git-gui/` comes from git-gui project, maintained by Pratyush Yadav:
>
>             https://github.com/prati0100/git-gui.git
>
> "Orgad Shaneh via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
> > From: Orgad Shaneh <orgads@gmail.com>
> >
> > If you open 2 git gui instances in the same directory, then close one
> > of them and try to close the other, an error message pops up, saying:
> > 'error renaming ".git/GITGUI_BCK": no such file or directory', and it
> > is no longer possible to close the window ever.
> >
> > Fix by catching this error, and proceeding even if the file no longer
> > exists.
> >
> > Signed-off-by: Orgad Shaneh <orgads@gmail.com>
> > ---
> >     git-gui: fix inability to quit after closing another instance
> >
> >     If you open 2 git gui instances in the same directory, then close one of
> >     them and try to close the other, an error message pops up, saying:
> >     'error renaming ".git/GITGUI_BCK": no such file or directory', and it is
> >     no longer possible to close the window ever.
> >
> >     Fix by catching this error, and proceeding even if the file no longer
> >     exists.
> >
> > Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1446%2Forgads%2Fgit-gui-no-quit-v1
> > Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1446/orgads/git-gui-no-quit-v1
> > Pull-Request: https://github.com/git/git/pull/1446
> >
> >  git-gui/git-gui.sh | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
> > index 201524c34ed..b00ee691e3b 100755
> > --- a/git-gui/git-gui.sh
> > +++ b/git-gui/git-gui.sh
> > @@ -2307,7 +2307,7 @@ proc do_quit {{rc {1}}} {
> >               #
> >               set save [gitdir GITGUI_MSG]
> >               if {$GITGUI_BCK_exists && ![$ui_comm edit modified]} {
> > -                     file rename -force [gitdir GITGUI_BCK] $save
> > +                     catch { file rename -force [gitdir GITGUI_BCK] $save }
> >                       set GITGUI_BCK_exists 0
> >               } elseif {[$ui_comm edit modified]} {
> >                       set msg [string trim [$ui_comm get 0.0 end]]
> >
> > base-commit: 2fc9e9ca3c7505bc60069f11e7ef09b1aeeee473

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-04-20 21:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-01  8:26 [PATCH] git-gui: fix inability to quit after closing another instance Orgad Shaneh via GitGitGadget
2023-02-01 17:22 ` Junio C Hamano
2024-04-20 21:58   ` Orgad Shaneh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.