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

Create a rolling MCVersionInfo for all projects. #261

Closed

Conversation

LeonMatthes
Copy link
Contributor

This allows users to easily update Squot projects that are installed using Metacello.
If the version of the project the user requests to install is not higher than the currently installed version, Metacello will not install the newly requested version.

This patch essentially fakes a version number by simply using the seconds since start of the Unix epoch. Whilst not ideal, it is a good-enough workaround for, as git commits don't have a single incrementing version number.

I've used this patch for a while now with great success in my Autocompletion project.
The artifacts generated by this patch look like this:
https://github.com/MrModder/Autocompletion/blob/master/packages/Autocompletion.package/monticello.meta/package
https://github.com/MrModder/Autocompletion/blob/master/packages/Autocompletion.package/monticello.meta/version

This allows users to easily update Squot projects that are installed using Metacello.
If the version of the project the user requests to install is not higher than the currently installed version, Metacello will not install the newly requested version.
@LeonMatthes
Copy link
Contributor Author

LeonMatthes commented May 4, 2020

Also note, that the commit in this patch already generated version info for the Squot package, as can be seen in the Files changed:
https://github.com/hpi-swa/Squot/pull/261/files#diff-07d09bd5a2f9bfb9b4682124f7b7e740
https://github.com/hpi-swa/Squot/pull/261/files#diff-176cb8fd0d1d08a37574fc6c1cb91d11

Which would allow users of Squot to simply upgrade to new Squot versions by running

Metacello new
  baseline: 'Squot';
  repository: 'github://hpi-swa/Squot:master/src';
  get;
  load.

@j4yk
Copy link
Collaborator

j4yk commented May 4, 2020

Hi @MrModder,

Hmm, actually we were quite happy when FileTree eventually got metadata-less and those files could be left out. They are badly mergeable (although maybe less so in this form with just one version info) and so ruin every pull request. ;-) Hence I am hesitant to introduce them again.

Can't the update issue be resolved with the following in the Baseline class of your project?

projectClass

   ^ MetacelloCypressBaselineProject

See Metacello/metacello#513
https://pharoweekly.wordpress.com/2016/07/19/metacello-support-for-gitfiletree-metadata-less-mode/

@j4yk
Copy link
Collaborator

j4yk commented May 4, 2020

For example, Squot itself can be updated as you wrote, without any version metadata.

@LeonMatthes
Copy link
Contributor Author

Ah, alright, I wasn't aware of this Metacello feature.
I suggest adding your explanation to Squot's README, so everyone using Squot + Metacello is aware they have to add this to their Baselines. Or is there any reason not to use MetacelloCypressBaselineProject?

@j4yk
Copy link
Collaborator

j4yk commented May 5, 2020

No reason that I know of.

It is not really a Squot thing, the README also does not tell you that you should create a Baseline anyway... but it can't hurt to mention this in the README either. Would you like to suggest a text?

@LeonMatthes
Copy link
Contributor Author

I created a separarte PR for this, so the changes in this one can be discarded:
#262

@LeonMatthes LeonMatthes closed this May 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants