Skip to content

should ouptput commitid / sha of executed .java file #1972

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

Open
koppor opened this issue Mar 25, 2025 · 3 comments
Open

should ouptput commitid / sha of executed .java file #1972

koppor opened this issue Mar 25, 2025 · 3 comments
Labels
ideas Some idea/suggestion around jbang behavior/feature set

Comments

@koppor
Copy link

koppor commented Mar 25, 2025

Is your feature request related to a problem? Please describe.

Current output:

[jbang] Trusting permanently: [https://github.com/koppor/ghprcomment/]
jbang https://github.com/koppor/ghprcomment/blob/main/ghprcomment.java
[jbang] Downloading JDK 21. Be patient, this can take several minutes...
[jbang] Installing JDK 21...
[jbang] Default JDK set to 21 (21.0.6+7-LTS, 21-jbang, /jbang/.jbang/cache/jdks/21)
[jbang] Resolving dependencies...
[jbang]    org.kohsuke:github-api:2.0-rc.1
[jbang]    one.util:streamex:0.8.3
[jbang]    me.tongfei:progressbar:0.10.1
[jbang]    org.jline:jline-terminal:3.29.0
[jbang]    org.eclipse.collections:eclipse-collections:11.1.0
[jbang]    info.picocli:picocli:4.7.6
[jbang]    org.yaml:snakeyaml:2.4
[jbang]    org.jooq:jool:0.9.15
[jbang]    org.tinylog:tinylog-api:2.7.0
[jbang]    org.tinylog:tinylog-impl:2.7.0
[jbang]    org.tinylog:slf4j-tinylog:2.7.0
[jbang] Dependencies resolved
[jbang] Building jar for ghprcomment.java...

Describe the solution you'd like

jbang should output the sha in case of a git repository. This is useful when executing a branched thign.

Describe alternatives you've considered

Outputting some version / commigt id in the .java itself.

Additional context

When developing things, branches change.

(And in my current setting, I think, jbang-action does not update the .java file; but I need to check somehow)

@koppor koppor added the ideas Some idea/suggestion around jbang behavior/feature set label Mar 25, 2025
@maxandersen
Copy link
Collaborator

I'm not following what you are asking for? what sha are you after ? jbang isn't (techinically) aware the file is a git repo, its http fetched resource.

@koppor
Copy link
Author

koppor commented Mar 26, 2025

Oh, I wasn't aware that jbang magically routes the request to.the raw GitHub URL without extracting version information.

@maxandersen
Copy link
Collaborator

what are you trying to get at? to notice that you are running a cached version or enforce getting the latest or ensure you get what you think you are getting?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ideas Some idea/suggestion around jbang behavior/feature set
Projects
None yet
Development

No branches or pull requests

2 participants