Git shortlog 不在 Jenkins 中显示输出 shell
Git shortlog does not show output in Jenkins shell
在使用 Jenkins 时遇到一些连线问题,
#!/bin/sh
set -x
#initialize environment
export PATH="$HOME/.gem/ruby/2.0.0/bin:$PATH"
export PATH="$HOME/.fastlane/bin:$PATH"
export LC_CTYPE=en_US.UTF-8
cd ~/autobuild/projects/MyAPP
git checkout dev
git reset head --hard
git pull
git shortlog
git log
当我 运行 来自 Jenkins 作业的上述脚本时,它显示 git 日志输出正常,但 git shortlog
没有显示。有什么问题吗? MyApp 有数百次提交。
我终于找到了原因,git shortlog
当你直接从终端使用时工作正常,因为,
git help shortlog
演出,
If no revisions are passed on the command line and either standard
input is not a terminal or there is no
current branch, git shortlog will output a summary of the log read from standard input, without reference to
the current repository.
因此您必须在使用 shell 脚本时明确提供参考,
git shortlog HEAD
在那种情况下可以正常工作。
在使用 Jenkins 时遇到一些连线问题,
#!/bin/sh
set -x
#initialize environment
export PATH="$HOME/.gem/ruby/2.0.0/bin:$PATH"
export PATH="$HOME/.fastlane/bin:$PATH"
export LC_CTYPE=en_US.UTF-8
cd ~/autobuild/projects/MyAPP
git checkout dev
git reset head --hard
git pull
git shortlog
git log
当我 运行 来自 Jenkins 作业的上述脚本时,它显示 git 日志输出正常,但 git shortlog
没有显示。有什么问题吗? MyApp 有数百次提交。
我终于找到了原因,git shortlog
当你直接从终端使用时工作正常,因为,
git help shortlog
演出,
If no revisions are passed on the command line and either standard input is not a terminal or there is no current branch, git shortlog will output a summary of the log read from standard input, without reference to the current repository.
因此您必须在使用 shell 脚本时明确提供参考,
git shortlog HEAD
在那种情况下可以正常工作。