apt-cyg icon indicating copy to clipboard operation
apt-cyg copied to clipboard

Improve `--version` strings

Open eabase opened this issue 8 months ago • 1 comments

Hi,

First of all thank you for having maintained this super useful tool, for more than a decade! 🥇 💯

Cygwin have been my main Windows terminal for at least 2 decades, or at least 1 click away.

apt-cyg has been perfect since you started this repo. Thank you!

I now very rarely check this tool, but I wan't to keep it up-to-date, as you never known when you need something quickly. Therefore it would be useful to get some better info in the --version output.

  • Add your own versioning (or date?)
  • Maybe indicate if installed version has an update?
  • Add the full https:// to this repo (to make it clickable in Windows Terminal)
  • Add your own licensing terms (MIT)
# apt-cyg --version

kou1okada/apt-cyg
forked from transcode-open/apt-cyg

This script is based on apt-cyg version 0.57
Copyright (c) 2005-9 Stephen Jungels. Released under the GPL.
Copyright (c) 2013-7 Stephen Jungels. Republished under the MIT license.

Cheers!

eabase avatar Aug 17 '25 08:08 eabase

Thank you for your suggestion.

  • Add your own versioning (or date?)
  • Add the full https:// to this repo (to make it clickable in Windows Terminal)

These features are already implemented. If your apt-cyg is managed by git, you can get origin and commit of your apt-cyg as:

$ apt-cyg --version
kou1okada/apt-cyg
forked from transcode-open/apt-cyg
origin: https://github.com/kou1okada/apt-cyg.git
commit: 2023-07-24 13:55:33 +0900 0b27526 (HEAD -> master)

This script is based on apt-cyg version 0.57
Copyright (c) 2005-9 Stephen Jungels. Released under the GPL.
Copyright (c) 2013-7 Stephen Jungels. Republished under the MIT license.

For more details in source code, see here.

  • Maybe indicate if installed version has an update?

It's worth considering. Currently I'm not implementing any support for this case. But we you can get origin's latest commit as:

$ apt-cyg --version | awk '$1=="origin:"&&$0=$2' | (read; [ -n "$REPLY" ] && curl -Ls "$REPLY" | sed -nE 's/.*"currentOid":"([0-9a-z]*)".*/\1/p')
421c2a0ede60b63a5807d04930660dc419a38753

In this case, local apt-cyg is 0b27526 and origin's latest apt-cyg is 421c2a0, so it seems upgradable.

I'll consider adding this version check feature to my apt-cyg --version.

And in tnis situation, if you want to upgrade to 421c2a0, you just call upgrade-self sub-command as:

$ apt-cyg upgrade-self
POST git-upload-pack (188 bytes)
From https://github.com/kou1okada/apt-cyg
 = [up to date]      master                                  -> origin/master
 = [up to date]      Kaos-Industries-master                  -> origin/Kaos-Industries-master
 = [up to date]      cslycord-spacing-rebased                -> origin/cslycord-spacing-rebased
 = [up to date]      fix-issue-77                            -> origin/fix-issue-77
 = [up to date]      hash_check-for-transcode-open-master    -> origin/hash_check-for-transcode-open-master
 = [up to date]      improve-perfoemance-20220404            -> origin/improve-perfoemance-20220404
 = [up to date]      improve-performance                     -> origin/improve-performance
 = [up to date]      issue-104                               -> origin/issue-104
 = [up to date]      issue-105                               -> origin/issue-105
 = [up to date]      issue-112                               -> origin/issue-112
 = [up to date]      issue-116                               -> origin/issue-116
 = [up to date]      issue-20                                -> origin/issue-20
 = [up to date]      issue-88                                -> origin/issue-88
 = [up to date]      issue-90                                -> origin/issue-90
 = [up to date]      issue-92                                -> origin/issue-92
 = [up to date]      issue-93                                -> origin/issue-93
 = [up to date]      issue-96                                -> origin/issue-96
 = [up to date]      issue-97                                -> origin/issue-97
 = [up to date]      kyvli-master                            -> origin/kyvli-master
 = [up to date]      mettacrawler-patch-1                    -> origin/mettacrawler-patch-1
 = [up to date]      web                                     -> origin/web
 = [up to date]      yak1ex-choose_one_from_multiple_mirrors -> origin/yak1ex-choose_one_from_multiple_mirrors
Updating 0b27526..421c2a0
Fast-forward
 README.md |  3 ++-
 apt-cyg   | 89 +++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------
 2 files changed, 49 insertions(+), 43 deletions(-)
  • Add your own licensing terms (MIT)

Hmm, it's not bad. I'll consider it later.

Thanks.

kou1okada avatar Aug 18 '25 15:08 kou1okada