{"thread":{"id":"22752","subject":"[BUG] git gui blame: Show History Context broken since 29e5573d","startedAt":"2010-02-22T08:27:00Z","lastAt":"2010-02-23T21:30:38Z","messageCount":9,"participants":["Matthieu Moy","Giuseppe Bilotta","Heiko Voigt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"135280","messageId":"vpqaav1llpn.fsf@bauges.imag.fr","threadId":"22752","inReplyTo":null,"subject":"[BUG] git gui blame: Show History Context broken since 29e5573d","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2010-02-22T08:27:00Z","receivedAt":"2010-02-22T08:27:00Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Hi,\n\nIn \"git gui blame\", right-clicking on the left fringe and chosing\n\"Show History Context\" in the context-menu doesn't work for me in the\nlatest git. It says:\n\ncouldn't change working directory to \"\": no such file or directory\ncouldn't change working directory to \"\": no such file or directory\n    while executing\n\"cd $_gitworktree\"\n    (procedure \"do_gitk\" line 25)\n    invoked from within\n\"do_gitk $cmdline\"\n    (procedure \"blame::_gitkcommit\" line 47)\n    invoked from within\n\"blame::_gitkcommit ::blame::__o1::__d\"\n    invoked from within\n\".ctxm invoke active\"\n    (\"uplevel\" body line 1)\n    invoked from within\n\"uplevel #0 [list $w invoke active]\"\n    (procedure \"tk::MenuInvoke\" line 50)\n    invoked from within\n\"tk::MenuInvoke .ctxm 1\"\n    (command bound to event)\n\nGit bisect shows me the guilty commit:\n\ncommit 29e5573d1ef67c92314c39e55d26504fee119c04\nAuthor: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>\nDate:   Sat Jan 23 11:03:35 2010 +0100\n\n    git-gui: handle bare repos correctly\n    \n    Refactor checking for a bare repository into its own proc, that relies\n    on git rev-parse --is-bare-repository if possible. For older versions of\n    git we fall back to a logic such that the repository is considered bare\n    if:\n     * either the core.bare setting is true\n     * or the worktree is not set and the directory name ends with .git\n    The error message for the case of an unhandled bare repository is also\n    updated to reflect the fact that the problem is not the funny name but\n    the bareness.\n    \n    The new refactored proc is also used to disable the menu entry to\n    explore the working copy, and to skip changing to the worktree before\n    the gitk invocation.\n    \n    Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>\n    Signed-off-by: Shawn O. Pearce <spearce@spearce.org>\n\nThis is in a non-bare repo.\n\nAnyone to fix this?\n\nThanks,\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"135315","messageId":"cb7bb73a1002220718p6b6621der6df062cd2f490d89@mail.gmail.com","threadId":"22752","inReplyTo":"vpqaav1llpn.fsf@bauges.imag.fr","subject":"Re: [BUG] git gui blame: Show History Context broken since 29e5573d","fromName":"Giuseppe Bilotta","fromEmail":"giuseppe.bilotta@gmail.com","sentAt":"2010-02-22T15:18:11Z","receivedAt":"2010-02-22T15:18:11Z","isPatch":false,"sender":{"key":"giuseppe.bilotta@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1464?v=4"},"body":"On Mon, Feb 22, 2010 at 9:27 AM, Matthieu Moy\n<Matthieu.Moy@grenoble-inp.fr> wrote:\n> Hi,\n>\n> In \"git gui blame\", right-clicking on the left fringe and chosing\n> \"Show History Context\" in the context-menu doesn't work for me in the\n> latest git. It says:\n>\n> couldn't change working directory to \"\": no such file or directory\n\nDefinitely my fault. _gitworktree was not being set up correctly when\nsupport for bare repositories was enabled and the repo was not bare\n(like in the blame case). Patch incoming, can you see if it does the\njob for you? It seems to fix it here.\n\n-- \nGiuseppe \"Oblomov\" Bilotta\n"},{"id":"135316","messageId":"1266851964-13044-1-git-send-email-giuseppe.bilotta@gmail.com","threadId":"22752","inReplyTo":"vpqaav1llpn.fsf@bauges.imag.fr","subject":"[PATCH] git-gui: fix worktree initialization with empty prefix","fromName":"Giuseppe Bilotta","fromEmail":"giuseppe.bilotta@gmail.com","sentAt":"2010-02-22T15:19:24Z","receivedAt":"2010-02-22T15:19:24Z","isPatch":true,"sender":{"key":"giuseppe.bilotta@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1464?v=4"},"body":"This is sort of a chicken-and-egg problem, because we should only\nbother setting the worktree if we are not in a bare repository, but\nan unset worktree is one of the conditions we check to see if we have\na bare repository.\n\nMaintain the same sequence of checks, but swap the check for bareness\nsupport and bareness of repository, and check again for an unset\nworktree if we are not in the bare case.\n---\n git-gui/git-gui.sh |    5 +++--\n 1 files changed, 3 insertions(+), 2 deletions(-)\n\ndiff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh\nindex 7d54511..d9e1598 100755\n--- a/git-gui/git-gui.sh\n+++ b/git-gui/git-gui.sh\n@@ -1169,12 +1169,13 @@ if {$_prefix ne {}} {\n \t}\n \tset _gitworktree [pwd]\n \tunset cdup\n-} elseif {![is_enabled bare]} {\n-\tif {[is_bare]} {\n+} elseif {[is_bare]} {\n+\tif {![is_enabled bare]} {\n \t\tcatch {wm withdraw .}\n \t\terror_popup [strcat [mc \"Cannot use bare repository:\"] \"\\n\\n$_gitdir\"]\n \t\texit 1\n \t}\n+} else {\n \tif {$_gitworktree eq {}} {\n \t\tset _gitworktree [file dirname $_gitdir]\n \t}\n-- \n1.7.0.198.g1e558.dirty\n"},{"id":"135318","messageId":"vpqsk8t1e1g.fsf@bauges.imag.fr","threadId":"22752","inReplyTo":"1266851964-13044-1-git-send-email-giuseppe.bilotta@gmail.com","subject":"Re: [PATCH] git-gui: fix worktree initialization with empty prefix","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2010-02-22T15:32:59Z","receivedAt":"2010-02-22T15:32:59Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Giuseppe Bilotta <giuseppe.bilotta@gmail.com> writes:\n\n> This is sort of a chicken-and-egg problem, because we should only\n> bother setting the worktree if we are not in a bare repository, but\n> an unset worktree is one of the conditions we check to see if we have\n> a bare repository.\n>\n> Maintain the same sequence of checks, but swap the check for bareness\n> support and bareness of repository, and check again for an unset\n> worktree if we are not in the bare case.\n\nTested-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n\n(don't forget Signed-off-by)\n\nThanks,\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"135319","messageId":"cb7bb73a1002220739j1eaae417je9358458f653ef7e@mail.gmail.com","threadId":"22752","inReplyTo":"vpqsk8t1e1g.fsf@bauges.imag.fr","subject":"Re: [PATCH] git-gui: fix worktree initialization with empty prefix","fromName":"Giuseppe Bilotta","fromEmail":"giuseppe.bilotta@gmail.com","sentAt":"2010-02-22T15:39:45Z","receivedAt":"2010-02-22T15:39:45Z","isPatch":true,"sender":{"key":"giuseppe.bilotta@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1464?v=4"},"body":"On Mon, Feb 22, 2010 at 4:32 PM, Matthieu Moy\n<Matthieu.Moy@grenoble-inp.fr> wrote:\n> Giuseppe Bilotta <giuseppe.bilotta@gmail.com> writes:\n>\n>> This is sort of a chicken-and-egg problem, because we should only\n>> bother setting the worktree if we are not in a bare repository, but\n>> an unset worktree is one of the conditions we check to see if we have\n>> a bare repository.\n>>\n>> Maintain the same sequence of checks, but swap the check for bareness\n>> support and bareness of repository, and check again for an unset\n>> worktree if we are not in the bare case.\n\nSigned-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>\n\n>\n> Tested-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n>\n> (don't forget Signed-off-by)\n\nDamn. Thanks. I just set format.signoff so I won't forget again.\n\n> Thanks,\n\nThank you for spotting and testing this.\n\n-- \nGiuseppe \"Oblomov\" Bilotta\n"},{"id":"135358","messageId":"20100222223802.GA9898@book.hvoigt.net","threadId":"22752","inReplyTo":"cb7bb73a1002220718p6b6621der6df062cd2f490d89@mail.gmail.com","subject":"Re: Re: [BUG] git gui blame: Show History Context broken since 29e5573d","fromName":"Heiko Voigt","fromEmail":"hvoigt@hvoigt.net","sentAt":"2010-02-22T22:38:44Z","receivedAt":"2010-02-22T22:38:44Z","isPatch":false,"sender":{"key":"hvoigt@hvoigt.net","avatar":"https://avatars.githubusercontent.com/u/184958?v=4"},"body":"On Mon, Feb 22, 2010 at 04:18:11PM +0100, Giuseppe Bilotta wrote:\n> On Mon, Feb 22, 2010 at 9:27 AM, Matthieu Moy\n> <Matthieu.Moy@grenoble-inp.fr> wrote:\n> > Hi,\n> >\n> > In \"git gui blame\", right-clicking on the left fringe and chosing\n> > \"Show History Context\" in the context-menu doesn't work for me in the\n> > latest git. It says:\n> >\n> > couldn't change working directory to \"\": no such file or directory\n> \n> Definitely my fault. _gitworktree was not being set up correctly when\n> support for bare repositories was enabled and the repo was not bare\n> (like in the blame case). Patch incoming, can you see if it does the\n> job for you? It seems to fix it here.\n\nIsn't this the same bug as this one fixes:\n\nhttp://article.gmane.org/gmane.comp.version-control.git/140288\n\ncheers Heiko\n"},{"id":"135366","messageId":"cb7bb73a1002221529r6aee3202l5b6609b59aea01fd@mail.gmail.com","threadId":"22752","inReplyTo":"20100222223802.GA9898@book.hvoigt.net","subject":"Re: Re: [BUG] git gui blame: Show History Context broken since 29e5573d","fromName":"Giuseppe Bilotta","fromEmail":"giuseppe.bilotta@gmail.com","sentAt":"2010-02-22T23:29:03Z","receivedAt":"2010-02-22T23:29:03Z","isPatch":false,"sender":{"key":"giuseppe.bilotta@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1464?v=4"},"body":"On Mon, Feb 22, 2010 at 11:38 PM, Heiko Voigt <hvoigt@hvoigt.net> wrote:\n> On Mon, Feb 22, 2010 at 04:18:11PM +0100, Giuseppe Bilotta wrote:\n>> On Mon, Feb 22, 2010 at 9:27 AM, Matthieu Moy\n>> <Matthieu.Moy@grenoble-inp.fr> wrote:\n>> > Hi,\n>> >\n>> > In \"git gui blame\", right-clicking on the left fringe and chosing\n>> > \"Show History Context\" in the context-menu doesn't work for me in the\n>> > latest git. It says:\n>> >\n>> > couldn't change working directory to \"\": no such file or directory\n>>\n>> Definitely my fault. _gitworktree was not being set up correctly when\n>> support for bare repositories was enabled and the repo was not bare\n>> (like in the blame case). Patch incoming, can you see if it does the\n>> job for you? It seems to fix it here.\n>\n> Isn't this the same bug as this one fixes:\n>\n> http://article.gmane.org/gmane.comp.version-control.git/140288\n>\n> cheers Heiko\n\nInteresting, I missed that patch. However, I strongly suspect that\npatch is not correct, since in that case the setup of gitworktree is\ndone before checking for bareness, meaning that when working in\nsomerepo.git (bare repo) for which the config flag is not set, it\nmight misdetect the situation as being in the non-bare case. I believe\nmy fix to be more correct in this regard.\n\n-- \nGiuseppe \"Oblomov\" Bilotta\n"},{"id":"135397","messageId":"vpqiq9omp4f.fsf@bauges.imag.fr","threadId":"22752","inReplyTo":"cb7bb73a1002221529r6aee3202l5b6609b59aea01fd@mail.gmail.com","subject":"Re: [BUG] git gui blame: Show History Context broken since 29e5573d","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2010-02-23T06:40:16Z","receivedAt":"2010-02-23T06:40:16Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"[ Adding Pat Thoyts, author of the first patch, in Cc ]\n\nGiuseppe Bilotta <giuseppe.bilotta@gmail.com> writes:\n\n> On Mon, Feb 22, 2010 at 11:38 PM, Heiko Voigt <hvoigt@hvoigt.net> wrote:\n>> On Mon, Feb 22, 2010 at 04:18:11PM +0100, Giuseppe Bilotta wrote:\n>>> On Mon, Feb 22, 2010 at 9:27 AM, Matthieu Moy\n>>> <Matthieu.Moy@grenoble-inp.fr> wrote:\n>>> > Hi,\n>>> >\n>>> > In \"git gui blame\", right-clicking on the left fringe and chosing\n>>> > \"Show History Context\" in the context-menu doesn't work for me in the\n>>> > latest git. It says:\n>>> >\n>>> > couldn't change working directory to \"\": no such file or directory\n>>>\n>>> Definitely my fault. _gitworktree was not being set up correctly when\n>>> support for bare repositories was enabled and the repo was not bare\n>>> (like in the blame case). Patch incoming, can you see if it does the\n>>> job for you? It seems to fix it here.\n\n[ patch available here :\n  http://thread.gmane.org/gmane.comp.version-control.git/140688 ]\n\n>> Isn't this the same bug as this one fixes:\n>>\n>> http://article.gmane.org/gmane.comp.version-control.git/140288\n\nIt seems it is, yes.\n\n> I believe my fix to be more correct in this regard.\n\nNot familiar enought with the code to say which is the right one.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"135470","messageId":"20100223213035.GE10932@book.hvoigt.net","threadId":"22752","inReplyTo":"cb7bb73a1002221529r6aee3202l5b6609b59aea01fd@mail.gmail.com","subject":"Re: Re: Re: [BUG] git gui blame: Show History Context broken since 29e5573d","fromName":"Heiko Voigt","fromEmail":"hvoigt@hvoigt.net","sentAt":"2010-02-23T21:30:38Z","receivedAt":"2010-02-23T21:30:38Z","isPatch":false,"sender":{"key":"hvoigt@hvoigt.net","avatar":"https://avatars.githubusercontent.com/u/184958?v=4"},"body":"On Tue, Feb 23, 2010 at 12:29:03AM +0100, Giuseppe Bilotta wrote:\n> On Mon, Feb 22, 2010 at 11:38 PM, Heiko Voigt <hvoigt@hvoigt.net> wrote:\n> > On Mon, Feb 22, 2010 at 04:18:11PM +0100, Giuseppe Bilotta wrote:\n> >> On Mon, Feb 22, 2010 at 9:27 AM, Matthieu Moy\n> >> <Matthieu.Moy@grenoble-inp.fr> wrote:\n> >> > Hi,\n> >> >\n> >> > In \"git gui blame\", right-clicking on the left fringe and chosing\n> >> > \"Show History Context\" in the context-menu doesn't work for me in the\n> >> > latest git. It says:\n> >> >\n> >> > couldn't change working directory to \"\": no such file or directory\n> >>\n> >> Definitely my fault. _gitworktree was not being set up correctly when\n> >> support for bare repositories was enabled and the repo was not bare\n> >> (like in the blame case). Patch incoming, can you see if it does the\n> >> job for you? It seems to fix it here.\n> >\n> > Isn't this the same bug as this one fixes:\n> >\n> > http://article.gmane.org/gmane.comp.version-control.git/140288\n> >\n> > cheers Heiko\n> \n> Interesting, I missed that patch. However, I strongly suspect that\n> patch is not correct, since in that case the setup of gitworktree is\n> done before checking for bareness, meaning that when working in\n> somerepo.git (bare repo) for which the config flag is not set, it\n> might misdetect the situation as being in the non-bare case. I believe\n> my fix to be more correct in this regard.\n\nGood to know. I already picked that one into my private repo and did not\nexperience any problems with it, but that might be due to the fact that\nI have never tried to open git gui on bare repos.\n\ncheers Heiko\n"}]}