hoaproject / Devtools

The Hoa\Devtools library.
https://hoa-project.net/
6 stars 6 forks source link

Add the snapshot command #5

Closed Hywan closed 9 years ago

Hywan commented 9 years ago

Fix https://github.com/hoaproject/Devtools/pull/3.

Example of usage on Hoa\Ruler.

Only compute the CHANGELOG

$ hoa devtools:snapshot --only-changelog .

Here is the result:

HEAD

  • d156dca Add tests for the dynamic callable. (Ivan Enderlin, 2015-02-05T17:13:12+01:00)

    1.15.02.05

  • 55e35f5 Fix #50 on Github. (Ivan Enderlin, 2015-02-05T16:50:13+01:00)
  • a191132 Add tests for the context. (Ivan Enderlin, 2015-02-05T16:49:30+01:00)

    1.15.02.02

  • 1b5083f s/interprete/interpret/ (Ivan Enderlin, 2015-02-02T11:31:29+01:00)
  • e61fbb8 Apply reviews of @stephpy and @Savageman. (Ivan Enderlin, 2015-02-02T11:30:24+01:00)
  • 29f66fe Update Ruler.php (simkimsia, 2015-01-16T22:22:18+08:00)
  • 8c100b5 Merge branch 'pr/42' into incoming (Ivan Enderlin, 2015-01-15T13:34:30+01:00)
  • 38d59f8 Happy new year! (Ivan Enderlin, 2015-01-05T14:47:59+01:00)

    1.14.12.10

  • 2039f8e Move to PSR-4. (Ivan Enderlin, 2014-12-09T18:45:18+01:00)

    1.14.12.09

  • ad32e48 Merge branch 'pr/36' into incoming (Ivan Enderlin, 2014-12-09T18:25:25+01:00)
  • 32f6b1e Format namespace. (Ivan Enderlin, 2014-12-08T14:04:08+01:00)
  • f21c96c Require hoa/test. (Alexis von Glasow, 2014-11-26T13:21:41+01:00)
  • 07bf8b5 Hoa\Visitor has been finalized. (Ivan Enderlin, 2014-11-15T22:28:07+01:00)

    1.14.11.10

  • abc2201 Avoid collisions with user-defined operators… (Ivan Enderlin, 2014-11-10T15:43:04+01:00)

    1.14.11.09

  • d13f1e7 Merge branch 'pr/16' into incoming (Ivan Enderlin, 2014-11-07T09:29:55+01:00)
  • 3072567 Add tests for the documentation. (Ivan Enderlin, 2014-09-26T09:23:44+02:00)

    1.14.09.25

  • 60263c8 Fix Fatal error. (Stéphane PY, 2014-09-25T12:22:18+02:00)
  • 5d24414 Merge branch 'pr/20' into incoming (Ivan Enderlin, 2014-09-23T16:06:06+02:00)
  • b1ead69 Merge branch 'incoming' (Ivan Enderlin, 2014-09-23T15:58:55+02:00)

    1.14.09.23

  • 5a76729 First tag :-). (Ivan Enderlin, 2014-09-23T15:41:11+02:00)
  • b51ebd6 Finalized! (Ivan Enderlin, 2014-09-23T15:37:04+02:00)
  • d05bd3b Remove from/import and update to PHP5.4. (Ivan Enderlin, 2014-09-23T15:32:36+02:00)
  • 602a7c6 Declare array with […] and not (…). (Ivan Enderlin, 2014-09-23T14:58:18+02:00)

    0.14.09.17

  • 9ca61b5 Drop PHP5.3. (Ivan Enderlin, 2014-09-17T17:13:16+02:00)
  • 83db019 Add the installation section. (Ivan Enderlin, 2014-09-17T17:13:05+02:00)

0.14.09.16

(first snapshot)

We have only the first commit of every merges, no the children. This is a little bit annoying when the merge subject is “Merge branch 'pr/20' into incoming” for instance. In this case, we will edit the CHANGELOG manually because we will not rebase the Git history. To achieve that, I have to add an option to select a subset of tags to generate the CHANGELOG.

Create a snapshot

Else, if we would like to tag:

$ hoa devtools:snapshot .
Create tag 1.15.02.05 for repository /Users/Hywan/Development/Hoa/Project/Central/Hoa/Ruler? [yes/no] no
Aborted!

…

is the CHANGELOG.

Create a snapshot that breaks BC

If we broke the BC, we will have:

$ hoa devtools:snapshot --break-bc .
Create tag 2.15.02.05 for repository /Users/Hywan/Development/Hoa/Project/Central/Hoa/Ruler? [yes/no] no
Aborted!

…

It does not push for you and hopefully :-).

I don't know if “tagging” or “changeloging” must be exclusive tasks. I think it's better. First, generate the CHANGELOG (commit it, not automatic), then create the tag.

Thoughts?

Thanks to @camael24 and @Pierozi for their help!

Hywan commented 9 years ago

Should we keep entry dates?

Hywan commented 9 years ago

/ping @hoaproject/hoackers

Hywan commented 9 years ago

Could be great to include https://developer.github.com/v3/repos/releases/#create-a-release also.

Hywan commented 9 years ago

Maybe this command should evolve to a workflow assistant:

  1. here is the CHANGELOG since the last tag,
  2. did you commit the CHANGELOG?
  3. now the tag is created, you can push it with git push --tags,
  4. create a release on Github?

Thoughts?

Hywan commented 9 years ago

If so, the command should be renamed into hoa devtools:release.

thehawk970 commented 9 years ago

I thing "one command" "one things" like in Unix system :D So IMHO the short-hash on the begging of each line are useless, if you really want the information you check the tag commit no ?

You generate each time the changelog or you just add the lastest information ?

In my mind make sense to have : hoa devtools:changelog hoa devtools:tagging

Tagging are better than release IMHO :)

:+1:

Hywan commented 9 years ago

But commands can be done manually, they are very short and easy. Here it's more like an assistant to help us to not forget anything.

thehawk970 commented 9 years ago

:+1:

Pierozi commented 9 years ago

:+1: for assisant and hoa devtools:release with #create-a-release

Pierozi commented 9 years ago

in same time, that should be great to introduce a structure of commit message ? like include github issue ID ?

Hywan commented 9 years ago

@Pierozi: What do you mean by a structure of a commit message?

Pierozi commented 9 years ago

These messages are not useful for know what change are done

Merge branch 'incoming' Update Ruler.php

that should be :

Add Hoa\Core alias #43 Add method interpret() alias of interprete()

43 specified because it's from PR 43

CircleCode commented 9 years ago

Maybe we should look at what has been done by angularjs: see https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit# the idea is to normalize how commit are writen so that they can be parsed to produce human centric changelogs. Similar rules, with a pp file and some checks can enforce commit messages style, and facilitate changeogs production.

Hywan commented 9 years ago

@Pierozi Yes, for next commits, we will do better merge commit.

Hywan commented 9 years ago

So the patch introduces a real workflow through the following steps:

  1. tests must pass,
  2. updating the CHANGELOG.md file,
  3. commit the CHANGELOG.md file,
  4. creating a tag,
  5. pushing the tag,
  6. creating a release on Github.

Only the last one remains to do. If we have a BC break, few more steps are automatically “inserted”. Check the code, it's very easy to understand.

Hywan commented 9 years ago

The command is over. I just ask for a review of the CHANGELOG.md format. Here is an example:

1.15.02.12

  • 14dbf34 Fix CS and API documentation. (Ivan Enderlin, 2015-02-06T10:37:23+01:00)
  • 8b6bc1e Add lazy operator (Alexis von Glasow, 2014-12-15T23:42:34+01:00)
  • d156dca Add tests for the dynamic callable. (Ivan Enderlin, 2015-02-05T17:13:12+01:00)

1.15.02.05

  • 55e35f5 Fix #50 on Github. (Ivan Enderlin, 2015-02-05T16:50:13+01:00)
  • a191132 Add tests for the context. (Ivan Enderlin, 2015-02-05T16:49:30+01:00)

1.15.02.02

  • 1b5083f s/interprete/interpret/ (Ivan Enderlin, 2015-02-02T11:31:29+01:00)
  • e61fbb8 Apply reviews of @stephpy and @Savageman. (Ivan Enderlin, 2015-02-02T11:30:24+01:00)
  • 29f66fe Update Ruler.php (simkimsia, 2015-01-16T22:22:18+08:00)
  • 8c100b5 Merge branch 'pr/42' into incoming (Ivan Enderlin, 2015-01-15T13:34:30+01:00)
  • 38d59f8 Happy new year! (Ivan Enderlin, 2015-01-05T14:47:59+01:00)

1.14.12.10

  • 2039f8e Move to PSR-4. (Ivan Enderlin, 2014-12-09T18:45:18+01:00)

1.14.12.09

  • ad32e48 Merge branch 'pr/36' into incoming (Ivan Enderlin, 2014-12-09T18:25:25+01:00)
  • 32f6b1e Format namespace. (Ivan Enderlin, 2014-12-08T14:04:08+01:00)
  • f21c96c Require hoa/test. (Alexis von Glasow, 2014-11-26T13:21:41+01:00)
  • 07bf8b5 Hoa\Visitor has been finalized. (Ivan Enderlin, 2014-11-15T22:28:07+01:00)

Thoughts? /cc @hoaproject/hoackers

Everything else works like a charm. Editor opens to edit the new portion of the CHANGELOG.md. We have options to only execute some steps (only the test, only the changelog, only the tag, only Github releases etc.) This command is very useful :-).