* [QGit bug] git user settings not retrieved when launched for Windows explorer @ 2008-10-07 7:33 Abdelrazak Younes 2008-10-07 11:10 ` Marco Costalba 2008-10-07 11:16 ` [QGit bug] git user settings not retrieved when launched for Windows explorer Marco Costalba 0 siblings, 2 replies; 18+ messages in thread From: Abdelrazak Younes @ 2008-10-07 7:33 UTC (permalink / raw) To: Git Mailing List, Marco Costalba Dear Marco, When I double click on qgit.exe, the user name and email are not shown in the user settings (for any of the 3 combo values). But if I run qgit from the commandline at the mysysgit bash prompt, the boxes are properly filled. I would like to debug it but, as I reported last week, the MSVC project doesn't work for me. By the way, these two edit boxes are not editable on Windows, is that on purpose? If yes, maybe we could let the user change them is 'Local config' is selected and call the appropriate git function? Thanks, Abdel. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [QGit bug] git user settings not retrieved when launched for Windows explorer 2008-10-07 7:33 [QGit bug] git user settings not retrieved when launched for Windows explorer Abdelrazak Younes @ 2008-10-07 11:10 ` Marco Costalba 2008-10-07 11:36 ` Abdelrazak Younes 2008-10-07 11:16 ` [QGit bug] git user settings not retrieved when launched for Windows explorer Marco Costalba 1 sibling, 1 reply; 18+ messages in thread From: Marco Costalba @ 2008-10-07 11:10 UTC (permalink / raw) To: Abdelrazak Younes; +Cc: Git Mailing List On Tue, Oct 7, 2008 at 9:33 AM, Abdelrazak Younes <younes@lyx.org> wrote: > Dear Marco, > > When I double click on qgit.exe, the user name and email are not shown in > the user settings (for any of the 3 combo values). But if I run qgit from > the commandline at the mysysgit bash prompt, the boxes are properly filled. > I would like to debug it but, as I reported last week, the MSVC project > doesn't work for me. > Sound like a problem of startup directory: on the command line you start from the right directory...when you double click on which repo qgit is open ? Marco ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [QGit bug] git user settings not retrieved when launched for Windows explorer 2008-10-07 11:10 ` Marco Costalba @ 2008-10-07 11:36 ` Abdelrazak Younes 2008-10-07 11:57 ` Marco Costalba 0 siblings, 1 reply; 18+ messages in thread From: Abdelrazak Younes @ 2008-10-07 11:36 UTC (permalink / raw) To: Marco Costalba; +Cc: Git Mailing List On 07/10/2008 13:10, Marco Costalba wrote: > On Tue, Oct 7, 2008 at 9:33 AM, Abdelrazak Younes<younes@lyx.org> wrote: > >> Dear Marco, >> >> When I double click on qgit.exe, the user name and email are not shown in >> the user settings (for any of the 3 combo values). But if I run qgit from >> the commandline at the mysysgit bash prompt, the boxes are properly filled. >> I would like to debug it but, as I reported last week, the MSVC project >> doesn't work for me. >> >> > > Sound like a problem of startup directory: on the command line you > start from the right directory...when you double click on which repo > qgit is open ? > None of course. But when I open a repository manually I would expect that this is properly filled in. And if I launch qgit with the context menu (right clicking a directory in the Explorer), qgit never managed to open the repository. Abdel. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [QGit bug] git user settings not retrieved when launched for Windows explorer 2008-10-07 11:36 ` Abdelrazak Younes @ 2008-10-07 11:57 ` Marco Costalba 2008-10-07 12:08 ` Abdelrazak Younes ` (2 more replies) 0 siblings, 3 replies; 18+ messages in thread From: Marco Costalba @ 2008-10-07 11:57 UTC (permalink / raw) To: Abdelrazak Younes; +Cc: Git Mailing List On Tue, Oct 7, 2008 at 1:36 PM, Abdelrazak Younes <younes@lyx.org> wrote: > >> Sound like a problem of startup directory: on the command line you >> start from the right directory...when you double click on which repo >> qgit is open ? >> > > None of course. But when I open a repository manually I would expect that > this is properly filled in. > In git.cpp, Git::userInfo() function get info about user by means of 'git config' calls, my guess (I cannot it test now) is that 'git config' does not work if we are not in a git directory. > And if I launch qgit with the context menu (right clicking a directory in > the Explorer), qgit never managed to open the repository. > This is a bug that I never managed to get rid of :-( It is strange because it works if you try in a subdirectory, as example try right clicking on 'src' directory of qgit project. Thanks Marco ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [QGit bug] git user settings not retrieved when launched for Windows explorer 2008-10-07 11:57 ` Marco Costalba @ 2008-10-07 12:08 ` Abdelrazak Younes 2008-10-07 12:31 ` Abdelrazak Younes 2008-10-07 13:10 ` [QGIT PATCH] Add safeguards to Git::userInfo() Abdelrazak Younes 2 siblings, 0 replies; 18+ messages in thread From: Abdelrazak Younes @ 2008-10-07 12:08 UTC (permalink / raw) To: Marco Costalba; +Cc: Git Mailing List On 07/10/2008 13:57, Marco Costalba wrote: > On Tue, Oct 7, 2008 at 1:36 PM, Abdelrazak Younes<younes@lyx.org> wrote: > >>> Sound like a problem of startup directory: on the command line you >>> start from the right directory...when you double click on which repo >>> qgit is open ? >>> >>> >> None of course. But when I open a repository manually I would expect that >> this is properly filled in. >> >> > > In git.cpp, Git::userInfo() function get info about user by means of > 'git config' calls, my guess (I cannot it test now) is that 'git > config' does not work if we are not in a git directory. > OK, I'll have a look, thanks. > > >> And if I launch qgit with the context menu (right clicking a directory in >> the Explorer), qgit never managed to open the repository. >> >> > > This is a bug that I never managed to get rid of :-( > > It is strange because it works if you try in a subdirectory, as > example try right clicking on 'src' directory of qgit project. > I tried and it doesn't work this way either; the statusbar tells me that this is 'Not a git archive' :-( Abdel. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [QGit bug] git user settings not retrieved when launched for Windows explorer 2008-10-07 11:57 ` Marco Costalba 2008-10-07 12:08 ` Abdelrazak Younes @ 2008-10-07 12:31 ` Abdelrazak Younes 2008-10-07 16:48 ` Marco Costalba 2008-10-07 13:10 ` [QGIT PATCH] Add safeguards to Git::userInfo() Abdelrazak Younes 2 siblings, 1 reply; 18+ messages in thread From: Abdelrazak Younes @ 2008-10-07 12:31 UTC (permalink / raw) To: Marco Costalba; +Cc: Git Mailing List On 07/10/2008 13:57, Marco Costalba wrote: > On Tue, Oct 7, 2008 at 1:36 PM, Abdelrazak Younes<younes@lyx.org> wrote: > >>> Sound like a problem of startup directory: on the command line you >>> start from the right directory...when you double click on which repo >>> qgit is open ? >>> >>> >> None of course. But when I open a repository manually I would expect that >> this is properly filled in. >> >> > > In git.cpp, Git::userInfo() function get info about user by means of > 'git config' calls, my guess (I cannot it test now) is that 'git > config' does not work if we are not in a git directory. > No, 'git config user.name' works fine in any directory, even on the naked Windows console (I mean without msys bash). So that must be something else. I've traced it down to MyProcess::on_finished(). isErrorExit = (exitStatus != QProcess::NormalExit) || (exitCode != 0 && isWinShell) || !errorDesc.isEmpty() || canceling; At this point we have: exitStatus = NormalExit exitCode = 1 isWinShell = false errorDesc.isEmpty() returns true canceling = false Which gives 'isErrorExit = false'. I wonder if the isWinShell test is correct? Abdel. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [QGit bug] git user settings not retrieved when launched for Windows explorer 2008-10-07 12:31 ` Abdelrazak Younes @ 2008-10-07 16:48 ` Marco Costalba 2008-10-07 17:08 ` Abdelrazak Younes 0 siblings, 1 reply; 18+ messages in thread From: Marco Costalba @ 2008-10-07 16:48 UTC (permalink / raw) To: Abdelrazak Younes; +Cc: Git Mailing List On Tue, Oct 7, 2008 at 2:31 PM, Abdelrazak Younes <younes@lyx.org> wrote: > > No, 'git config user.name' works fine in any directory, even on the naked > Windows console (I mean without msys bash). So that must be something else. > I've traced it down to > MyProcess::on_finished(). > > isErrorExit = (exitStatus != QProcess::NormalExit) > || (exitCode != 0 && isWinShell) > || !errorDesc.isEmpty() > || canceling; > > At this point we have: > exitStatus = NormalExit > exitCode = 1 > isWinShell = false > errorDesc.isEmpty() returns true > canceling = false > > Which gives 'isErrorExit = false'. I wonder if the isWinShell test is > correct? > Hi Abdel, I would think it is correct to return isErrorExit == false The problem is that it seems git config return empty data if run from outside git directory...isn't it ? Marco ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [QGit bug] git user settings not retrieved when launched for Windows explorer 2008-10-07 16:48 ` Marco Costalba @ 2008-10-07 17:08 ` Abdelrazak Younes 0 siblings, 0 replies; 18+ messages in thread From: Abdelrazak Younes @ 2008-10-07 17:08 UTC (permalink / raw) To: Marco Costalba; +Cc: Git Mailing List On 07/10/2008 18:48, Marco Costalba wrote: > On Tue, Oct 7, 2008 at 2:31 PM, Abdelrazak Younes<younes@lyx.org> wrote: > >> No, 'git config user.name' works fine in any directory, even on the naked >> Windows console (I mean without msys bash). So that must be something else. >> I've traced it down to >> MyProcess::on_finished(). >> >> isErrorExit = (exitStatus != QProcess::NormalExit) >> || (exitCode != 0&& isWinShell) >> || !errorDesc.isEmpty() >> || canceling; >> >> At this point we have: >> exitStatus = NormalExit >> exitCode = 1 >> isWinShell = false >> errorDesc.isEmpty() returns true >> canceling = false >> >> Which gives 'isErrorExit = false'. I wonder if the isWinShell test is >> correct? >> >> > > Hi Abdel, > > I would think it is correct to return isErrorExit == false > OK. > The problem is that it seems git config return empty data if run from > outside git directory...isn't it ? > No, as I said, 'git config user.name' is working just fine outside git directory. Abdel. ^ permalink raw reply [flat|nested] 18+ messages in thread
* [QGIT PATCH] Add safeguards to Git::userInfo() 2008-10-07 11:57 ` Marco Costalba 2008-10-07 12:08 ` Abdelrazak Younes 2008-10-07 12:31 ` Abdelrazak Younes @ 2008-10-07 13:10 ` Abdelrazak Younes 2008-10-07 16:50 ` Marco Costalba 2 siblings, 1 reply; 18+ messages in thread From: Abdelrazak Younes @ 2008-10-07 13:10 UTC (permalink / raw) To: Marco Costalba; +Cc: Git Mailing List On 07/10/2008 13:57, Marco Costalba wrote: > On Tue, Oct 7, 2008 at 1:36 PM, Abdelrazak Younes<younes@lyx.org> wrote: > >>> Sound like a problem of startup directory: on the command line you >>> start from the right directory...when you double click on which repo >>> qgit is open ? >>> >>> >> None of course. But when I open a repository manually I would expect that >> this is properly filled in. >> >> > > In git.cpp, Git::userInfo() function get info about user by means of > 'git config' calls, my guess (I cannot it test now) is that 'git > config' does not work if we are not in a git directory. > OK, with this patch, I see that the local config request is apparently successful even though the 'user' and 'email' strings stay empty. OTOH, the two global config requests fail. --- src/git.cpp | 19 ++++++++++++------- 1 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/git.cpp b/src/git.cpp index 4ffc4ea..e77f4a1 100755 --- a/src/git.cpp +++ b/src/git.cpp @@ -6,6 +6,8 @@ Copyright: See COPYING file that comes with this distribution */ +#include <string> + #include <QApplication> #include <QDateTime> #include <QDir> @@ -347,13 +349,16 @@ void Git::userInfo(SList info) { errorReportingEnabled = false; // 'git config' could fail, see docs - run("git config user.name", &user); - run("git config user.email", &email); - info << "Local config" << user << email; - - run("git config --global user.name", &user); - run("git config --global user.email", &email); - info << "Global config" << user << email; + if (bool success = run("git config user.name", &user)) { + success = run("git config user.email", &email); + if (success) + info << "Local config" << user << email; + } + if (bool success = run("git config --global user.name", &user)) { + success = run("git config --global user.email", &email); + if (success) + info << "Global config" << user << email; + } errorReportingEnabled = true; } -- 1.6.0.2.1172.ga5ed0 ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [QGIT PATCH] Add safeguards to Git::userInfo() 2008-10-07 13:10 ` [QGIT PATCH] Add safeguards to Git::userInfo() Abdelrazak Younes @ 2008-10-07 16:50 ` Marco Costalba 2008-10-07 16:55 ` Marco Costalba 2008-10-07 17:12 ` Abdelrazak Younes 0 siblings, 2 replies; 18+ messages in thread From: Marco Costalba @ 2008-10-07 16:50 UTC (permalink / raw) To: Abdelrazak Younes; +Cc: Git Mailing List On Tue, Oct 7, 2008 at 3:10 PM, Abdelrazak Younes <younes@lyx.org> wrote: > > OK, with this patch, I see that the local config request is apparently > successful even though the 'user' and 'email' strings stay empty. An empty user and email it does not mean failure. Again, I would think that is git config that returns no data (without failing) if it is run from outside git directory. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [QGIT PATCH] Add safeguards to Git::userInfo() 2008-10-07 16:50 ` Marco Costalba @ 2008-10-07 16:55 ` Marco Costalba 2008-10-07 17:38 ` Abdelrazak Younes 2008-10-07 17:12 ` Abdelrazak Younes 1 sibling, 1 reply; 18+ messages in thread From: Marco Costalba @ 2008-10-07 16:55 UTC (permalink / raw) To: Abdelrazak Younes; +Cc: Git Mailing List On Tue, Oct 7, 2008 at 6:50 PM, Marco Costalba <mcostalba@gmail.com> wrote: > > An empty user and email it does not mean failure. Again, I would think > that is git config that returns no data (without failing) if it is run > from outside git directory. > Yes ! it is like this, I have finally had the possibility to test. git config does not returns user and mail if run outside git dir because user and mail are local set. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [QGIT PATCH] Add safeguards to Git::userInfo() 2008-10-07 16:55 ` Marco Costalba @ 2008-10-07 17:38 ` Abdelrazak Younes 2008-10-07 18:03 ` Marco Costalba 0 siblings, 1 reply; 18+ messages in thread From: Abdelrazak Younes @ 2008-10-07 17:38 UTC (permalink / raw) To: Marco Costalba; +Cc: Git Mailing List On 07/10/2008 18:55, Marco Costalba wrote: > On Tue, Oct 7, 2008 at 6:50 PM, Marco Costalba<mcostalba@gmail.com> wrote: >> An empty user and email it does not mean failure. Again, I would think >> that is git config that returns no data (without failing) if it is run >> from outside git directory. >> > > Yes ! it is like this, I have finally had the possibility to test. > > git config does not returns user and mail if run outside git dir > because user and mail are local set. So how do you explain this: C:\>git config --global user.name Abdelrazak Younes C:\>git config user.name Abdelrazak Younes I get the same result in any directory, git repo or not. FYI, I never set the name locally, just once and globally. Abdel. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [QGIT PATCH] Add safeguards to Git::userInfo() 2008-10-07 17:38 ` Abdelrazak Younes @ 2008-10-07 18:03 ` Marco Costalba 2008-10-07 18:20 ` Abdelrazak Younes 0 siblings, 1 reply; 18+ messages in thread From: Marco Costalba @ 2008-10-07 18:03 UTC (permalink / raw) To: Abdelrazak Younes; +Cc: Git Mailing List On Tue, Oct 7, 2008 at 6:38 PM, Abdelrazak Younes <younes@lyx.org> wrote: > > So how do you explain this: > Form git-config(1) docs: This command will fail if: -The config file is invalid, ...... -you use --global option without $HOME being properly set. So please try to comment out following line --- a/src/git.cpp +++ b/src/git.cpp @@ -345,7 +345,7 @@ void Git::userInfo(SList info) { info.clear(); info << "Environment" << user << email; - errorReportingEnabled = false; // 'git config' could fail, see docs + //errorReportingEnabled = false; // 'git config' could fail, see docs run("git config user.name", &user); run("git config user.email", &email); run from double click and you probably will see an error message box where git says $HOME is not set (I can reproduce this now). So what I think is that when you run from command line there is the $HOME variable set and command does not fails. Marco ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [QGIT PATCH] Add safeguards to Git::userInfo() 2008-10-07 18:03 ` Marco Costalba @ 2008-10-07 18:20 ` Abdelrazak Younes 2008-10-07 18:28 ` Marco Costalba 0 siblings, 1 reply; 18+ messages in thread From: Abdelrazak Younes @ 2008-10-07 18:20 UTC (permalink / raw) To: Marco Costalba; +Cc: Git Mailing List On 07/10/2008 20:03, Marco Costalba wrote: > On Tue, Oct 7, 2008 at 6:38 PM, Abdelrazak Younes<younes@lyx.org> wrote: > >> So how do you explain this: >> >> > > Form git-config(1) docs: > > This command will fail if: > > -The config file is invalid, > ...... > -you use --global option without $HOME being properly set. > > > So please try to comment out following line > > --- a/src/git.cpp > +++ b/src/git.cpp > @@ -345,7 +345,7 @@ void Git::userInfo(SList info) { > info.clear(); > info<< "Environment"<< user<< email; > > - errorReportingEnabled = false; // 'git config' could fail, see docs > + //errorReportingEnabled = false; // 'git config' could fail, see docs > > run("git config user.name",&user); > run("git config user.email",&email); > > > run from double click and you probably will see an error message box > where git says $HOME is not set (I can reproduce this now). > Right! > So what I think is that when you run from command line there is the > $HOME variable set and command does not fails. > I see... but the only variable I have is HOMEPATH: HOMEPATH=\Users\abdel So I guess this was set by msysgit at installation time. But I see this variable only at the console (after typing 'set'), I don't see it in the user environment variable nor in the system one. So I guess the fix would be for msysgit to create this entry? Thanks, Abdel. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [QGIT PATCH] Add safeguards to Git::userInfo() 2008-10-07 18:20 ` Abdelrazak Younes @ 2008-10-07 18:28 ` Marco Costalba 0 siblings, 0 replies; 18+ messages in thread From: Marco Costalba @ 2008-10-07 18:28 UTC (permalink / raw) To: Abdelrazak Younes; +Cc: Git Mailing List On Tue, Oct 7, 2008 at 7:20 PM, Abdelrazak Younes <younes@lyx.org> wrote: > > So I guess this was set by msysgit at installation time. But I see this > variable only at the console (after typing 'set'), I don't see it in the > user environment variable nor in the system one. So I guess the fix would be > for msysgit to create this entry? > Browsing git-config docs I would think that this variable is needed so that git-config knows where to look for the git global configs file that is under user $HOME directory, see the [FILES] section in git config docs. Thanks Marco ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [QGIT PATCH] Add safeguards to Git::userInfo() 2008-10-07 16:50 ` Marco Costalba 2008-10-07 16:55 ` Marco Costalba @ 2008-10-07 17:12 ` Abdelrazak Younes 1 sibling, 0 replies; 18+ messages in thread From: Abdelrazak Younes @ 2008-10-07 17:12 UTC (permalink / raw) To: Marco Costalba; +Cc: Git Mailing List On 07/10/2008 18:50, Marco Costalba wrote: > On Tue, Oct 7, 2008 at 3:10 PM, Abdelrazak Younes<younes@lyx.org> wrote: > >> OK, with this patch, I see that the local config request is apparently >> successful even though the 'user' and 'email' strings stay empty. >> > > An empty user and email it does not mean failure. Yes, I know that but what is troublesome is that the user and email are not empty when git config is called outside of qgit. What is even more troublesome is that the two calls to 'git config --global user.xxx' fail (but don't fail when called manually at the command line). Abdel. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [QGit bug] git user settings not retrieved when launched for Windows explorer 2008-10-07 7:33 [QGit bug] git user settings not retrieved when launched for Windows explorer Abdelrazak Younes 2008-10-07 11:10 ` Marco Costalba @ 2008-10-07 11:16 ` Marco Costalba 2008-10-07 11:42 ` Abdelrazak Younes 1 sibling, 1 reply; 18+ messages in thread From: Marco Costalba @ 2008-10-07 11:16 UTC (permalink / raw) To: Abdelrazak Younes; +Cc: Git Mailing List On Tue, Oct 7, 2008 at 9:33 AM, Abdelrazak Younes <younes@lyx.org> wrote: > Dear Marco, > > > By the way, these two edit boxes are not editable on Windows, is that on > purpose? If yes, maybe we could let the user change them is 'Local config' > is selected and call the appropriate git function? > I know this limitation. I was just too lazy to implement edit myself...it would be a nice patch to have tough ;-) Thanks Marco ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [QGit bug] git user settings not retrieved when launched for Windows explorer 2008-10-07 11:16 ` [QGit bug] git user settings not retrieved when launched for Windows explorer Marco Costalba @ 2008-10-07 11:42 ` Abdelrazak Younes 0 siblings, 0 replies; 18+ messages in thread From: Abdelrazak Younes @ 2008-10-07 11:42 UTC (permalink / raw) To: Marco Costalba; +Cc: Git Mailing List On 07/10/2008 13:16, Marco Costalba wrote: > On Tue, Oct 7, 2008 at 9:33 AM, Abdelrazak Younes<younes@lyx.org> wrote: > >> Dear Marco, >> >> >> By the way, these two edit boxes are not editable on Windows, is that on >> purpose? If yes, maybe we could let the user change them is 'Local config' >> is selected and call the appropriate git function? >> >> > > I know this limitation. I was just too lazy to implement edit > myself...it would be a nice patch to have tough ;-) > I am not sure I'll find the time to learn enough about git internals to do that kind of stuff. Maybe later. Abdel. ^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2008-10-07 18:30 UTC | newest] Thread overview: 18+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-10-07 7:33 [QGit bug] git user settings not retrieved when launched for Windows explorer Abdelrazak Younes 2008-10-07 11:10 ` Marco Costalba 2008-10-07 11:36 ` Abdelrazak Younes 2008-10-07 11:57 ` Marco Costalba 2008-10-07 12:08 ` Abdelrazak Younes 2008-10-07 12:31 ` Abdelrazak Younes 2008-10-07 16:48 ` Marco Costalba 2008-10-07 17:08 ` Abdelrazak Younes 2008-10-07 13:10 ` [QGIT PATCH] Add safeguards to Git::userInfo() Abdelrazak Younes 2008-10-07 16:50 ` Marco Costalba 2008-10-07 16:55 ` Marco Costalba 2008-10-07 17:38 ` Abdelrazak Younes 2008-10-07 18:03 ` Marco Costalba 2008-10-07 18:20 ` Abdelrazak Younes 2008-10-07 18:28 ` Marco Costalba 2008-10-07 17:12 ` Abdelrazak Younes 2008-10-07 11:16 ` [QGit bug] git user settings not retrieved when launched for Windows explorer Marco Costalba 2008-10-07 11:42 ` Abdelrazak Younes
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).