vclog 1.10.0 → 1.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9cc7a6945a99a617bd6a0374187f3f86c24f32e04f03bb328001f75c71b933da
4
- data.tar.gz: 8033a3eb390daa38d015c1159b2d960cd76b54820a456e5b97a89585b9064d8d
3
+ metadata.gz: e03a567c2b6eb0b077e6c69bbeb643d84c0f79ab6c2c84c59ca7a58e91358c5d
4
+ data.tar.gz: 893c7b5856695524b61edac1af9d06b3f14a7959766c1a90c906f7443ba8afc1
5
5
  SHA512:
6
- metadata.gz: 3ef58ecb224ea05db5d2eaeb2a2a35b4f502fc25b581153cb0889bcb5562c54f0e321fc6c583551b707a3436887750e09128e2e4e95a946aed42ca907603b83c
7
- data.tar.gz: 30a815a2a2d3c388e6bf2a0080cddbc8f91968edc2b5800f45873726f886256a5a6c7a4593e5e0125880daa4f3880d2eb5dcfa8c397227481197f738b02137af
6
+ metadata.gz: a3215fa7b50d07b2cabfb834d672f85240c3337720faa55a5e0a5a25e795163a180c8606015cab68dc4265185a9423a90d821994a08d41b36f834bf61a0a0b07
7
+ data.tar.gz: ab55bffa0f1e11ed82ceb184efa44c6baae9df0f812545ab5d6b830e877925322a7f10262782772823f0d755a6fd1077028705d2c998a606a51aff097709b740
data/History.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # RELEASE HISTORY
2
2
 
3
+ ## 1.11.0 / 2026-11-24
4
+
5
+ VCLog's commands are now subcommands of `vclog`, in place of an
6
+ executable each.
7
+
8
+ Changes:
9
+
10
+ * Add `vclog version`, `vclog bump`, `vclog news`, `vclog formats` and
11
+ `vclog autotag`, which do what `vclog-version`, `vclog-bump`,
12
+ `vclog-news`, `vclog-formats` and `vclog-autotag` did.
13
+ * Add `vclog log`, the same as plain `vclog`, and `vclog history`, the
14
+ same as `vclog -r`.
15
+ * Add `vclog help`, which lists the commands, and `vclog help COMMAND`.
16
+ * Deprecate the separate executables. They still work, and will be
17
+ removed in 2.0.
18
+ * A first argument that isn't a command or an option is now an error.
19
+ Before, it was ignored.
20
+ * Autotag puts a release's tag on the latest commit made on or before
21
+ its date in the history file, counting the whole of that day. Before,
22
+ it stopped at the start of the day, so a release committed on its
23
+ own date was tagged one commit early. Its prompt now shows the
24
+ commit the tag will go on.
25
+ * Fix the `--prefix` and `--file` options of autotag: the first took no
26
+ value and the second raised an error.
27
+
28
+
3
29
  ## 1.10.0 / 2026-11-24
4
30
 
5
31
  The first release since 2012. It makes VCLog work on current Ruby (2.7
data/README.md CHANGED
@@ -36,9 +36,12 @@ To generate an a different format use -f:
36
36
 
37
37
  ### Creating Release Histories
38
38
 
39
- To get a release history specify `-r`, `--release` or `--history` option.
39
+ To get a release history use the `history` command.
40
40
 
41
- $ vclog -r
41
+ $ vclog history
42
+
43
+ The `-r`, `--release` or `--history` option of plain `vclog` does the
44
+ same.
42
45
 
43
46
  Again the default format is an ANSI colored GNU-like text style.
44
47
 
@@ -47,19 +50,20 @@ message is used as the release note. If the underlying SCM doesn't
47
50
  support tag messages than the message of the first commit prior to
48
51
  the tag is used.
49
52
 
50
- See `vclog --help` for more options.
53
+ See `vclog --help` for more options, and `vclog help` for the list of
54
+ commands.
51
55
 
52
56
  ### Bumping Versions
53
57
 
54
58
  VCLog can also be used to intelligently bump versions. To see the current
55
59
  tag version:
56
60
 
57
- $ vclog-version
61
+ $ vclog version
58
62
  1.1.0
59
63
 
60
64
  To see the next reasonable version based on current changes:
61
65
 
62
- $ vclog-bump
66
+ $ vclog bump
63
67
  1.2.0
64
68
 
65
69
  VCLog can determine the appropriate version based on commit level. Any
@@ -67,6 +71,17 @@ commit with a level greater than 1 will bump the major number, while any
67
71
  commit with a level of 0 or 1 will bump the minor number. All lower
68
72
  level only bump the patch level.
69
73
 
74
+ ### Other Commands
75
+
76
+ $ vclog news # the latest release note in the History file
77
+ $ vclog autotag # tag each release in the History file not yet tagged
78
+ $ vclog formats # list the output formats
79
+ $ vclog help # list the commands
80
+
81
+ Before 1.11 these were separate executables: `vclog-version`,
82
+ `vclog-bump`, `vclog-news`, `vclog-formats` and `vclog-autotag`. Those
83
+ still work, but are deprecated and will be removed in 2.0.
84
+
70
85
  ### Writing Heuristics
71
86
 
72
87
  VCLog can be configured to support custom log heuristics to suite the work flow
data/bin/vclog CHANGED
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'vclog/cli/log'
4
-
5
- VCLog::CLI::Log.run(ARGV)
3
+ require 'vclog/cli'
6
4
 
5
+ VCLog::CLI.run(ARGV)
data/bin/vclog-autotag CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'vclog/cli/autotag'
3
+ # Deprecated: use `vclog autotag`. Kept so that existing scripts go on working.
4
4
 
5
- VCLog::CLI::Autotag.run(ARGV)
5
+ require 'vclog/cli'
6
6
 
7
+ VCLog::CLI.run(['autotag'] + ARGV)
data/bin/vclog-bump CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'vclog/cli/bump'
3
+ # Deprecated: use `vclog bump`. Kept so that existing scripts go on working.
4
4
 
5
- VCLog::CLI::Bump.run(ARGV)
5
+ require 'vclog/cli'
6
6
 
7
+ VCLog::CLI.run(['bump'] + ARGV)
data/bin/vclog-formats CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'vclog/cli/formats'
3
+ # Deprecated: use `vclog formats`. Kept so that existing scripts go on working.
4
4
 
5
- VCLog::CLI::Formats.run(ARGV)
5
+ require 'vclog/cli'
6
6
 
7
+ VCLog::CLI.run(['formats'] + ARGV)
data/bin/vclog-news CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'vclog/cli/news'
3
+ # Deprecated: use `vclog news`. Kept so that existing scripts go on working.
4
4
 
5
- VCLog::CLI::News.run(ARGV)
5
+ require 'vclog/cli'
6
6
 
7
+ VCLog::CLI.run(['news'] + ARGV)
data/bin/vclog-version CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'vclog/cli/version'
3
+ # Deprecated: use `vclog version`. Kept so that existing scripts go on working.
4
4
 
5
- VCLog::CLI::Version.run(ARGV)
5
+ require 'vclog/cli'
6
6
 
7
+ VCLog::CLI.run(['version'] + ARGV)
@@ -13,14 +13,14 @@ module VCLog::CLI
13
13
  #
14
14
  def parser
15
15
  super do |opt|
16
- opt.banner = "Usage: vclog autotag"
16
+ opt.banner = "Usage: vclog autotag [options]"
17
17
  opt.separator(" ")
18
18
  opt.separator("DESCRIPTION:")
19
19
  opt.separator(" Ensure each entry in History has been tagged.")
20
20
  opt.separator(" ")
21
21
  opt.separator("SPECIAL OPTIONS:")
22
- opt.on('--prefix', '-p', 'tag label prefix'){ options[:prefix] = true }
23
- opt.on('--file' , '-f FILE', 'specify history file'){ options[:history_file] = file }
22
+ opt.on('--prefix', '-p PREFIX', 'tag label prefix'){ |prefix| options[:prefix] = prefix }
23
+ opt.on('--file' , '-f FILE', 'specify history file'){ |file| options[:history_file] = file }
24
24
  opt.on('--force' , '-y', 'perform tagging without confirmation'){ options[:force] = true }
25
25
  opt.on('--dryrun', '-n', 'run in dryrun mode'){ $DRYRUN = true }
26
26
  end
@@ -13,7 +13,7 @@ module VCLog::CLI
13
13
  #
14
14
  def parser
15
15
  super do |opt|
16
- opt.banner = "Usage: vclog-bump"
16
+ opt.banner = "Usage: vclog bump"
17
17
  opt.separator(" ")
18
18
  opt.separator("Display a bumped version number.")
19
19
  end
@@ -14,7 +14,9 @@ module VCLog::CLI
14
14
  #
15
15
  def parser
16
16
  super do |opt|
17
- opt.banner = "Usage: vclog-formats"
17
+ opt.banner = "Usage: vclog formats"
18
+ opt.separator(" ")
19
+ opt.separator("List the output formats.")
18
20
  end
19
21
  end
20
22
 
data/lib/vclog/cli/log.rb CHANGED
@@ -31,9 +31,10 @@ module VCLog::CLI
31
31
  # Returns a instance of OptionParser.
32
32
  def parser
33
33
  super do |parser|
34
- parser.banner = 'Usage: vclog [options]'
34
+ parser.banner = 'Usage: vclog [log|history] [options]'
35
35
  parser.separator(' ')
36
36
  parser.separator('Print a change log or release history.')
37
+ parser.separator('See `vclog help` for the other commands.')
37
38
  parser.separator(' ')
38
39
  parser.separator('OPTIONS: (use varies with format)')
39
40
  parser.on('-f', '--format FORMAT', 'output format (ansi,gnu,html,...)') do |format|
@@ -13,7 +13,7 @@ module VCLog::CLI
13
13
  #
14
14
  def parser
15
15
  super do |opt|
16
- opt.banner = "Usage: vclog-news"
16
+ opt.banner = "Usage: vclog news"
17
17
  opt.separator(" ")
18
18
  opt.separator("Display first release note from history file.")
19
19
  end
data/lib/vclog/cli.rb CHANGED
@@ -4,5 +4,93 @@ require 'vclog/cli/log'
4
4
  require 'vclog/cli/formats'
5
5
  require 'vclog/cli/bump'
6
6
  require 'vclog/cli/version'
7
+ require 'vclog/cli/news'
7
8
  require 'vclog/cli/autotag'
8
9
 
10
+ module VCLog
11
+
12
+ # The `vclog` command line. The first argument can name a command;
13
+ # without one, a change log is printed.
14
+ #
15
+ # vclog [log] [options]
16
+ # vclog history [options]
17
+ # vclog version
18
+ # vclog bump
19
+ # vclog news
20
+ # vclog formats
21
+ # vclog autotag [options]
22
+ # vclog help [command]
23
+ #
24
+ module CLI
25
+
26
+ # What each command does, in the order they are listed by `help`.
27
+ COMMANDS = [
28
+ ['log', Log, 'print a change log (the default)'],
29
+ ['history', Log, 'print a release history'],
30
+ ['version', Version, 'print the current version'],
31
+ ['bump', Bump, 'print the next version, judging by the changes'],
32
+ ['news', News, 'print the latest release note of the history file'],
33
+ ['formats', Formats, 'list the output formats'],
34
+ ['autotag', Autotag, 'tag each release in the history file not yet tagged']
35
+ ]
36
+
37
+ # Other names a command answers to.
38
+ ALIASES = { 'changelog'=>'log', 'release'=>'history', 'templates'=>'formats' }
39
+
40
+ #
41
+ # Run the command line.
42
+ #
43
+ def self.run(argv=ARGV)
44
+ argv = argv.dup
45
+ name = ALIASES[argv.first] || argv.first
46
+
47
+ case name
48
+ when 'help'
49
+ argv.shift
50
+ help(argv.first)
51
+ when 'history'
52
+ argv.shift
53
+ Log.run(['--history'] + argv)
54
+ else
55
+ command = COMMANDS.find{ |term, _, _| term == name }
56
+ if command
57
+ argv.shift
58
+ command[1].run(argv)
59
+ elsif name && name !~ /\A-/
60
+ $stderr.puts "vclog: unknown command -- #{name}"
61
+ $stderr.puts "Try `vclog help`."
62
+ exit(-1)
63
+ else
64
+ Log.run(argv)
65
+ end
66
+ end
67
+ end
68
+
69
+ #
70
+ # Print the list of commands, or the help of one of them.
71
+ #
72
+ def self.help(name=nil)
73
+ name = ALIASES[name] || name
74
+ command = COMMANDS.find{ |term, _, _| term == name }
75
+ if command
76
+ command[1].run(name == 'history' ? ['--history', '--help'] : ['--help'])
77
+ elsif name
78
+ $stderr.puts "vclog: unknown command -- #{name}"
79
+ exit(-1)
80
+ else
81
+ puts "Usage: vclog [command] [options]"
82
+ puts
83
+ puts "COMMANDS:"
84
+ COMMANDS.each do |term, _, description|
85
+ puts " %-9s %s" % [term, description]
86
+ end
87
+ puts " %-9s %s" % ['help', 'show this list, or the options of a command']
88
+ puts
89
+ puts "With no command, a change log is printed. See `vclog help log`"
90
+ puts "for its options."
91
+ end
92
+ end
93
+
94
+ end
95
+
96
+ end
data/lib/vclog/repo.rb CHANGED
@@ -84,16 +84,16 @@ module VCLog
84
84
 
85
85
  #
86
86
  # Read history file and make a commit tag for any release not already
87
- # tagged. Unless the force option is set the user will be prompted for
87
+ # tagged, on the latest commit made on or before the release's date. Unless the force option is set the user will be prompted for
88
88
  # each new tag.
89
89
  #
90
90
  def autotag(prefix=nil)
91
91
  history_file.tags.each do |tag|
92
92
  label = "#{prefix}#{tag.name}"
93
93
  if not adapter.tag?(label)
94
- chg = adapter.change_by_date(tag.date)
94
+ chg = adapter.change_by_date(end_of_day(tag.date))
95
95
  if chg
96
- if force? or ask_yn(new_tag_message(label, tag) + "\nCreate tag? [yN] ")
96
+ if force? or ask_yn(new_tag_message(label, tag, chg) + "\nCreate tag? [yN] ")
97
97
  adapter.tag(chg.rev, label, tag.date, tag.message)
98
98
  end
99
99
  else
@@ -281,8 +281,17 @@ module VCLog
281
281
  #
282
282
  # Returns a String.
283
283
  #
284
- def new_tag_message(label, tag)
285
- "#{label} / #{tag.date.strftime('%Y-%m-%d')}\n#{tag.message}"
284
+ def new_tag_message(label, tag, change)
285
+ "#{label} / #{tag.date.strftime('%Y-%m-%d')}\n#{tag.message}\n" +
286
+ "on commit #{change.id.to_s[0,7]} #{change.date.strftime('%Y-%m-%d %H:%M')} #{change.summary}"
287
+ end
288
+
289
+ #
290
+ # The last second of the day a time falls in. A release dated in the
291
+ # history file takes in the commits made during that day.
292
+ #
293
+ def end_of_day(time)
294
+ ::Time.new(time.year, time.month, time.day, 23, 59, 59)
286
295
  end
287
296
 
288
297
  end
data/lib/vclog/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module VCLog
2
- VERSION = '1.10.0'
2
+ VERSION = '1.11.0'
3
3
  end
data/man/man1/index.txt CHANGED
@@ -1,7 +1,5 @@
1
1
  # manuals
2
2
  vclog(1) vclog.1.ronn
3
- vclog-changelog(1) vclog-changelog.1.ronn
4
- vclog-history(1) vclog-history.1.ronn
5
3
  vclog-version(1) vclog-version.1.ronn
6
4
  vclog-news(1) vclog-news.1.ronn
7
5
  vclog-bump(1) vclog-bump.1.ronn
@@ -3,7 +3,7 @@ vclog-autotag(1) - tag history entries
3
3
 
4
4
  ## SYNOPSIS
5
5
 
6
- `vclog-autotag`
6
+ `vclog autotag`
7
7
 
8
8
  ## DESCRIPTION
9
9
 
@@ -3,7 +3,7 @@ vclog-bump(1) - suggest next version
3
3
 
4
4
  ## SYNOPSIS
5
5
 
6
- `vclog-bump`
6
+ `vclog bump`
7
7
 
8
8
  ## DESCRIPTION
9
9
 
@@ -3,7 +3,7 @@ vclog-news(1) - output latest release notice
3
3
 
4
4
  ## SYNOPSIS
5
5
 
6
- `vclog-news`
6
+ `vclog news`
7
7
 
8
8
  ## DESCRIPTION
9
9
 
@@ -11,7 +11,7 @@ Display the most recent entry in a project's history file. This command
11
11
  does NOT show the latest tag message, rather it is useful for making
12
12
  a new tag. For instnace:
13
13
 
14
- `vclog-news | git tag -a -F - v1.0.0`
14
+ `vclog news | git tag -a -F - v1.0.0`
15
15
 
16
16
  This command will create a new git tag using the most recent message in
17
17
  the history file.
@@ -3,7 +3,7 @@ vclog-version(1) - display current version
3
3
 
4
4
  ## SYNOPSIS
5
5
 
6
- `vclog-version`
6
+ `vclog version`
7
7
 
8
8
  ## DESCRIPTION
9
9
 
@@ -3,18 +3,53 @@ vclog(1) - version control logs
3
3
 
4
4
  ## SYNOPSIS
5
5
 
6
- `vclog [options]`
6
+ `vclog [command] [options]`
7
7
 
8
8
  ## DESCRIPTION
9
9
 
10
10
  VCLog is a versitle cross-VCS/SCM changelog and release history generator.
11
11
  It currently supports Git, Hg and (limited) Subversion.
12
12
 
13
+ ## COMMANDS
14
+
15
+ * `log`
16
+ Print a change log. This is the default when no command is given.
17
+
18
+ * `history`
19
+ Print a release history. The same as `vclog log --history`.
20
+
21
+ * `version`
22
+ Print the current version. See vclog-version(1).
23
+
24
+ * `bump`
25
+ Print the next version, judging by the changes. See vclog-bump(1).
26
+
27
+ * `news`
28
+ Print the latest release note of the history file. See vclog-news(1).
29
+
30
+ * `formats`
31
+ List the output formats.
32
+
33
+ * `autotag`
34
+ Tag each release in the history file not yet tagged. See vclog-autotag(1).
35
+
36
+ * `help` [<command>]
37
+ List the commands, or show the options of one.
38
+
39
+ The separate executables `vclog-version`, `vclog-bump`, `vclog-news`,
40
+ `vclog-formats` and `vclog-autotag` are deprecated and will be removed
41
+ in version 2.0.
42
+
13
43
  ## OPTIONS
14
44
 
45
+ These are the options of `log` and `history`.
46
+
15
47
  Note that not all formats support all options, and some formats use them
16
48
  in variant manners.
17
49
 
50
+ * `-r`, `--release`, `--history`
51
+ Print a release history instead of a change log.
52
+
18
53
  * `-f`, `--format <FORMAT>`
19
54
  Output format (ansi, rdoc, html, etc.)
20
55
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vclog
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.0
4
+ version: 1.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Trans