Skip to content
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

Can we add oneline revision signature in About? #1258

Open
stefanos82 opened this issue Jun 27, 2023 · 2 comments · May be fixed by #1319
Open

Can we add oneline revision signature in About? #1258

stefanos82 opened this issue Jun 27, 2023 · 2 comments · May be fixed by #1319

Comments

@stefanos82
Copy link

When we build a stable release it should indeed show

image

but when we pull the latest changes from the repo and build the code ourselves, we should get something like

image

Is it plausible to add this feature?

I'm asking because if I hit a bug, I won't be able to know which commit revision is responsible for the cause of buggy behavior so I can report it.

@lwindolf
Copy link
Owner

Would need some extensive automake magic.

@stefanos82
Copy link
Author

stefanos82 commented Jul 17, 2023

Hmm, well with cmake you can do it as follows:

elseif(GIT_FOUND)
    execute_process(
        COMMAND ${GIT_EXECUTABLE} rev-list --max-count=1 HEAD
        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
        OUTPUT_VARIABLE TR_VCS_REVISION
        OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()

Code snippet directly taken from https://github.com/transmission/transmission/blob/main/CMakeLists.txt#L154-L160

Logically with makefile you can run something like $(shell git rev-list --max-count=1 HEAD) and will give you the same output as above.

Update: I have found this solution in case you would like to see how it can be implemented: https://stackoverflow.com/a/15376953

@bbhtt bbhtt linked a pull request Oct 24, 2023 that will close this issue
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 a pull request may close this issue.

2 participants