parent
8404cd7613
commit
91ffb04661
|
|
@ -39,6 +39,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
- Position:
|
- Position:
|
||||||
- Components marked as "Exclude from position files" not excluded when only
|
- Components marked as "Exclude from position files" not excluded when only
|
||||||
SMD components are selected. (See #429)
|
SMD components are selected. (See #429)
|
||||||
|
- Diff:
|
||||||
|
- KIBOT_TAG with n > 0 skipped n commits, not n tags (#430)
|
||||||
|
|
||||||
## [1.6.2] - 2023-04-24
|
## [1.6.2] - 2023-04-24
|
||||||
### Added
|
### Added
|
||||||
|
|
|
||||||
|
|
@ -251,6 +251,25 @@ class DiffOptions(BaseOptions):
|
||||||
for sub in self.git_submodules():
|
for sub in self.git_submodules():
|
||||||
self.stash_pop(sub)
|
self.stash_pop(sub)
|
||||||
|
|
||||||
|
def process_tags(self, num):
|
||||||
|
# Get a list of all tags ... and commits (how can I filter it?)
|
||||||
|
logger.debug('Looking for git tags')
|
||||||
|
res = self.run_git(['rev-list', '--tags', '--format=format:%D'])
|
||||||
|
if not res:
|
||||||
|
return res
|
||||||
|
res = res.split('\n')
|
||||||
|
commit = ''
|
||||||
|
skipped = 0
|
||||||
|
for v in res:
|
||||||
|
if v.startswith('tag: '):
|
||||||
|
tag = v.split(',')[0][4:]
|
||||||
|
logger.debugl(2, '- {}/{} tag: {} -> {}'.format(skipped, num, tag, commit))
|
||||||
|
if skipped == num:
|
||||||
|
return commit
|
||||||
|
skipped += 1
|
||||||
|
elif v.startswith('commit '):
|
||||||
|
commit = v[7:]
|
||||||
|
|
||||||
def solve_kibot_magic(self, name, tag):
|
def solve_kibot_magic(self, name, tag):
|
||||||
# The magic KIBOT_*
|
# The magic KIBOT_*
|
||||||
ori = name
|
ori = name
|
||||||
|
|
@ -265,12 +284,11 @@ class DiffOptions(BaseOptions):
|
||||||
num = int(name[1:])
|
num = int(name[1:])
|
||||||
except ValueError:
|
except ValueError:
|
||||||
raise KiPlotConfigurationError(malformed)
|
raise KiPlotConfigurationError(malformed)
|
||||||
num = str(num)
|
|
||||||
# Return its hash
|
# Return its hash
|
||||||
if tag == 'KIBOT_LAST':
|
if tag == 'KIBOT_LAST':
|
||||||
res = self.run_git(['log', '--pretty=format:%H', '--skip='+num, '-n', '1', '--', self.file])
|
res = self.run_git(['log', '--pretty=format:%H', '--skip='+str(num), '-n', '1', '--', self.file])
|
||||||
else: # KIBOT_TAG
|
else: # KIBOT_TAG
|
||||||
res = self.run_git(['rev-list', '--tags', '--skip='+num, '--max-count=1'])
|
res = self.process_tags(num)
|
||||||
if not res:
|
if not res:
|
||||||
raise KiPlotConfigurationError("The `{}` doesn't resolve to a valid hash".format(ori))
|
raise KiPlotConfigurationError("The `{}` doesn't resolve to a valid hash".format(ori))
|
||||||
logger.debug('- '+res)
|
logger.debug('- '+res)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue