[前][次][番号順一覧][スレッド一覧]

ruby-changes:56021

From: Takashi <ko1@a...>
Date: Wed, 5 Jun 2019 20:23:52 +0900 (JST)
Subject: [ruby-changes:56021] Takashi Kokubun: f3c877e8de (trunk): Ignore ~/.gitconfig on tool/vcs.rb git commands

https://git.ruby-lang.org/ruby.git/commit/?id=f3c877e8de

From f3c877e8deaea91ff27c0fca837c9388d030a896 Mon Sep 17 00:00:00 2001
From: Takashi Kokubun <takashikkbn@g...>
Date: Wed, 5 Jun 2019 20:07:19 +0900
Subject: Ignore ~/.gitconfig on tool/vcs.rb git commands

Because some `log.*` git configs may change the result of `git log`,
`RUBY_LAST_COMMIT_TITLE` can be wrongly formatted and break version.c
compilation. So the `git log` executions should not respect user's gitconfig.

diff --git a/tool/vcs.rb b/tool/vcs.rb
index 618a788..86e7e50 100644
--- a/tool/vcs.rb
+++ b/tool/vcs.rb
@@ -399,7 +399,7 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L399
     end
 
     def self.cmd_read_at(srcdir, cmds)
-      IO.pread(*cmd_args(cmds, srcdir))
+      without_gitconfig { IO.pread(*cmd_args(cmds, srcdir)) }
     end
 
     def self.get_revisions(path, srcdir = nil)
@@ -444,6 +444,13 @@ class VCS https://github.com/ruby/ruby/blob/trunk/tool/vcs.rb#L444
       rev[0, 10]
     end
 
+    def self.without_gitconfig
+      home = ENV.delete('HOME')
+      yield
+    ensure
+      ENV['HOME'] = home if home
+    end
+
     def initialize(*)
       super
       if srcdir = @srcdir and self.class.local_path?(srcdir)
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]