git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git-gui blame dividing by zero
@ 2007-04-04 15:21 Andy Parkins
  2007-04-04 15:27 ` Shawn O. Pearce
  2007-04-04 16:11 ` Shawn O. Pearce
  0 siblings, 2 replies; 5+ messages in thread
From: Andy Parkins @ 2007-04-04 15:21 UTC (permalink / raw)
  To: Git Mailing List

Hello,

I've not used it before, but I thought I'd give it a go:

 $ git --version
 git version 1.5.1
 $ $ git-gui --version
 git-gui version 0.6.5
 $ git-gui blame HEAD somefile.cc

I just get a window that contains:

divide by zero
divide by zero
    while executing
"expr {100 * $blame_data($w,blame_lines)
			/ $blame_data($w,total_lines)}"
    (procedure "blame_incremental_status" line 4)
    invoked from within
"blame_incremental_status $w"
    (procedure "read_blame_catfile" line 27)
    invoked from within
"read_blame_catfile file6 {} HEAD 
somefile.cc .cm.t .out.loaded_t .out.linenumber_t .out.file_t"

Am I doing something wrong?


Andy
-- 
Dr Andy Parkins, M Eng (hons), MIET
andyparkins@gmail.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: git-gui blame dividing by zero
  2007-04-04 15:21 git-gui blame dividing by zero Andy Parkins
@ 2007-04-04 15:27 ` Shawn O. Pearce
  2007-04-04 16:11 ` Shawn O. Pearce
  1 sibling, 0 replies; 5+ messages in thread
From: Shawn O. Pearce @ 2007-04-04 15:27 UTC (permalink / raw)
  To: Andy Parkins; +Cc: Git Mailing List

Andy Parkins <andyparkins@gmail.com> wrote:
>  $ git-gui blame HEAD somefile.cc
> 
> I just get a window that contains:
> 
> divide by zero
> divide by zero
>     while executing
> "expr {100 * $blame_data($w,blame_lines)
> 			/ $blame_data($w,total_lines)}"
>     (procedure "blame_incremental_status" line 4)
>     invoked from within
> "blame_incremental_status $w"
>     (procedure "read_blame_catfile" line 27)
>     invoked from within
> "read_blame_catfile file6 {} HEAD 
> somefile.cc .cm.t .out.loaded_t .out.linenumber_t .out.file_t"

Heh.  So we came up with no lines in the file.  Weird.  What does
git-blame produce on the same arguments?  What about with the
--incremental flag?

I'll dig into git-gui and see what I can do to more gracefully
handle this condition, but right now I'm thinking we didn't get
any data from git...

-- 
Shawn.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: git-gui blame dividing by zero
  2007-04-04 15:21 git-gui blame dividing by zero Andy Parkins
  2007-04-04 15:27 ` Shawn O. Pearce
@ 2007-04-04 16:11 ` Shawn O. Pearce
  2007-04-05  8:33   ` Andy Parkins
  1 sibling, 1 reply; 5+ messages in thread
From: Shawn O. Pearce @ 2007-04-04 16:11 UTC (permalink / raw)
  To: Andy Parkins; +Cc: Git Mailing List

Andy Parkins <andyparkins@gmail.com> wrote:
>  $ git-gui blame HEAD somefile.cc
> 
> I just get a window that contains:
> 
> divide by zero
> divide by zero

OK, I'm a total noob sometimes.  That code was obviously getting
0 into a variable, and then blindly dividing by the variable's value.

I just pushed a new patch to my git-gui.git repository, its now in
both the maint and master branches.  Please give that a try.  ;-)

-- 
Shawn.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: git-gui blame dividing by zero
  2007-04-04 16:11 ` Shawn O. Pearce
@ 2007-04-05  8:33   ` Andy Parkins
  2007-04-05  8:44     ` Andy Parkins
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Parkins @ 2007-04-05  8:33 UTC (permalink / raw)
  To: git; +Cc: Shawn O. Pearce

On Wednesday 2007 April 04 17:11, Shawn O. Pearce wrote:

> I just pushed a new patch to my git-gui.git repository, its now in
> both the maint and master branches.  Please give that a try.  ;-)

Okay - it's an improvement - no more divide by zero error.  However, I don't 
get any output.  Just an empty window with HEAD:somefile.cc in it.

The following both give lots of output:

 $ git blame HEAD -- somefile.cc 
 $ git blame --incremental HEAD -- somefile.cc

So; I think you've fixed a nasty bug, but that bug was only presenting because 
something else is messed up.  I'll poke around and see what I can discover 
(however, I don't understand tk so what I discover might be that I don't 
understand tk :-)).



Andy

-- 
Dr Andy Parkins, M Eng (hons), MIET
andyparkins@gmail.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: git-gui blame dividing by zero
  2007-04-05  8:33   ` Andy Parkins
@ 2007-04-05  8:44     ` Andy Parkins
  0 siblings, 0 replies; 5+ messages in thread
From: Andy Parkins @ 2007-04-05  8:44 UTC (permalink / raw)
  To: git; +Cc: Shawn O. Pearce

On Thursday 2007 April 05 09:33, Andy Parkins wrote:

> So; I think you've fixed a nasty bug, but that bug was only presenting
> because something else is messed up.  I'll poke around and see what I can
> discover (however, I don't understand tk so what I discover might be that I
> don't understand tk :-)).

Okay - got it.  Try this in the git repository:

 # this works
 $ git-gui blame HEAD templates/hooks--commit-msg
 $ cd templates
 # this doesn't work
 $ git-gui blame HEAD hooks--commit-msg
 # this works
 $ git-gui blame HEAD templates/hooks--commit-msg

The problem is that git-gui is calling git-cat-file to read the file, but 
git-cat-file expects a path from the repository root.  The current directory 
doesn't matter - you always have to type the path as if you're in the working 
dir root.



Andy
-- 
Dr Andy Parkins, M Eng (hons), MIET
andyparkins@gmail.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-04-05  8:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-04 15:21 git-gui blame dividing by zero Andy Parkins
2007-04-04 15:27 ` Shawn O. Pearce
2007-04-04 16:11 ` Shawn O. Pearce
2007-04-05  8:33   ` Andy Parkins
2007-04-05  8:44     ` Andy Parkins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).