git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Karl Hasselström" <kha@treskal.com>
To: Catalin Marinas <catalin.marinas@gmail.com>
Cc: git@vger.kernel.org, Erik Sandberg <mandolaerik@gmail.com>
Subject: [StGit PATCH 2/2] Log environment and cwd as well as the actual command
Date: Sat, 12 Apr 2008 17:47:27 +0200	[thread overview]
Message-ID: <20080412154727.19690.60228.stgit@yoghurt> (raw)
In-Reply-To: <20080412154427.19690.71877.stgit@yoghurt>

When debugging subprocess calls (with STGIT_SUBPROCESS_LOG=debug),
it's important to know the environment and working directory we pass
to the subprocess, not just the command-line parameters.

Signed-off-by: Karl Hasselström <kha@treskal.com>

---

 stgit/run.py |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)


diff --git a/stgit/run.py b/stgit/run.py
index 77f2e65..0b79729 100644
--- a/stgit/run.py
+++ b/stgit/run.py
@@ -48,6 +48,12 @@ class Run:
     def __log_start(self):
         if _log_mode == 'debug':
             out.start('Running subprocess %s' % self.__cmd)
+            if self.__cwd != None:
+                out.info('cwd: %s' % self.__cwd)
+            if self.__env != None:
+                for k in sorted(self.__env.iterkeys()):
+                    if k not in os.environ or os.environ[k] != self.__env[k]:
+                        out.info('%s: %s' % (k, self.__env[k]))
         elif _log_mode == 'profile':
             out.start('Running subprocess %s' % self.__cmd[0])
             self.__starttime = datetime.datetime.now()

      parent reply	other threads:[~2008-04-12 15:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-12 15:47 [StGit PATCH 0/2] Fix stg breakage with nweer gits Karl Hasselström
2008-04-12 15:47 ` [StGit PATCH 1/2] Don't both change directory and set GIT_WORK_TREE Karl Hasselström
2008-04-12 15:47 ` Karl Hasselström [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080412154727.19690.60228.stgit@yoghurt \
    --to=kha@treskal.com \
    --cc=catalin.marinas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=mandolaerik@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).