Comments (3)
I was unable to reproduce this problem.
You are running with sudo
. Is /usr/local/bin
in the path when running with sudo
?
Also, which version of Python are you running? I verified with several versions.
Could you add a line to __check_git_version()
to print-out PATH
as setup.py
sees it? I.e.:
def __check_git_version():
...
print('PATH:', os.environ['PATH'])
...
If all that doesn't reveal the root cause, could you bisect to figure out which commit introduced the problem?
from stgit.
[cel@klimt stgit]$ sudo python setup.py install
PATH: /sbin:/bin:/usr/sbin:/usr/bin
Traceback (most recent call last):
File "setup.py", line 67, in <module>
__check_git_version()
File "setup.py", line 55, in __check_git_version
gitver = Run('git', '--version').output_one_line().split()[2]
File "/home/cel/src/stgit/stgit/run.py", line 262, in output_one_line
outlines = self.output_lines(sep)
File "/home/cel/src/stgit/stgit/run.py", line 253, in output_lines
outdata = self._run_io()
File "/home/cel/src/stgit/stgit/run.py", line 151, in _run_io
raise self.exc('%s failed: %s' % (self._cmd[0], e))
stgit.run.RunException: git failed: [Errno 2] No such file or directory
[cel@klimt stgit]$ sudo echo $PATH
/home/cel/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
[cel@klimt stgit]$ sudo su
[root@klimt stgit]# echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin
[root@klimt stgit]#
It appears that /usr/local/bin is not in root's path.
from stgit.
Note that sudo echo $PATH
is not telling you the effective PATH
used by sudo
since $PATH
is expanded using your regular user's environment before sudo
is run.
Instead, use sudo env | grep PATH
or sudo $SHELL -c 'echo $PATH'
(with single-quotes so that $PATH
is not expanded early).
One possible solution: try sudo -E
which preserves your user environment in the sudo
environment. Although the sudo
man page indicates that PATH
is already transferred, unchanged, into the sudo
environment. You can test whether sudo -E env | grep PATH
produces a different path than without -E
.
Since this problem appears to be outside StGit's control, I'm going to close this issue.
from stgit.
Related Issues (20)
- Auto-`pop` a chain of patches to avoid merge conflicts HOT 1
- Non-stacky `pop`/`push` HOT 2
- "stg email" is very different than "stg mail" HOT 1
- stgit not finding user information HOT 3
- stg status: error: while expanding shell alias (program not found) HOT 1
- error: running editor: vi: The system cannot find the file specified. (os error 2)
- "stg pop --spill" leaves patch modifications staged HOT 1
- "new, pop, edit, refresh, push" results in empty top patch? HOT 5
- "stg branch some_other_branch --delete" deletes _current_ branch HOT 1
- Argv ordering requirements unnecessarily strict HOT 5
- FR: `swap` command for reordering patches - keeping tree contents the same at each HOT 3
- Question about stg edit
- stg mail --compose is not setting In-Reply-To or Reference from the cover letter.
- stg mail send with multiple --cc options only honors the first HOT 2
- feature request: stg whatchanged HOT 2
- feature request: stg move HOT 1
- Refresh installation documentation on https://stacked-git.github.io/ HOT 2
- [feature request]: run command on each (applied) patch HOT 3
- Renaming a commit as part of `stg refresh -e` ignores changes to the body HOT 1
- "stg import --reject" is broken
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stgit.