Default GIT external encoding to UTF-8 πŸ€·β€β™‚οΈ

And dump the title as US-ASCII.
This commit is contained in:
Nobuyoshi Nakada 2019-06-03 12:26:23 +09:00
Π ΠΎΠ΄ΠΈΡ‚Π΅Π»ΡŒ 17af8bfce6
ΠšΠΎΠΌΠΌΠΈΡ‚ 3102ca4c6e
НС Π½Π°ΠΉΠ΄Π΅Π½ ΠΊΠ»ΡŽΡ‡, ΡΠΎΠΎΡ‚Π²Π΅Ρ‚ΡΡ‚Π²ΡƒΡŽΡ‰ΠΈΠΉ Π΄Π°Π½Π½ΠΎΠΉ подписи
Π˜Π΄Π΅Π½Ρ‚ΠΈΡ„ΠΈΠΊΠ°Ρ‚ΠΎΡ€ ΠΊΠ»ΡŽΡ‡Π° GPG: 4BC7D6DF58D8DF60
2 ΠΈΠ·ΠΌΠ΅Π½Ρ‘Π½Π½Ρ‹Ρ… Ρ„Π°ΠΉΠ»ΠΎΠ²: 7 Π΄ΠΎΠ±Π°Π²Π»Π΅Π½ΠΈΠΉ ΠΈ 1 ΡƒΠ΄Π°Π»Π΅Π½ΠΈΠΉ

ΠŸΡ€ΠΎΡΠΌΠΎΡ‚Ρ€Π΅Ρ‚ΡŒ Ρ„Π°ΠΉΠ»

@ -59,6 +59,9 @@ vcs = nil
when :revision_h
Proc.new {|last, changed, modified, branch, title|
short = vcs.short_revision(last)
if /[^\x00-\x7f]/ =~ title and title.respond_to?(:force_encoding)
title = title.dup.force_encoding("US-ASCII")
end
[
"#define RUBY_REVISION #{short.inspect}",
("#define RUBY_FULL_REVISION #{last.inspect}" unless short == last),

ΠŸΡ€ΠΎΡΠΌΠΎΡ‚Ρ€Π΅Ρ‚ΡŒ Ρ„Π°ΠΉΠ»

@ -32,6 +32,7 @@ if RUBY_VERSION < "2.0"
if opts.kind_of?(Hash)
dir = opts.delete(:chdir)
rest.pop if opts.empty?
opts.delete(:external_encoding)
end
if block
@ -66,6 +67,7 @@ if RUBY_VERSION < "2.0"
if opts.kind_of?(Hash)
dir = opts.delete(:chdir)
rest.pop if opts.empty?
opts.delete(:external_encoding)
end
command = command.shelljoin if Array === command
@ -384,8 +386,9 @@ class VCS
COMMAND = ENV["GIT"] || 'git'
def self.cmd_args(cmds, srcdir = nil)
(opts = cmds.last).kind_of?(Hash) or cmds << (opts = {})
opts[:external_encoding] ||= "UTF-8"
if srcdir and local_path?(srcdir)
(opts = cmds.last).kind_of?(Hash) or cmds << (opts = {})
opts[:chdir] ||= srcdir
end
cmds