问题描述
如何通过 gitpython 执行这个命令?
import git
git.Git("<directory-name").execute('git show 610003c068d8bb5ca3c2a6b8bbde76cbc6ff281a --word-diff-regex="([a-zA-Z0-9_]+)" | sed -n "s/.*[-([a-zA-Z_]*)-]{+([a-zA-Z_0-9]*)+}.*/\1 \2/p" | sort | uniq')
raise GitCommandError(redacted_command,status,stderr_value,stdout_value)
git.exc.GitCommandError: Cmd('g') failed due to: exit code(128)
cmdline: g i t s h o w 2386879h237gd8yy8v8yeg8yg9b1927j - - w o r d - d i f f - r e g e x = " ( [ a - z A - Z 0 - 9 _ ] + ) " | s e d - n " s / . * \ [ - \ ( [ a - z A - Z _ ] * \ ) - \ ] { + \ ( [ a - z A - Z _ 0 - 9 ] * \ ) + } . * / ☺ ☻ / p " | s o r t | u n i q
stderr: 'b"fatal: ambiguous argument '|': unknown revision or path not in the working tree.\nUse '--' to separate paths from revisions,like this:\n'git <command> [<revision>...] -- [<file>...]'"'
从 .py 文件运行时遇到此错误。
public function beforeSave($insert) {
/* for example if my form date format is: dd-mm-yyyy
You must change it for yyyy-mm-dd before saving into DDBB */
if (!empty($this->date_of_birth )) {
$this->date_of_birth = Yii::$app->formatter->asDate($this->date_of_birth,'php:Y-m-d');
}
return parent::beforeSave($insert);
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)