Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid messing up tags with dashes #84

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Avoid messing up tags with dashes #84

wants to merge 1 commit into from

Conversation

jengelh
Copy link
Contributor

@jengelh jengelh commented Oct 8, 2015

When @PARENT_TAG@ is something like "foo-7.2.1-rc2", then using
versionformat="@[email protected]@TAG_OFFSET@" would cause
"foo7.2.1rc2.g123" to be emitted, which is — from my side — totally undesired.

@aspiers
Copy link
Member

aspiers commented Oct 9, 2015

I can sympathise with the intention behind the change, but this seems to cause valid test failures, e.g.

AssertionError: 'repo-2015-10-08 18:13:44 +0000.tar' != 'repo-20151008T181344.tar'

so I suspect it needs a slightly more sophisticated approach than just removing this conversion.

@jengelh
Copy link
Contributor Author

jengelh commented Oct 9, 2015

Here is an update. Not sure why travis fails, I can't make sense of what E302 is supposed to be.

@marcus-h
Copy link
Member

marcus-h commented Oct 9, 2015

On 2015-10-09 07:28:38 -0700, jengelh wrote:

Here is an update. Not sure why travis fails, I can't make sense of what E302 is supposed to be.

module level functions should be separated by 2 blank lines
(just insert a newline after line 431 and 439).

When @PARENT_TAG@ is something like "7.2.1-rc2", then using
versionformat="@[email protected]@TAG_OFFSET@" would cause "7.2.1rc2.g123"
rather than "7.2.1-rc2.g123" to be emitted, which is undesired.

The function version_iso_cleanup is in the way. This function is
supposed to transform the output of %ad/%cd into %Y%m%d. However,
version_iso_cleanup modifies the entire string rather than just the
portion belonging to %ad, causing the above problem.

Therefore, we mark the %ad portion, by changing %ad to something like
"<ad<%ad>>" before feeding it to git-log. This yields "<ad<Fri Oct 9
...>>", which can be found more exactly by a regex. I choose '<' and
'>' as metacharacters because those cannot appear in a rpm version
number.

Secondly, "Fri Oct 9" looks inherently locale-specific, providing
another problem point. It is safer to internally rewrite %ad to %at.
@aspiers
Copy link
Member

aspiers commented Jun 21, 2016

It seems there are still AssertionErrors in the latest Travis build, e.g.

AssertionError: 'repo-2015-12-08 23:46:25 +0000.tar' != 'repo-20151208T234625.tar'

@M0ses
Copy link
Collaborator

M0ses commented Mar 13, 2019

@jengelh Is this still relevant or could we just close the issue?

@jengelh
Copy link
Contributor Author

jengelh commented Mar 14, 2019

Issues don't magically disappear, so yeah, still relevant.

@hramrach
Copy link
Contributor

hramrach commented Apr 6, 2021

Should be resolved with #390

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants