-
Notifications
You must be signed in to change notification settings - Fork 205
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
Identify BiT dev build by git hash #1637
Comments
Dear ptilopteri, I like that idea. And we have this still implemented somehow. If BIT starts from a git repo then you will find the current git hash in the About dialog. Lines 1842 to 1846 in c65fc91
But I also support the idea to add the git hash (and branch name maybe) to the version string and also maybe in the window title. Next time when reporting please consider the use of correct upper case letters (e.g. beginn of sentences, the word "I", ...). It is then more easier to read for us and others. Thanks in advance. |
* buhtz ***@***.***> [02-05-24 08:30]:
Dear ptilopteri,
thanks for your report.
I like that idea. And we have this still implemented somehow. If BIT starts from a git repo then you will find the current git hash in the About dialog.
https://github.com/bit-team/backintime/blob/c65fc917a245bdf7dbedc7b12768bf51be39d2c9/qt/app.py#L1842-L1846
But I also support the idea to add the git hash (and branch name maybe) to the version string and also maybe in the window title.
Next time when reporting please consider the use of correct upper case letters (e.g. beginn of sentences, the word "I", ...). It is then more easier to read for us and others. Thanks in advance.
Message ID: ***@***.***>
rather obtuse method to obtain current build version. shouldn't
"backintime --versin" show this instead of just showing "1.4.4-dev"?
…--
(paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri
http://en.opensuse.org openSUSE Community Member facebook/ptilopteri
Photos: http://wahoo.no-ip.org/piwigo paka @ IRCnet oftc
|
Yes I agree that the git hash could be an element of the regular version string (only in dev versions of course). I forgot to mention that also
|
If we make sure to disable this for regular releases, I see no disadvantages :) |
The current code works only if it runs from a git repo. After doing I am not a pro when it comes to FYI: The version string of BIT is "hardcoded" into the |
* buhtz ***@***.***> [02-05-24 09:44]:
Yes I agree that the git hash could be an element of the regular version string (only in dev versions of course).
But I don't decide this own my own. Let's wait for arguments of other team members.
I forgot to mention that also `--diagnostics` show the git infos.
```
$ ./backintime --diagnostics
{
"backintime": {
"git-project-root": "/home/UsernameReplaced/mluCloud/my.work/bit/backintime",
"git-branch": "fix/1634restrictpylint",
"git-hash": "8c3f7ff6ba063115f56df8d40913afdabc175fa3"
}
}
```
Message ID: ***@***.***>
not for what I just built"
"backintime": {
"name": "Back In Time",
"version": "1.4.4-dev",
"latest-config-version": 6,
"local-config-file": "/home/UsernameReplaced/.config/backintime/config",
"local-config-file-found": true,
"global-config-file": "/etc/backintime/config",
"global-config-file-found": false,
"started-from": "/usr/share/backintime/common",
"running-as-root": false,
"user-callback": "/home/UsernameReplaced/.config/backintime/user-callback",
"keyring-supported": true
},
…--
(paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri
http://en.opensuse.org openSUSE Community Member facebook/ptilopteri
Photos: http://wahoo.no-ip.org/piwigo paka @ IRCnet oftc
|
You build/installed BIT from the cloned repo via I agree this is a shortcoming and we should find a solution for this. And I need to correct my last post: The version is not "hardcoded" in To my knowledge of the Filesystem Hierarchy Standard (FHS) a file containting the current git hash (and other static meta information) should be generated/installed into EDIT: EDIT2: Adding this line in the Makefile to get branch and hash in json format.
Of course replace
|
I have a solution in mind and I would like to present the details in a PR. Before that I would like to know if there are arguments against having such an extra file in |
Hmm. I'm not well-informed on this topic, but it seems a bit like overkill. How do other projects do it? There's probably a lot of software that includes its git version in shipped packages. Is this something that might work more "naturally" once we eliminate |
Yes, I also would treat this as an temporary workaround until we find a better solution.
Good question. I guess that C/C++ and other compile-linking languages do inject the version string into their source files (e.g. via configure/make) before starting the compiler. But it is just a guess.
Very good question! 😄 I will ask the community. But to my current low expertise on that topic I would add a "custom build step" to inject git info somewhere in the source files. I am not sure. It feels also like a workaround or hack. |
About a pythonic solution: It seems to be that there are plugins for the several Python build-tools (e.g. setuptools, hatchling) solving that problem without hacking around. I will investigate a solution further in my demo project. Anyway. This won't happen early. As a short solution and workaround I currently see only this extra file generated while Maybe Jürgen will have another idea. |
* buhtz ***@***.***> [02-06-24 04:41]:
I have solution in mind I would like to present the details in a PR. Before that I would like to know if there are arguments against having such an extra file in `/usr/share/backintime/common` and `/usr/share/backintime/qt` containing the branch at git hash at build time?
Message ID: ***@***.***>
not if "backintime --version" reported it.
…--
(paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri
http://en.opensuse.org openSUSE Community Member facebook/ptilopteri
Photos: http://wahoo.no-ip.org/piwigo paka @ IRCnet oftc
|
* buhtz ***@***.***> [02-06-24 05:18]:
> it seems a bit like overkill.
Yes, I also would treat this as an temporary workaround until we find a better solution.
> How do other projects do it? There's probably a lot of software that includes its git version in shipped packages.
Good question. I guess that C/C++ and other compile-linking languages do inject the version string into their source files (e.g. via configure/make) before starting the compiler. But it is just a guess.
> Is this something that might work more "naturally" once we eliminate `make` and move to "modern" python packaging?
Very good question! 😄 I will ask the community. But to my current low expertise on that topic I would add a "custom build step" to inject git info somewhere in the source files. I am not sure. It feels also like a workaround or hack.
Message ID: ***@***.***>
darktable does it: https://github.com/darktable-org/darktable
…--
(paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri
http://en.opensuse.org openSUSE Community Member facebook/ptilopteri
Photos: http://wahoo.no-ip.org/piwigo paka @ IRCnet oftc
|
The point is that the git commit hash shall only be injected into a non-release build. So we need either
I propose to extend our
PS: The commit hash is a hex number so it may never contain the word |
I would suggest a slightly different and IMHO easier to implement approach. The version.txt (better When BIT asking for its version string (via
This would cover all known to me use cases. |
BIT use the last commit hash in its version string if it is a "*-dev" version. Additionally some refactoring: - "Config.VERSION" moved into new file "version.py" as "__version__" - "diagnostics.py::get_git_repository_info()" moved to "tools.py". - Removed "tools.py::gitRevisionAndHash()" Some more - File "VERSION" no longer part of "make install" target Close #1637
you have closed this but the last build incorporating this patch, cf02bee,
does not display the current level of 1.4.4-dev, nor does it indicate any
way for a non-programmer to find it.
backintime --version
backintime 1.4.4-dev
???
|
Have you re installed BIT common and BIT qt as described here?
The git hash is determined only when calling
This might not fulfill all your needs but it is how we have discussed it the related PR #1640. |
> Have you re installed BIT common and BIT qt as described [here](https://github.com/bit-team/backintime/blob/dev/CONTRIBUTING.md#build-and-install-via-make-system-recommended)?
that is what I just said.
and applied your patch for opensuse tumbleweed.
|
@aryoda Is that the reason why you wanted to add the "updateversion.sh" call to the "make install" target? Make sense now to me. 🤣 |
@buhtz Yes, every "manual protocol" to follow ("step-by-step" TODO lists) may be forgotten or applied in the wrong way so |
I vote to close this issue as "fixed" since "building" with Edit: Looks like Starting BiT directly from the repo without installing it does not inject the Git hash but |
The git-hash is added to every "*.dev" version string while calling "make install". Close #1637
BiT development builds report version as "backintime 1.4.4-dev" which actually provides little identification.
I propose appending the last commit id to "backintime 1.4.4-dev.c65fc91" so one can tell that his dev version needs updating
The text was updated successfully, but these errors were encountered: