Project

General

Profile

Bug #10890

revision.h が空になる

Added by znz (Kazuhiro NISHIYAMA) about 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
ruby -v:
ruby 2.3.0dev (2015-02-23) [x86_64-linux]
[ruby-dev:48880]

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

Associated revisions

Revision 673af3e9
Added by nobu (Nobuyoshi Nakada) about 4 years ago

vcs.rb: do not use -C for older git

  • tool/vcs.rb (IO.popen): support :chdir option.
  • tool/vcs.rb (VCS::GIT.get_revisions): use :chdir option instead of -C option which is not supported by older git. [ruby-dev:48880] [Bug #10890]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 49705
Added by nobu (Nobuyoshi Nakada) about 4 years ago

vcs.rb: do not use -C for older git

  • tool/vcs.rb (IO.popen): support :chdir option.
  • tool/vcs.rb (VCS::GIT.get_revisions): use :chdir option instead of -C option which is not supported by older git. [ruby-dev:48880] [Bug #10890]

Revision 49705
Added by nobu (Nobuyoshi Nakada) about 4 years ago

vcs.rb: do not use -C for older git

  • tool/vcs.rb (IO.popen): support :chdir option.
  • tool/vcs.rb (VCS::GIT.get_revisions): use :chdir option instead of -C option which is not supported by older git. [ruby-dev:48880] [Bug #10890]

Revision 49705
Added by nobu (Nobuyoshi Nakada) about 4 years ago

vcs.rb: do not use -C for older git

  • tool/vcs.rb (IO.popen): support :chdir option.
  • tool/vcs.rb (VCS::GIT.get_revisions): use :chdir option instead of -C option which is not supported by older git. [ruby-dev:48880] [Bug #10890]

Revision 49705
Added by nobu (Nobuyoshi Nakada) about 4 years ago

vcs.rb: do not use -C for older git

  • tool/vcs.rb (IO.popen): support :chdir option.
  • tool/vcs.rb (VCS::GIT.get_revisions): use :chdir option instead of -C option which is not supported by older git. [ruby-dev:48880] [Bug #10890]

Revision 49705
Added by nobu (Nobuyoshi Nakada) about 4 years ago

vcs.rb: do not use -C for older git

  • tool/vcs.rb (IO.popen): support :chdir option.
  • tool/vcs.rb (VCS::GIT.get_revisions): use :chdir option instead of -C option which is not supported by older git. [ruby-dev:48880] [Bug #10890]

History

#1

Updated by nobu (Nobuyoshi Nakada) about 4 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

Applied in changeset r49705.


vcs.rb: do not use -C for older git

  • tool/vcs.rb (IO.popen): support :chdir option.
  • tool/vcs.rb (VCS::GIT.get_revisions): use :chdir option instead of -C option which is not supported by older git. [ruby-dev:48880] [Bug #10890]

Also available in: Atom PDF