{"thread":{"id":"11396","subject":"[msysgit] how to detect git.exe directory?","startedAt":"2007-12-23T16:25:34Z","lastAt":"2007-12-23T20:04:13Z","messageCount":6,"participants":["Marco Costalba","Johannes Sixt","Abdelrazak Younes"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"64043","messageId":"e5bfff550712230825o5e73bd3dm31057847106b8722@mail.gmail.com","threadId":"11396","inReplyTo":null,"subject":"[msysgit] how to detect git.exe directory?","fromName":"Marco Costalba","fromEmail":"mcostalba@gmail.com","sentAt":"2007-12-23T16:25:34Z","receivedAt":"2007-12-23T16:25:34Z","isPatch":false,"sender":{"key":"mcostalba@gmail.com","avatar":null},"body":"Hi all,\n\n   I'm progressing on qgit installer for windows, I have switched to\nMSVC for compiling Qt4 and qgit sources and I have to say that first\nresults are very good, qgit.exe now seems to work without problems or\nartifacts and the speed is much more similar to what we achieve under\nthe Linux platform (read much higher).\n\nSo it seems Qt+mingw is not the _best_ possible solution.\n\nAnyhow, under Vista you cannot simply copy qgit.exe in the git\ndirectory (OS barfs regarding some administrative rights, note that *I\nam* the administartor!), so to make qgit.exe work git.exe file must be\nin PATH.\n\nTo easy the user and allowing to call qgit.exe double clicking on a\nnice desktop icon I need a way to know where git.exe is installed *at\nruntime*.\n\nSo my question is: \"What is the preferred way to detect git directory\nat runtime for msysgit files?\"\n\n- environment variable ??\n\n- windows registry ??\n\n- others ?\n\n\nI don't plan to use the cygwin version of git but going directly to\nthe \"long term\" solution that is msysgit.\n\nThanks for your help\nMarco\n"},{"id":"64045","messageId":"200712231735.00336.johannes.sixt@telecom.at","threadId":"11396","inReplyTo":"e5bfff550712230825o5e73bd3dm31057847106b8722-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org","subject":"Re: how to detect git.exe directory?","fromName":"Johannes Sixt","fromEmail":"johannes.sixt-dl2ejs2iusazzxs1dc/lvw@public.gmane.org","sentAt":"2007-12-23T16:35:00Z","receivedAt":"2007-12-23T16:35:00Z","isPatch":false,"sender":{"key":"johannes.sixt-dl2ejs2iusazzxs1dc/lvw@public.gmane.org","avatar":null},"body":"\nOn Sunday 23 December 2007 17:25, Marco Costalba wrote:\n> To easy the user and allowing to call qgit.exe double clicking on a\n> nice desktop icon I need a way to know where git.exe is installed *at\n> runtime*.\n>\n> So my question is: \"What is the preferred way to detect git directory\n> at runtime for msysgit files?\"\n>\n> - environment variable ??\n>\n> - windows registry ??\n>\n> - others ?\n\nRunning\n\n\tgit --exec-path\n\nshould get you close to it. But I have to question why you need that path.\n\n-- Hannes\n"},{"id":"64046","messageId":"e5bfff550712230853u1bc0160ap936c2d0a6fe0203b@mail.gmail.com","threadId":"11396","inReplyTo":"200712231735.00336.johannes.sixt-dl2ejS2iUSazZXS1Dc/lvw@public.gmane.org","subject":"Re: how to detect git.exe directory?","fromName":"Marco Costalba","fromEmail":"mcostalba-re5jqeeqqe8avxtiumwx3w@public.gmane.org","sentAt":"2007-12-23T16:53:17Z","receivedAt":"2007-12-23T16:53:17Z","isPatch":false,"sender":{"key":"mcostalba-re5jqeeqqe8avxtiumwx3w@public.gmane.org","avatar":null},"body":"\nOn Dec 23, 2007 5:35 PM, Johannes Sixt <johannes.sixt-dl2ejS2iUSazZXS1Dc/lvw@public.gmane.org> wrote:\n> On Sunday 23 December 2007 17:25, Marco Costalba wrote:\n> > To easy the user and allowing to call qgit.exe double clicking on a\n> > nice desktop icon I need a way to know where git.exe is installed *at\n> > runtime*.\n> >\n> > So my question is: \"What is the preferred way to detect git directory\n> > at runtime for msysgit files?\"\n> >\n> > - environment variable ??\n> >\n> > - windows registry ??\n> >\n> > - others ?\n>\n> Running\n>\n>         git --exec-path\n>\n> should get you close to it. But I have to question why you need that path.\n>\n\nWhat I'm looking for is git.exe itself. If I run \"git --exec-path\" I\nget something along the lines \"git executable not found...\"\n\nI don't use dashed command inside qgit, so I run \"git log ...\" not\n\"git-log ...\", but the git.exe should be known to qgit or in path.\n\nHope it's clear.\n\nThanks\nMarco\n"},{"id":"64053","messageId":"476EBADE.6080805@free.fr","threadId":"11396","inReplyTo":"e5bfff550712230825o5e73bd3dm31057847106b8722@mail.gmail.com","subject":"Re: [msysgit] how to detect git.exe directory?","fromName":"Abdelrazak Younes","fromEmail":"younes.a@free.fr","sentAt":"2007-12-23T19:45:34Z","receivedAt":"2007-12-23T19:45:34Z","isPatch":false,"sender":{"key":"younes.a@free.fr","avatar":null},"body":"Marco Costalba wrote:\n> Hi all,\n> \n>    I'm progressing on qgit installer for windows, I have switched to\n> MSVC for compiling Qt4 and qgit sources and I have to say that first\n> results are very good, qgit.exe now seems to work without problems or\n> artifacts and the speed is much more similar to what we achieve under\n> the Linux platform (read much higher).\n\nGlad you manage to do it by yourself. Sorry for not going further with \ncompilation as I promised but the git repository had only a MSVC2008 \nsolution file and I have only MSVC2005 here. I tried to adapt our CMake \nfiles to qgit but failed...\n\n> \n> So it seems Qt+mingw is not the _best_ possible solution.\n\nI told you that ;-)\n\n> \n> Anyhow, under Vista you cannot simply copy qgit.exe in the git\n> directory (OS barfs regarding some administrative rights, note that *I\n> am* the administartor!), so to make qgit.exe work git.exe file must be\n> in PATH.\n> \n> To easy the user and allowing to call qgit.exe double clicking on a\n> nice desktop icon I need a way to know where git.exe is installed *at\n> runtime*.\n> \n> So my question is: \"What is the preferred way to detect git directory\n> at runtime for msysgit files?\"\n\nIf you use QProcess to launch git, maybe you could just use \nQProcess::workingDirectory()?\n\nAbdel.\n"},{"id":"64054","messageId":"fkme88$rc1$1@ger.gmane.org","threadId":"11396","inReplyTo":"e5bfff550712230853u1bc0160ap936c2d0a6fe0203b-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org","subject":"Re: how to detect git.exe directory?","fromName":"Abdelrazak Younes","fromEmail":"younes.a-ganu6spqydw@public.gmane.org","sentAt":"2007-12-23T19:51:33Z","receivedAt":"2007-12-23T19:51:33Z","isPatch":false,"sender":{"key":"younes.a-ganu6spqydw@public.gmane.org","avatar":null},"body":"\nMarco Costalba wrote:\n> \n> What I'm looking for is git.exe itself. If I run \"git --exec-path\" I\n> get something along the lines \"git executable not found...\"\n> \n> I don't use dashed command inside qgit, so I run \"git log ...\" not\n> \"git-log ...\", but the git.exe should be known to qgit or in path.\n\nIf you're planning to create an installer for qgit, a good solution \nwould be to ask the user to manually point to the msysgit installation \ndirectory if not found in the path. Then the installer could just save \nthe directory to an ini file along 'qgit.exe'.\n\nAbdel.\n"},{"id":"64055","messageId":"e5bfff550712231204m6dad571ct8c2f5e2eb4a23de0@mail.gmail.com","threadId":"11396","inReplyTo":"476EBADE.6080805@free.fr","subject":"Re: [msysgit] how to detect git.exe directory?","fromName":"Marco Costalba","fromEmail":"mcostalba@gmail.com","sentAt":"2007-12-23T20:04:13Z","receivedAt":"2007-12-23T20:04:13Z","isPatch":false,"sender":{"key":"mcostalba@gmail.com","avatar":null},"body":"On Dec 23, 2007 8:45 PM, Abdelrazak Younes <younes.a@free.fr> wrote:\n> Marco Costalba wrote:\n> > Hi all,\n> >\n> Glad you manage to do it by yourself. Sorry for not going further with\n> compilation as I promised but the git repository had only a MSVC2008\n> solution file and I have only MSVC2005 here. I tried to adapt our CMake\n> files to qgit but failed...\n>\n\nDon't worry, I have installed MSVC2008, compiled Qt4 (and everithing\nwent smooth) and bruefly tested qgit: it really seems to work, now\nfollowing steps are:\n\n- Detect git.exe directory at runtime also when is not in PATH (see below)\n\n- Manage to package qgit and others needed files in a windows\ninstaller (I know very little about this)\n\n>\n> > So my question is: \"What is the preferred way to detect git directory\n> > at runtime for msysgit files?\"\n>\n> If you use QProcess to launch git, maybe you could just use\n> QProcess::workingDirectory()?\n>\n\nIt's not the repository that I don't find, but the git binary\ndirectory. I explain better. If I open a console under windows with\ncmd.exe and type \"git\" when I hit enter button I have an error message\nthat says that \"command git is not known\"\n\nThis is because git.exe directory is _not_ (normally) in PATH\nenvironment variable.\n\nSo, or msysgit installation *modifies* the user PATH adding the bin\ndirectory, or I have to found git bin directory myself and manage to\nadd to the PATH of qgit process environment.\n\nThe question is: \"How I find git.exe??\"\n\nMarco\n"}]}