@@ -137,12 +137,14 @@ pub mut:
137
137
vexepath string // the full absolute path to the prepared v/v.exe
138
138
vvlocation string // v.v or compiler/ or cmd/v, depending on v version
139
139
make_fresh_tcc bool // whether to do 'make fresh_tcc' before compiling an old V.
140
+ show_vccommit bool // show the V and VC commits, corresponding to the V commit-ish, that can be used to build V
140
141
}
141
142
142
143
pub fn (mut vgit_context VGitContext) compile_oldv_if_needed () {
143
144
vgit_context.vexename = if os.user_os () == 'windows' { 'v.exe' } else { 'v' }
144
145
vgit_context.vexepath = os.real_path (os.join_path_single (vgit_context.path_v, vgit_context.vexename))
145
- if os.is_dir (vgit_context.path_v) && os.is_executable (vgit_context.vexepath) {
146
+ if os.is_dir (vgit_context.path_v) && os.is_executable (vgit_context.vexepath)
147
+ && ! vgit_context.show_vccommit {
146
148
// already compiled, no need to compile that specific v executable again
147
149
vgit_context.commit_v__hash = get_current_folder_commit_hash ()
148
150
return
@@ -152,7 +154,8 @@ pub fn (mut vgit_context VGitContext) compile_oldv_if_needed() {
152
154
clone_or_pull (vgit_context.vc_repo_url, vgit_context.path_vc)
153
155
scripting.chdir (vgit_context.path_v)
154
156
scripting.run ('git checkout --quiet ${vgit_context.commit_v} ' )
155
- if os.is_dir (vgit_context.path_v) && os.exists (vgit_context.vexepath) {
157
+ if os.is_dir (vgit_context.path_v) && os.exists (vgit_context.vexepath)
158
+ && ! vgit_context.show_vccommit {
156
159
// already compiled, so no need to compile v again
157
160
vgit_context.commit_v__hash = get_current_folder_commit_hash ()
158
161
return
@@ -162,6 +165,13 @@ pub fn (mut vgit_context VGitContext) compile_oldv_if_needed() {
162
165
vgit_context.commit_v__hash = v_commithash
163
166
vgit_context.commit_v__ts = v_timestamp
164
167
vgit_context.commit_vc_hash = vccommit_before
168
+
169
+ if vgit_context.show_vccommit {
170
+ println ('VHASH=${vgit_context.commit_v__hash} ' )
171
+ println ('VCHASH=${vgit_context.commit_vc_hash} ' )
172
+ exit (0 )
173
+ }
174
+
165
175
if os.exists ('cmd/v' ) {
166
176
vgit_context.vvlocation = 'cmd/v'
167
177
} else {
0 commit comments