jbang icon indicating copy to clipboard operation
jbang copied to clipboard

should ouptput commitid / sha of executed .java file

Open koppor opened this issue 8 months ago • 3 comments

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 avatar Mar 25 '25 16:03 koppor

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.

maxandersen avatar Mar 26 '25 17:03 maxandersen

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

koppor avatar Mar 26 '25 17:03 koppor

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?

maxandersen avatar Mar 26 '25 17:03 maxandersen