{"thread":{"id":"30853","subject":"git-push error handling","startedAt":"2012-06-20T19:43:04Z","lastAt":"2012-06-21T06:07:24Z","messageCount":2,"participants":["Neal Kreitzinger","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"193979","messageId":"jrt949$o3g$1@dough.gmane.org","threadId":"30853","inReplyTo":null,"subject":"git-push error handling","fromName":"Neal Kreitzinger","fromEmail":"nkreitzinger@gmail.com","sentAt":"2012-06-20T19:43:04Z","receivedAt":"2012-06-20T19:43:04Z","isPatch":false,"sender":{"key":"nkreitzinger@gmail.com","avatar":null},"body":"Does git push always return an error to \"if [ $? -ne 0 ]\" when the push \nfails?  Is this sufficient to verify your git-push worked?  I'm being \nasked to advise on commands to 'verify the canonical repo is in good \nworking order' immediately before a push and immediately after a push \n(for total automation).  I'm used to doing pushes manually.  I think \ngit-push itself will tell you if there's a problem, and there's no need \nfor 'before' and 'after' checks.  Correct?\n\nVery Limited Scope of Context:\nWe don't do anything special in the push.  We are just fast-forwarding \nthe master branch and there is only one branch (master).  (The \npowers-that-be are doing their own change control (ie, file locking) and \nonly care to copy files to the worktree of master, git-add, git-commit, \nand git-push to canonical.)  They have created a change control menu \nthat only uses git to 'check out' source and to 'commit source' \nautomatically via scripts.  They are doing the merges manually and not \nusing git for that so there is no 'merging of master' going on as far as \ngit is concerned.  They're basically using git to replace cvs in their \nlegacy change control so they don't wish to use any git functionality \nlike branches, merges, etc, at this time.  I think they are just using \ngit checkout, git add, git commit, to say they have put the changes into \na 'change control repository'.\n\nv/r,\nneal\n"},{"id":"194017","messageId":"20120621060724.GA19485@sigill.intra.peff.net","threadId":"30853","inReplyTo":"jrt949$o3g$1@dough.gmane.org","subject":"Re: git-push error handling","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-06-21T06:07:24Z","receivedAt":"2012-06-21T06:07:24Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Jun 20, 2012 at 02:43:04PM -0500, Neal Kreitzinger wrote:\n\n> Does git push always return an error to \"if [ $? -ne 0 ]\" when the\n> push fails?  Is this sufficient to verify your git-push worked?\n\nIt should (and if it doesn't, it's a bug). But do note that even a\nfailed push may have been partially successful (e.g., pushed some refs\nbut failed on others).\n\n-Peff\n"}]}