Closed Mizuchi closed 9 months ago
It seems that I am not processing strip levels (e.g. 1 here for b/ prefix) for patches doing file additions or removals. I'll need to revisit my code to see why I did that before I relax that restriction. This might take a while as I am currently traveling. Meanwhile you can apply this patch and see if it doesn't break other things for you.
diff --git a/autoload/patchreview.vim b/autoload/patchreview.vim
index dd19fa9..3623ee5 100644
--- a/autoload/patchreview.vim
+++ b/autoload/patchreview.vim
@@ -673,9 +673,9 @@ function! patchreview#extract_diffs(lines, default_strip_count) "{{{
let g:patches['patch'] += [l:this_patch]
unlet! l:this_patch
call s:me.progress('Collected ' . l:filepath)
- if l:p_type == '!'
+ "if l:p_type == '!'
call s:guess_prefix_strip_value(l:filepath, a:default_strip_count)
- endif
+ "endif
let l:line_num -= 1
call s:state('START')
continue
Your patch works for me. Thanks!
I have patched it locally the same, it works for me!
It looks like patchreview-vim didn't handle new files in diff correctly. Here is an example to reproduce this issue
Basically it simply added a new file in the last commit. When I was "DiffReview git diff HEAD^" to review the diff for the last commit, I got such error: