Skip to content

Commit

Permalink
tools: quick bugfix to vgit.v, after the previous commit message, tha…
Browse files Browse the repository at this point in the history
…t included a hash; TODO: a more robust check
  • Loading branch information
spytheman committed Aug 14, 2023
1 parent a93ef6e commit cdaabc1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/tools/modules/vgit/vgit.v
Expand Up @@ -58,7 +58,12 @@ pub fn prepare_vc_source(vcdir string, cdir string, commit string) (string, stri
scripting.run('git checkout --quiet master')
//
mut vccommit := ''
vcbefore_subject_match := scripting.run('git rev-list HEAD -n1 --timestamp --grep=${v_commithash[0..7]} ')
mut partial_hash := v_commithash[0..7]
if '5b7a1e8'.starts_with(partial_hash) {
// we need the following, otherwise --grep= below would find a93ef6e, which does include 5b7a1e8 in the commit message ... 🤦‍♂️
partial_hash = '5b7a1e84a4d283071d12cb86dc17aeda9b5306a8'
}
vcbefore_subject_match := scripting.run('git rev-list HEAD -n1 --timestamp --grep=${partial_hash} ')
scripting.verbose_trace(@FN, 'vcbefore_subject_match: ${vcbefore_subject_match}')
if vcbefore_subject_match.len > 3 {
_, vccommit = line_to_timestamp_and_commit(vcbefore_subject_match)
Expand Down

0 comments on commit cdaabc1

Please sign in to comment.