Actions
Bug #10890
closedrevision.h が空になる
Description
Ubuntu 12.04 LTS のように git が古い環境だと revision.h が空になってしまいます。
原因を調べてみたところ -C オプションに対応していないからのようです。
% git --version
git version 1.7.9.5
% ruby -vd --disable=gems tool/file2lastrev.rb --revision.h .
ruby 2.3.0dev (2015-02-23) [x86_64-linux]
[["git", "-C", ".", "log", "-n1", "--date=iso", "--grep=^ *git-svn-id: .*@[0-9][0-9]*"]]
Unknown option: -C
usage: git [--version] [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
[-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
[--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
[-c name=value] [--help]
<command> [<args>]
(略)
Exception `VCS::NotFoundError' at /home/kazu/z/wc/CI/ruby/tool/vcs.rb:96 - last revision not found
file2lastrev.rb: last revision not found
そのままだと ruby -d でも何も出なかったので以下の変更をして試しました。
% git diff
diff --git a/tool/vcs.rb b/tool/vcs.rb
index 9d11b3b..29bcc95 100644
--- a/tool/vcs.rb
+++ b/tool/vcs.rb
@@ -81,7 +81,7 @@ class VCS
end
last, changed, modified, *rest = (
begin
- if NullDevice
+ if !$DEBUG && NullDevice
save_stderr = STDERR.dup
STDERR.reopen NullDevice, 'w'
end
Actions
Like0
Like0