v.util.version: fix output for V full version#24478
Conversation
- vhash() function returns full hash (C.V_COMMIT_HASH) ; length = 50, see v/util/version/version.c.v - vcurrent_hash() returns short form (length = 7) Signed-off-by: Laurent Cheylus <foxy@free.fr>
|
Connected to Huly®: V_0.6-22847 |
|
I do not understand what problem is that solving? Can you please answer in more details what is the previous behavior that you observed, what is the new one, that you want it to have, and why do you think it should change? |
|
In
If |
|
Perhaps there is a misunderstanding - I can read the diff just fine, and I am not asking you about it. I am asking about the observed behavior before, Those are questions that I can not answer by just reading the diff in general. |
|
Sometimes that context is revealed by additional tests, but that is not always possible, or it can be difficult to reproduce the original problem without a lot of setup work. Sometimes the context can be in an issue, that describes in more details, what you tried to achieve/wanted and what prevented you from that. |
|
I don't quite understand your questions but I will try to explain my logic with that fix.
I'm just trying to fix an comparison ALWAYS false. If you think that is better to keep the full version as Personally I think it's better to have only |
I think that such changes should be done after careful consideration about the observed behavior, and given that you did not provide the before/after comparisons, but did at least point out the previous issue (indirectly ...), I will need to read it in more details, and do the before/after observations myself, before approving or rejecting this PR. |
|
The output of In this case, they are the same (the part after the . is just a shortened version of the longer hash). The output of the same command: The same behavior is observed, if the .git/ folder is renamed/removed (simulating the effect of producing a .zip release and using it on a user machine): |
|
The new behavior is closer to the observed behavior of the .zip/release versions (only showing the full hash). |



vhash()function returns full hash (C.V_COMMIT_HASH) ; length = 50, seev/util/version/version.c.vvcurrent_hash()returns short form (length = 7)Tests OK on Linux Debian/testing
With a clean Git worktree (
C.V_COMMIT_HASH == vcurrent_hash())With a dirty Git worktree (
C.V_COMMIT_HASH != vcurrent_hash())