Skip to content

Conversation

@ludviggunne
Copy link
Collaborator

No description provided.


url="https://github.com/danmar/simplecpp"

tag="$(git ls-remote --tags --sort=-v:refname "$url" | head -1 | cut -f2)"
Copy link
Collaborator

@firewave firewave Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice - that should could also be used in daca to get rid of the hard-coded version.

Copy link
Owner

@danmar danmar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really understand ..

  • a script just to help you copy 2 files? I think it's pretty quick and easy to do manually.
  • I would prefer a python script it is easier to maintain.
    It's imho ok to execute "git" in a python script rather than importing some strange python libraries..

@firewave
Copy link
Collaborator

firewave commented Jul 10, 2025

  • a script just to help you copy 2 files? I think it's pretty quick and easy to do manually.

This way it documents what to do and could be easily run without much copy and paste.

A additional step could be to automatically generate a Cppcheck PR when a new tag is created in the simplecpp repo. Which would leverage the script.

@danmar
Copy link
Owner

danmar commented Jul 10, 2025

This way it documents what to do and could be easily run without much copy and paste.

Documentating the release process etc is valuable. However plain text is less "cryptic". Imho a python script would also be less "cryptic". I.e. instead of head -1 | cut -f2 it is better with corresponding python code.

This way it documents what to do and could be easily run without much copy and paste.

I don't know I still feel I loose a bit of control here. Many things can go wrong if it's used wrongly. Ensure that it can't be used wrongly.

It will always blindly pick latest release... so if I tag a release candidate then the release candidate will be picked.

It would probably be better to commit automatically to enforce that the commit message contains the tag that is used.

And I think some better checking could be good before any files are copied at all.

  • Ensure that current branch is main branch. Not some feature branch.
  • Ensure that main branch is uptodate. No extra commits/changes.
  • => the commit should only contain the expected changes no unrelated changes.
  • whatever other error conditions we can imagine..

@ludviggunne ludviggunne force-pushed the 13998 branch 3 times, most recently from c5e2a1f to c5204c5 Compare July 30, 2025 16:13
@sonarqubecloud
Copy link

Copy link
Owner

@danmar danmar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still feel a python script will be more maintainable in the future.

I get this error when I try this:

daniel@dator:~/cppchecksolutions/cppcheck$ bash update-simplecpp.sh 1.5.0 ~/simplecpp/
HEAD är nu på 29abbc6 fix #337 - line splicing in comment not handled properly (#431)
ödesdigert: inte ett git-arkiv (eller någon av föräldrakatalogerna): .git

the first line is not required imho.

that error output does not help much I don't know what the script was trying to accomplish.

@firewave
Copy link
Collaborator

See #7659 for way to leverage this.

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.

3 participants