version icon indicating copy to clipboard operation
version copied to clipboard

Weird issue with commit number going hex on me

Open sburkett opened this issue 5 years ago • 1 comments

I have this in version.yml:

commit:
  mode: increment
  length: 6
  increment-by: 1

But when I move from commit number "10" to what should be "11", things move to "10e". Am I missing something?

sburkett avatar Apr 14 '21 20:04 sburkett

After further review, it would seem that incrementing the commit level is always done this way:

    public function incrementCommit($by = null)
    {
        $result = $this->increment(function ($config) use ($by) {
            $increment_by = $by ?: $config['commit']['increment-by'];

            $config['current']['commit'] = $this->incrementHex($config['current']['commit'], $increment_by);

            return $config;
        }, 'commit.number');

        event(Constants::EVENT_COMMIT_INCREMENTED);

        return $result;
    }

Not sure why that is, but I would think having this in the config should increment it by a value of 1 (decimal, not hex) just like the major, minor, etc.

commit:
  mode: increment
  length: 6
  increment-by: 1

sburkett avatar Apr 23 '21 16:04 sburkett