santinic / how2

AI for the Command Line
https://how2terminal.com
MIT License
5.72k stars 156 forks source link

Tag releases #60

Closed onovy closed 2 months ago

onovy commented 8 years ago

Hi,

can you use (ideally signed) tags for every release? This makes package maintainers life easier.

Thank you.

danyshaanan commented 8 years ago

:+1:

This line:

git --no-pager log --format='git checkout %H && git tag %s' -G '"version":' package.json

Will identify commits that changed the version in package.json, and output this:

git checkout a454baa05765163667ec89e2d8657a36f78998c7 && git tag 1.0.9
git checkout 1d8c6cada9eda7c0eb03735dd5d0505d2d831a97 && git tag 1.0.8
git checkout 121b599b8dbfc9594ca5cc94994647e02bfe0dab && git tag 1.0.7
git checkout 1f6c2fe25e2d496f6c1f04ab2f4f43887ab7316e && git tag 1.0.6
git checkout 22fecdd67bdc36b0b7862ceb1876e0967b21d1a0 && git tag 1.0.5
git checkout 12b09973daf1f3015fd0a03b192417936c58d2a0 && git tag 1.0.4
git checkout f79e5899bca0a1207368d75eaa303af067917e81 && git tag 1.0.3
git checkout 41ed066f4258d6e8dac9680a84d5eead4f944698 && git tag 1.0.2
git checkout 4967ee96a56f6a3537a79755dea506877d556d88 && git tag changed name
git checkout 3019fa3be046ddd18f0ab490e2866e72b15be961 && git tag kinda working, still bad ui

Fixing the last two lines with 1.0.1 and 1.0.0 will let you easily add the missing tags. Then just push them with:

git push --tag

Also, npm info how2 will show that...:

{ name: 'how2',
  description: 'Uses Google and Stackoverflow to find how to do things on a Unix commmand line',
  'dist-tags': { latest: '1.0.9' },
  versions:
   [ '1.0.0',
     '1.0.1',
     '1.0.2',
     '1.0.4',
     '1.0.5',
     '1.0.7',
     '1.0.8',
     '1.0.9' ]
  // more fields...
}

...this cover all releases.

(All of this assumes that the package was always released right after the package.json version change...)