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.
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.
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.
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'
^~
```
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).
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`.
* 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.
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.
* 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
* 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
* 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
* 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
* 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
* 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
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