Commit 3faaebd
committed
version: use vcs.revision for version.Build in
The build ID wasn't properly set/determined when calling `dlv version`
command. It kept showing the very old hash (not git hash though) of
`7e679e5860c17d90514f9c440e055355de831ce2`. This is because we are
searching for the git hash in build info via `gitrevision` key's value
which doesn't exist in the Go build info, and since we simply return
without error if nothing is found, it kept using the old hash of
`7e679e5860c17d90514f9c440e055355de831ce2` (note, I still couldn't
determine where this comes from, so I've maintained backwards
compatibility detailed below).
Go build info's git revision hash key is `vcs.revision`. So, I added
logic to search for that and attach its value to the version.Build
field. If nothing is found and haven't return its value, then we try
searching for `gitrevision` which maintains backwards compatibility.
Fixes #3986dlv version command1 parent f0cc62b commit 3faaebd
1 file changed
+17
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
12 | 16 | | |
13 | 17 | | |
14 | 18 | | |
15 | 19 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
20 | 33 | | |
21 | 34 | | |
22 | 35 | | |
0 commit comments