git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Return code in cmd (git describe)

From
MHManuela Hutter <manuelah@opera.com>
Date
Jul 31, 2012, 12:02 UTC
Message-ID
<op.wia7q0jqt21y7h@id-c1003.oslo.osa>
Hi,

we have some python scripts that are run from Visual Studio, and one of them fails because of a wrong git return code when calling 'git describe --dirty'

Here's the issue:

============= import subprocess

GIT_EXE = "<path to git exe>" GIT_SRC = "<path to git repo>"

# call 'git describe --dirty':
run_git = subprocess.Popen([GIT_EXE, "describe", "--dirty"],
                            cwd=GIT_SRC,
                            stdout=subprocess.PIPE,
                            stderr=subprocess.PIPE)
(output, output_err) = run_git.communicate()
print "Returncode: %s" % run_git.returncode
print "Output:     %s" % output.strip()
=============

Run from wingw, the return code is 0. Run from cmd, the return code is 1.

Why?

Thanks, Manuela

Next: Konstantin Khomoutov
Message 1 of 3 in “Return code in cmd (git describe)”
  1. Manuela HutterJul 31, 2012
  2. Konstantin KhomoutovJul 31, 2012
  3. Manuela HutterJul 31, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.