{"thread":{"id":"59171","subject":"[PATCH] git-gui: fix inability to quit after closing another instance","startedAt":"2023-02-01T08:26:14Z","lastAt":"2024-04-20T21:58:31Z","messageCount":3,"participants":["Orgad Shaneh via GitGitGadget","Junio C Hamano","Orgad Shaneh"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"471217","messageId":"pull.1446.git.git.1675239967804.gitgitgadget@gmail.com","threadId":"59171","inReplyTo":null,"subject":"[PATCH] git-gui: fix inability to quit after closing another instance","fromName":"Orgad Shaneh via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2023-02-01T08:26:07Z","receivedAt":"2023-02-01T08:26:14Z","isPatch":true,"sender":{"key":"orgads@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1246544?v=4"},"body":"From: Orgad Shaneh <orgads@gmail.com>\n\nIf you open 2 git gui instances in the same directory, then close one\nof them and try to close the other, an error message pops up, saying:\n'error renaming \".git/GITGUI_BCK\": no such file or directory', and it\nis no longer possible to close the window ever.\n\nFix by catching this error, and proceeding even if the file no longer\nexists.\n\nSigned-off-by: Orgad Shaneh <orgads@gmail.com>\n---\n    git-gui: fix inability to quit after closing another instance\n    \n    If you open 2 git gui instances in the same directory, then close one of\n    them and try to close the other, an error message pops up, saying:\n    'error renaming \".git/GITGUI_BCK\": no such file or directory', and it is\n    no longer possible to close the window ever.\n    \n    Fix by catching this error, and proceeding even if the file no longer\n    exists.\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1446%2Forgads%2Fgit-gui-no-quit-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1446/orgads/git-gui-no-quit-v1\nPull-Request: https://github.com/git/git/pull/1446\n\n git-gui/git-gui.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh\nindex 201524c34ed..b00ee691e3b 100755\n--- a/git-gui/git-gui.sh\n+++ b/git-gui/git-gui.sh\n@@ -2307,7 +2307,7 @@ proc do_quit {{rc {1}}} {\n \t\t#\n \t\tset save [gitdir GITGUI_MSG]\n \t\tif {$GITGUI_BCK_exists && ![$ui_comm edit modified]} {\n-\t\t\tfile rename -force [gitdir GITGUI_BCK] $save\n+\t\t\tcatch { file rename -force [gitdir GITGUI_BCK] $save }\n \t\t\tset GITGUI_BCK_exists 0\n \t\t} elseif {[$ui_comm edit modified]} {\n \t\t\tset msg [string trim [$ui_comm get 0.0 end]]\n\nbase-commit: 2fc9e9ca3c7505bc60069f11e7ef09b1aeeee473\n-- \ngitgitgadget\n"},{"id":"471254","messageId":"xmqqy1ph1esd.fsf@gitster.g","threadId":"59171","inReplyTo":"pull.1446.git.git.1675239967804.gitgitgadget@gmail.com","subject":"Re: [PATCH] git-gui: fix inability to quit after closing another instance","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2023-02-01T17:22:42Z","receivedAt":"2023-02-01T17:22:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Orgad, thanks for a patch.\nYadav, this came to git@vger.kernel.org, so I'm forwarding.\n\ncf. Documentation/SubmittingPatches\n\n    == Subsystems with dedicated maintainers\n\n    Some parts of the system have dedicated maintainers with their own\n    repositories.\n\n    - `git-gui/` comes from git-gui project, maintained by Pratyush Yadav:\n\n            https://github.com/prati0100/git-gui.git\n\n\"Orgad Shaneh via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> From: Orgad Shaneh <orgads@gmail.com>\n>\n> If you open 2 git gui instances in the same directory, then close one\n> of them and try to close the other, an error message pops up, saying:\n> 'error renaming \".git/GITGUI_BCK\": no such file or directory', and it\n> is no longer possible to close the window ever.\n>\n> Fix by catching this error, and proceeding even if the file no longer\n> exists.\n>\n> Signed-off-by: Orgad Shaneh <orgads@gmail.com>\n> ---\n>     git-gui: fix inability to quit after closing another instance\n>     \n>     If you open 2 git gui instances in the same directory, then close one of\n>     them and try to close the other, an error message pops up, saying:\n>     'error renaming \".git/GITGUI_BCK\": no such file or directory', and it is\n>     no longer possible to close the window ever.\n>     \n>     Fix by catching this error, and proceeding even if the file no longer\n>     exists.\n>\n> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1446%2Forgads%2Fgit-gui-no-quit-v1\n> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1446/orgads/git-gui-no-quit-v1\n> Pull-Request: https://github.com/git/git/pull/1446\n>\n>  git-gui/git-gui.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh\n> index 201524c34ed..b00ee691e3b 100755\n> --- a/git-gui/git-gui.sh\n> +++ b/git-gui/git-gui.sh\n> @@ -2307,7 +2307,7 @@ proc do_quit {{rc {1}}} {\n>  \t\t#\n>  \t\tset save [gitdir GITGUI_MSG]\n>  \t\tif {$GITGUI_BCK_exists && ![$ui_comm edit modified]} {\n> -\t\t\tfile rename -force [gitdir GITGUI_BCK] $save\n> +\t\t\tcatch { file rename -force [gitdir GITGUI_BCK] $save }\n>  \t\t\tset GITGUI_BCK_exists 0\n>  \t\t} elseif {[$ui_comm edit modified]} {\n>  \t\t\tset msg [string trim [$ui_comm get 0.0 end]]\n>\n> base-commit: 2fc9e9ca3c7505bc60069f11e7ef09b1aeeee473\n"},{"id":"493253","messageId":"CAGHpTBKy9ABmHk32yKsj1C9d=OLZqSU8=ApduvpmyWqSAUjMQA@mail.gmail.com","threadId":"59171","inReplyTo":"xmqqy1ph1esd.fsf@gitster.g","subject":"Re: [PATCH] git-gui: fix inability to quit after closing another instance","fromName":"Orgad Shaneh","fromEmail":"orgads@gmail.com","sentAt":"2024-04-20T21:58:18Z","receivedAt":"2024-04-20T21:58:31Z","isPatch":true,"sender":{"key":"orgads@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1246544?v=4"},"body":"Hi Junio/Yadav,\n\nIt's been more than a year since I opened a PR to git-gui upstream\n(https://github.com/prati0100/git-gui/pull/91). I pinged several\ntimes, but it looks like nobody's home.\n\nIs it possible to accept it to git nevertheless? This is an annoying\nissue, and the fix is trivial.\n\nThanks!\n\n- Orgad\n\n\nOn Wed, Feb 1, 2023 at 7:22 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Orgad, thanks for a patch.\n> Yadav, this came to git@vger.kernel.org, so I'm forwarding.\n>\n> cf. Documentation/SubmittingPatches\n>\n>     == Subsystems with dedicated maintainers\n>\n>     Some parts of the system have dedicated maintainers with their own\n>     repositories.\n>\n>     - `git-gui/` comes from git-gui project, maintained by Pratyush Yadav:\n>\n>             https://github.com/prati0100/git-gui.git\n>\n> \"Orgad Shaneh via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n>\n> > From: Orgad Shaneh <orgads@gmail.com>\n> >\n> > If you open 2 git gui instances in the same directory, then close one\n> > of them and try to close the other, an error message pops up, saying:\n> > 'error renaming \".git/GITGUI_BCK\": no such file or directory', and it\n> > is no longer possible to close the window ever.\n> >\n> > Fix by catching this error, and proceeding even if the file no longer\n> > exists.\n> >\n> > Signed-off-by: Orgad Shaneh <orgads@gmail.com>\n> > ---\n> >     git-gui: fix inability to quit after closing another instance\n> >\n> >     If you open 2 git gui instances in the same directory, then close one of\n> >     them and try to close the other, an error message pops up, saying:\n> >     'error renaming \".git/GITGUI_BCK\": no such file or directory', and it is\n> >     no longer possible to close the window ever.\n> >\n> >     Fix by catching this error, and proceeding even if the file no longer\n> >     exists.\n> >\n> > Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1446%2Forgads%2Fgit-gui-no-quit-v1\n> > Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1446/orgads/git-gui-no-quit-v1\n> > Pull-Request: https://github.com/git/git/pull/1446\n> >\n> >  git-gui/git-gui.sh | 2 +-\n> >  1 file changed, 1 insertion(+), 1 deletion(-)\n> >\n> > diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh\n> > index 201524c34ed..b00ee691e3b 100755\n> > --- a/git-gui/git-gui.sh\n> > +++ b/git-gui/git-gui.sh\n> > @@ -2307,7 +2307,7 @@ proc do_quit {{rc {1}}} {\n> >               #\n> >               set save [gitdir GITGUI_MSG]\n> >               if {$GITGUI_BCK_exists && ![$ui_comm edit modified]} {\n> > -                     file rename -force [gitdir GITGUI_BCK] $save\n> > +                     catch { file rename -force [gitdir GITGUI_BCK] $save }\n> >                       set GITGUI_BCK_exists 0\n> >               } elseif {[$ui_comm edit modified]} {\n> >                       set msg [string trim [$ui_comm get 0.0 end]]\n> >\n> > base-commit: 2fc9e9ca3c7505bc60069f11e7ef09b1aeeee473\n"}]}