Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH v3 11/11] contrib: cc-cmd: ignore chunks with no original lines

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:56:55

Felipe Contreras [off-list ref] writes:
quoted hunk
Suggested-by: Junio C Hamano <redacted>
Signed-off-by: Felipe Contreras <redacted>
---
 contrib/cc-cmd/git-cc-cmd | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/cc-cmd/git-cc-cmd b/contrib/cc-cmd/git-cc-cmd
index 9a2d2fd..02841c4 100755
--- a/contrib/cc-cmd/git-cc-cmd
+++ b/contrib/cc-cmd/git-cc-cmd
@@ -125,7 +125,7 @@ class Commits
   end
 
   def get_blame(source, start, offset, from)
-    return unless source
+    return unless source and offset
I do not think a separate patch at the end is a good idea for a
fix-up like this, even if to give credit to others.

Just squashing it in to the original would help reviewers; that way,
they do not have to wonder "why is this broken" and later notice
"ah, it is fixed at the end".

I do not know if that is an "offset", though.  It is the "offset"
for the end of the block relative to its beginning, but people
usually call that the "size" of the block, I think.
     File.popen(['git', 'blame', '--incremental', '-C',
                '-L', '%u,+%u' % [start, offset],
                '--since', $since, from + '^',
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help