Граф коммитов

64 Коммитов

Автор SHA1 Сообщение Дата
Takashi Kokubun 7edcdc380f
Avoid overwriting revision.h when .git doesn't exist (#6915)
* Avoid overwriting revision.h when .git doesn't exist

* Overwrite revision.h if it's blank
2022-12-12 23:34:30 -08:00
Nobuyoshi Nakada 8e2c70af14
file2lastrev.rb: changed revision may be `nil` [ci skip]
When `--suppress_not_found` option is given, no revision information
is available.  And remove extraneous newline, when result is empty or
ends with a newline.
2022-11-02 13:37:50 +09:00
Nobuyoshi Nakada 3475b66160
file2lastrev.rb: try to overwrite the found revision.h as before 2022-11-02 12:38:31 +09:00
Nobuyoshi Nakada ac06951c31
file2lastrev.rb: separate options for `Output` and `VPath`
So the `--srcdir` option in this file can override the same option in
`VPath`.
2022-11-02 12:38:03 +09:00
Nobuyoshi Nakada 6bf458eefd
file2lastrev.rb: use output.rb for the options 2022-11-01 14:34:05 +09:00
Nobuyoshi Nakada 7e6e94262c
file2lastrev.rb: rename output as format
Also:
- format -> time_format
- output -> formatter
2022-11-01 14:34:05 +09:00
Nobuyoshi Nakada 80da7250c5
file2lastrev.rb: Refactor VCS directory search
Search VCS directory after other options are in effective, i.e.,
`--srcdir=nonexitent --suppress_not_found` options, as well as the
reverse order case, should print the current date only and exit
successfully.
2022-10-12 22:24:53 +09:00
Nobuyoshi Nakada 5a5644dadc
Introduce `VCS::Null` for fallback 2022-09-30 10:39:42 +09:00
Takashi Kokubun 33c6dd2cc8
Fallback to VCS.release_date on VCS::NotFoundError
when -q is given.

One of the RubyCI servers, freebsd12, had a broken git environment:

```
$ git show
fatal: detected dubious ownership in repository at '/usr/home/chkbuild/chkbuild/tmp/build/20220917T123002Z/ruby'
To add an exception for this directory, call:

        git config --global --add safe.directory /usr/home/chkbuild/chkbuild/tmp/build/20220917T123002Z/ruby
```

tool/lib/vcs.rb doesn't work normally for that server.
Even for such cases, we'd like to generate a usable revision.h.

So this patch lets revision.h fallback to default VCS.release_date
when VCS::NotFoundError is raised.
2022-09-17 22:24:10 +09:00
Takashi Kokubun 38a7a13ac6
Auto-generate the release date on version.h from git CommitDate (#6382)
* Auto-generate the release date on version.h

from git CommitDate

* Generate revision.h on mswin
2022-09-17 21:16:06 +09:00
Nobuyoshi Nakada 462a8be511
VCS#revision_header: Make arguments optional 2022-09-01 20:57:30 +09:00
Nobuyoshi Nakada ee09f75a6b
Extract `VCS#revision_header` 2022-09-01 18:01:40 +09:00
Nobuyoshi Nakada 5511213487
Exit gently if no VCS found but --suppress_not_found is given 2019-09-07 17:26:28 +09:00
Nobuyoshi Nakada 5b5c9b6101
Removed no longer used variable 2019-09-07 17:26:28 +09:00
Nobuyoshi Nakada 8b290448e3
Assign to vcs in new_vcs block not to use rescue result 2019-09-07 11:56:23 +09:00
Nobuyoshi Nakada 59e29389a8
Fixed wrong method at 71f7b0421a 2019-09-07 11:47:45 +09:00
Nobuyoshi Nakada 71f7b0421a
Refined file2lastrev.rb options
* check --srcdir if given twice or more
* falls back to the current working directory if no --srcdir
  option is given.
* define common VCS options.
2019-09-07 11:38:38 +09:00
Hiroshi SHIBATA 0a711b0edf
Put vcs .rb to under the lib direcotory.
Because it's the common library for tool files.
2019-07-15 09:40:22 +09:00
Nobuyoshi Nakada fc4dd7d3e2
Git branch name can contain `#{}` too 2019-07-07 19:05:33 +09:00
Nobuyoshi Nakada 19a4c42d61
Unescape #{} in the last commit title
Get rid of unknown escape sequence warning, as `#` is not a
special character in C.

```
version.c:126:26: warning: unknown escape sequence '\#' [-Wunknown-escape-sequence]
    fputs("last_commit=" RUBY_LAST_COMMIT_TITLE, stdout);
                         ^~~~~~~~~~~~~~~~~~~~~~
revision.h:4:42: note: expanded from macro 'RUBY_LAST_COMMIT_TITLE'
                                         ^~
```
2019-07-07 19:01:48 +09:00
Nobuyoshi Nakada 8a1dd9b84b
Revert RUBY_RELEASE_DATE to date only 2019-06-21 23:48:49 +09:00
Takashi Kokubun f0bfa71ab3
Use UTC for file2lastrev timezone
02155da7ba got a claim about sacrificing
ability to compare arbitrary `RUBY_DESCRIPTION`s without converting
timezones.

Because most of the people would be familiar with timezone conversion
with UTC but it'd be harder when it comes to JST, this commit just
changes the timezone in f42588f754 to UTC.

Another bonus in using UTC is that we can use a shorter variant of
ISO 8601 format like "2019-06-10T14:26:24Z" (the last Z part).
2019-06-10 23:31:07 +09:00
Takashi Kokubun 02155da7ba
Make file2lastrev timezone consistent with git log
Using the same timezone for all commits is convenient when just looking
dates in RUBY_DESCRIPTION, but usually we also check `git log` when
we're interested in the order of commits.
`git log` shows times in committer's timezone and forcing RUBY_RELEASE_DATE
to JST makes it harder to find a corresponding commit from `git log`.

Because this label is only used in development, I believe there's no
strict requirement to use traditional timezone for release here.

Also when building Ruby after committing from a non-JST timezone, I'd be
surprised to see a strange time (in a different timezone) for my very new
commit in `ruby -v`.
2019-06-10 22:35:32 +09:00
Nobuyoshi Nakada f42588f754
Make RUBY_RELEASE_DATE full on development
I cannot tell the order just by commit hashes.
2019-06-08 20:08:18 +09:00
Nobuyoshi Nakada 3102ca4c6e
Default GIT external encoding to UTF-8 🤷‍♂️
And dump the title as US-ASCII.
2019-06-03 12:54:33 +09:00
Nobuyoshi Nakada d180e40570
Add --limit option and default it to 20 2019-05-31 10:55:37 +09:00
Nobuyoshi Nakada fd658ec821
Define RUBY_FULL_REVISION
Only if the short revision differs from the full revision.
2019-05-31 10:55:37 +09:00
Nobuyoshi Nakada a205e24747
Make RUBY_REVISION full length 2019-05-22 23:53:21 +09:00
Nobuyoshi Nakada 24684a81d2
Fix revision name
* tool/make-snapshot (package): use the last revision of the whole
  tree as the revision name, not a single file.

* tool/file2lastrev.rb: ditto.  dump without unnecessary subrange
  and literal quotes, to stringize SVN revisions properly.
2019-05-22 22:28:07 +09:00
Takashi Kokubun 5da52d1210
Migrate RUBY_VERSION/RUBY_DESCRIPTION to Git
from Subversion.

This behavior is tentative and not discussed well. The point of
discussion will be just the length of commit hash, and I thought we
should include this kind of change in 2.7.0-preview1 release even before
the length is fixed yet.

Let's discuss that afterwards and fix it later as needed. Naruse
suggested that length=10 is very unlikely to cause conflict, and thus
it's used by email notification and rubyci now. This behavior is in
favor of that for now.
2019-04-22 21:27:34 +09:00
nobu 951ef1d413 file2lastrev.rb: suppress_not_found
* tool/file2lastrev.rb: exit successfully when command not found,
  and if --suppress_not_found is given.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-06 11:18:53 +00:00
normal f8d0bdedf1 tool: add descriptions and fix typos
* tool/asm_parse.rb: add description
* tool/change_maker.rb: ditto
* tool/downloader.rb: ditto
* tool/eval.rb: ditto
* tool/expand-config.rb: ditto
* tool/extlibs.rb: ditto
* tool/fake.rb: ditto
* tool/file2lastrev.rb: ditto
* tool/gem-unpack.rb: ditto
* tool/gen_dummy_probes.rb: ditto
* tool/gen_ruby_tapset.rb: ditto
* tool/generic_erb.rb: ditto
* tool/id2token.rb: ditto
* tool/ifchange: ditto
* tool/insns2vm.rb: ditto
* tool/instruction.rb: ditto
* tool/jisx0208.rb: ditto
* tool/merger.rb: ditto
* tool/mkrunnable.rb: ditto
* tool/node_name.rb: ditto
* tool/parse.rb: ditto
* tool/rbinstall.rb: ditto
* tool/rbuninstall.rb: ditto
* tool/rmdirs: ditto
* tool/runruby.rb: ditto
* tool/strip-rdoc.rb: ditto
* tool/vcs.rb: ditto
* tool/vtlh.rb: ditto
* tool/ytab.sed: ditto
* tool/enc-unicode.rb: fix typo
* tool/mk_call_iseq_optimized.rb: ditto
* tool/update-deps: ditto
  [ruby-core:76215] [Bug #12539]
  by Noah Gibbs <the.codefolio.guy@gmail.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-02 21:01:04 +00:00
sorah b85a79107a * tool/file2lastrev.rb: Fix ArgumentError to work on Ruby 1.8.7.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-24 06:35:39 +00:00
nobu 80000c534c file2lastrev.rb: format for modified
* tool/file2lastrev.rb: add optional argument to --modified, for
  strftime format.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-23 09:36:22 +00:00
nobu b8081c7c4c file2lastrev.rb: all ARGV
* tool/file2lastrev.rb: output for each arguments.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-23 09:36:05 +00:00
nobu a8e289374a version.c: last commit title
* version.c (ruby_show_version): show last commit title, if
  different than the trunk.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-18 03:43:14 +00:00
nobu f8f2b0f165 file2lastrev.rb: no ellipsis shorter names
* tool/file2lastrev.rb (revision_h): do not truncate and ellipsis
  names shorter than the limit.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-17 15:03:07 +00:00
nobu e1aabbd397 file2lastrev.rb: limit branch names
* tool/file2lastrev.rb (revision_h): limit branch names upto 16
  chars, and replace extra part with ".." not to exceed the limit.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49305 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-17 13:56:40 +00:00
nobu 63491598c6 version.h: include branch name
* tool/file2lastrev.rb, tool/vcs.rb (get_revisions): define
  RUBY_BRANCH_NAME from the current branch name.

* version.h (RUBY_REVISION_STR): include the current branch name
  not "trunk" always.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-17 12:56:10 +00:00
nobu f024d46f11 tool/vcs.rb: no time.rb
* common.mk (Doxyfile): revert r43888, not to require preinstalled
  ruby.  [ruby-core:64488] [Bug #10161]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47248 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-22 06:36:46 +00:00
nobu 1ce82d510c rbinstall.rb: spec date from VCS
* tool/rbinstall.rb (Gem::Specification.load): obtain spec date from
  VCS for the case using git, RUBY_RELEASE_DATE is the last resort.
  probably fixes [Bug #9085].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-09 13:35:39 +00:00
nobu ae6f7929bd vcs.rb: split
* tool/vcs.rb: split from file2lastrev.rb.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-09 06:20:57 +00:00
knu c093401b0e * tool/file2lastrev.rb (VCS::detect): Add support for Subversion
1.7 which adopted a whole new working directory structure.

* tool/file2lastrev.rb (VCS::detect): Simply use .each instead of
  .sort.reverse_each which looks too arbitrary.	 If you want SVN
  to be tried first, then you just have to register it first as it
  is right now.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-02 13:14:24 +00:00
akr c68de8ee08 * tool/file2lastrev.rb: don't depend on pathname.rb if File.realpath
is available.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-17 09:30:54 +00:00
nobu 565d22756b * tool/file2lastrev.rb (VCS::SVN::get_revisions.): remind about
DOSISH, sometimes.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-16 07:51:18 +00:00
akr 77204d5391 * tool/file2lastrev.rb: use backtick for ruby 1.8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-15 12:55:11 +00:00
naruse 83724a77dd * tool/file2lastrev.rb: this should run with ruby 1.8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-15 12:14:45 +00:00
akr d9aab57252 * tool/file2lastrev.rb: make -q effective for files not version
controlled.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-15 11:43:09 +00:00
akr 8d8ff193b6 * tool/file2lastrev.rb (VCS#relative_to): path and @srcdir may have
different relative-ness.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-02 19:48:04 +00:00
nobu 4a6acc26d5 * tool/file2lastrev.rb (VCS::GIT_SVN): removed because git-log can
deal with git-svn repository faster than git-svn-info.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-30 04:11:24 +00:00