{"thread":{"id":"24446","subject":"Run git from .bat file (Windows)","startedAt":"2010-07-20T16:34:43Z","lastAt":"2010-07-20T18:44:00Z","messageCount":3,"participants":["Markus Heller","Peter Harris"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"145867","messageId":"0vy6d6nmcc.fsf@gmail.com","threadId":"24446","inReplyTo":null,"subject":"Run git from .bat file (Windows)","fromName":"Markus Heller","fromEmail":"hellerm2@gmail.com","sentAt":"2010-07-20T16:34:43Z","receivedAt":"2010-07-20T16:34:43Z","isPatch":false,"sender":{"key":"hellerm2@gmail.com","avatar":null},"body":"Hello,\n\nI'm trying to get the script below working on a box with Windoze XP and\ngit version 1.7.0.2.msysgit.0.  The script is a .bat file and is\nsupposed to be run from the Windoze scheduler; for testing, I run it\nfrom a command prompt.\n\nHere's the script:\n\n=================8<==================8<=====================\n@ECHO OFF\n\nREM get date and time\nfor /f \"delims=\" %%a in ('date/t') do @set mydate=%%a\nfor /f \"delims=\" %%a in ('time/t') do @set mytime=%%a\nset fvar=%mydate%%mytime%\n\nREM add all new files\ngit add .\ngit commit -a -m \"Automated commit by org-git-sync.bat on %fvar%\"\n================>8===================>8======================\n\nThe line \"git add .\" works, as I can see the additions when I type \"git\nstatus\" after executing the script.  Committing doesn't work, however:\n\"git log\" shows that no commit was created.\n\nAny idea what's going on?\n\nThanks\nMarkus\n"},{"id":"145873","messageId":"AANLkTik-Mk0pMKWHqzMXUcSzPexAQd2bTAPZF9Q2WKer@mail.gmail.com","threadId":"24446","inReplyTo":"0vy6d6nmcc.fsf@gmail.com","subject":"Re: Run git from .bat file (Windows)","fromName":"Peter Harris","fromEmail":"git@peter.is-a-geek.org","sentAt":"2010-07-20T17:34:33Z","receivedAt":"2010-07-20T17:34:33Z","isPatch":false,"sender":{"key":"git@peter.is-a-geek.org","avatar":null},"body":"On Tue, Jul 20, 2010 at 12:34 PM, Markus Heller wrote:\n> git add .\n> git commit -a -m \"Automated commit by org-git-sync.bat on %fvar%\"\n\n> The line \"git add .\" works, as I can see the additions when I type \"git\n> status\" after executing the script.  Committing doesn't work, however:\n> \"git log\" shows that no commit was created.\n>\n> Any idea what's going on?\n\ngit itself is wrapped by a batch file on Windows. You need to \"call\" it. eg:\n\ncall git add .\ncall git commit ...\n\n(\"call /?\" for more details)\n\nPeter Harris\n"},{"id":"145886","messageId":"0vtynungcv.fsf@gmail.com","threadId":"24446","inReplyTo":"AANLkTik-Mk0pMKWHqzMXUcSzPexAQd2bTAPZF9Q2WKer@mail.gmail.com","subject":"Re: Run git from .bat file (Windows)","fromName":"Markus Heller","fromEmail":"hellerm2@gmail.com","sentAt":"2010-07-20T18:44:00Z","receivedAt":"2010-07-20T18:44:00Z","isPatch":false,"sender":{"key":"hellerm2@gmail.com","avatar":null},"body":"Peter Harris <git@peter.is-a-geek.org> writes:\n\n> On Tue, Jul 20, 2010 at 12:34 PM, Markus Heller wrote:\n>> git add .\n>> git commit -a -m \"Automated commit by org-git-sync.bat on %fvar%\"\n>\n>> The line \"git add .\" works, as I can see the additions when I type \"git\n>> status\" after executing the script.  Committing doesn't work, however:\n>> \"git log\" shows that no commit was created.\n>>\n>> Any idea what's going on?\n>\n> git itself is wrapped by a batch file on Windows. You need to \"call\" it. eg:\n>\n> call git add .\n> call git commit ...\n\nAh, I wasn't aware of this!!\n\nThanks for your reply, works as advertised!!\n\nCheers\nMarkus\n"}]}