threads / announce / 3206

[Announce] gitview-0.1

Subject: [Announce] gitview-0.1

## tl;dr

9 messages between Feb 1, 2006 and Feb 1, 2006.

replies: 8people: 6as markdown or json

Aneesh Kumar· Feb 1, 2006, 04:16 UTC · lore
Hi,

Gnome based git repository browser. The code is derived from bazaar-ng repository browser.

To see how it looks
http://www.flickr.com/photos/17388011@N00/92918446/

I don't have a web location where i can host it so i am attaching it below. It would be great if we can get it added to git repository

sample usage takes same argument as git rev-list

gitview --since=2.week.ago
-aneesh
Dave Jones· Feb 1, 2006, 04:29 UTC · re: Aneesh Kumar · lore

Re: [Announce] gitview-0.1

On Wed, Feb 01, 2006 at 09:46:59AM +0530, Aneesh Kumar wrote:
 > I don't have a web location where i can host it so i am attaching it below.
 > It would be great if we can get it added to git repository
 > 
 > sample usage
 > takes same argument as git rev-list
 > 
 > gitview --since=2.week.ago
Nice, here's your first patch against it :-)

The one thing I like about gitk over this though is that with gitk you don't have to click a button to see the diff. For casual history browsing, it's much nicer to just scroll the bottom window. Making it pop up a new window for each diff is just irritating.

		Dave

--- gitview~ 2006-01-31 23:24:36.000000000 -0500 +++ gitview 2006-01-31 23:24:49.000000000 -0500

@@ -254,7 +254,7 @@ class DiffWindow:
 	def __init__(self):
 		self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
 		self.window.set_border_width(0)
-		self.window.set_title("Git reposotiry browser diff window")
+		self.window.set_title("Git repository browser diff window")
 
 		# Use two thirds of the screen by default
 		screen = self.window.get_screen()
Aneesh Kumar· Feb 1, 2006, 04:41 UTC · re: Dave Jones · lore

Re: [Announce] gitview-0.1

On 2/1/06, Dave Jones <davej@redhat.com> wrote:
Show 17 quoted lines
> On Wed, Feb 01, 2006 at 09:46:59AM +0530, Aneesh Kumar wrote:
>
>  > I don't have a web location where i can host it so i am attaching it below.
>  > It would be great if we can get it added to git repository
>  >
>  > sample usage
>  > takes same argument as git rev-list
>  >
>  > gitview --since=2.week.ago
>
> Nice, here's your first patch against it :-)
>
> The one thing I like about gitk over this though is that with gitk
> you don't have to click a button to see the diff.
> For casual history browsing, it's much nicer to just scroll the bottom
> window. Making it pop up a new window for each diff is just irritating.
>

I always browse the repository looking at the commit message and only if interested i look at the changes. That's why i made it look that way.

-aneesh
Aneesh Kumar· Feb 1, 2006, 11:28 UTC · re: Aneesh Kumar · lore

Re: [Announce] gitview-0.1

On 2/1/06, Aneesh Kumar <aneesh.kumar@gmail.com> wrote:
> On 2/1/06, Dave Jones <davej@redhat.com> wrote:
[..snip...]
Show 10 quoted lines
> >
> > The one thing I like about gitk over this though is that with gitk
> > you don't have to click a button to see the diff.
> > For casual history browsing, it's much nicer to just scroll the bottom
> > window. Making it pop up a new window for each diff is just irritating.
> >
>
> I always browse the repository looking at the commit message and only
> if interested i look at the changes.  That's why i made it look that
> way.

with gitview (attached) I have added an option --with-diff. That will add the diff details. Now I would like somebody with good git knowledge to review the different commands that i am using to get information out of git For example with --with-diff option i am getting the complete diff by

for parent_id in parent_sha1 parent_sha2 parent_sha3 ....... commit_diff = commit_diff + git diff tree -p parent_id commit_sha1

is this the correct way ?
-aneesh
Junio C Hamano· Feb 1, 2006, 20:01 UTC · re: Aneesh Kumar · lore

Re: [Announce] gitview-0.1

Aneesh Kumar <aneesh.kumar@gmail.com> writes:
> for parent_id in  parent_sha1 parent_sha2 parent_sha3 .......
> commit_diff = commit_diff + git diff tree -p parent_id commit_sha1
>
> is this the correct way ?

Are parent_sha$N true parents of commit_sha1? If you want to get three independent diffs, "git diff-tree -m -p $commit_sha1" would give that to you in one go.

Linus Torvalds· Feb 1, 2006, 20:17 UTC · re: Junio C Hamano · lore

Re: [Announce] gitview-0.1

On Wed, 1 Feb 2006, Junio C Hamano wrote:
> 
> Are parent_sha$N true parents of commit_sha1?  If you want to
> get three independent diffs, "git diff-tree -m -p $commit_sha1"
> would give that to you in one go.
Btw, I think we should change
	git-diff-tree --stdin
to look at the rest of the line.

Right now it _only_ takes the commit from that line, along with possibly the first parent if one exists (if one is not listed, the list of parents will be correctly taken from the commit).

Which makes it mostly useless for merges with a dense history.

Especially with the new "-cc" flag, using it for merges really does make a lot of sense, but it's not workable.

So right now, git-whatchanged does
	git-rev-list | git-diff-tree --stdin <filelist>

which means that it handles merges in a pruned-down history wrong. Now, that's ok, because it currently never prunes the history of git-rev-list (it instead prunes purely in git-diff-tree). So it works right, and can take the -cc flag because it always gets the parent information from the commit.

HOWEVER, currently doing the pruning the other way around, ie
	git-rev-list --parents <filelist> | git-diff-tree --stdin

does _not_ work right. It ignores anything but the first parent, because "git-diff-tree --stdin" doesn't understand merges.

And doing the pruning the other way around would actually make sense sometimes. Not for git-whatchanged (where doing the pruning in git-diff-tree means that we don't have to parse the history ahead of time, so we get immediate feedback), but in a git-annotate context you want to do the pruning ahead-of-time. So git-diff-tree not supporting it is sad ;(

		Linus
Junio C Hamano· Feb 1, 2006, 20:34 UTC · re: Linus Torvalds · lore

Re: [Announce] gitview-0.1

Linus Torvalds <torvalds@osdl.org> writes:
Show 5 quoted lines
> Btw, I think we should change
>
> 	git-diff-tree --stdin
>
> to look at the rest of the line.

Yes it is one of the "broken things I am aware of". It does not even show --pretty for the same reason, and I was planning to do a fake commit objects to handle them (taking the message from commit, locally grafting the parents from the line to it).

Alex Riesen· Feb 1, 2006, 20:58 UTC · re: Aneesh Kumar · lore

Re: [Announce] gitview-0.1

Aneesh Kumar, Wed, Feb 01, 2006 05:16:59 +0100:
Show 16 quoted lines
> 
> Gnome based git repository browser. The code is derived from bazaar-ng
> repository browser.
> 
> To see how it looks
> 
> http://www.flickr.com/photos/17388011@N00/92918446/
> 
> I don't have a web location where i can host it so i am attaching it below.
> It would be great if we can get it added to git repository
> 
> sample usage
> takes same argument as git rev-list
> 
> gitview --since=2.week.ago
> 

Doesn't really work here: no tree like on your screenshot, and a lot of messages like this:

(gitview:14905): GLib-GObject-WARNING **: IA__g_object_set_property: object clas s `PyGtkGenericCellRenderer' has no property named `out-lines'

(gitview:14905): GLib-GObject-WARNING **: IA__g_object_set_property: object clas s `PyGtkGenericCellRenderer' has no property named `in-lines'

(gitview:14905): GLib-GObject-WARNING **: IA__g_object_set_property: object clas s `PyGtkGenericCellRenderer' has no property named `node'

(gitview:14905): GLib-GObject-WARNING **: IA__g_object_set_property: object clas s `PyGtkGenericCellRenderer' has no property named `out-lines'

(gitview:14905): GLib-GObject-WARNING **: IA__g_object_set_property: object clas s `PyGtkGenericCellRenderer' has no property named `in-lines'

(gitview:14905): GLib-GObject-WARNING **: IA__g_object_set_property: object clas
s `PyGtkGenericCellRenderer' has no property named `node'
Traceback (most recent call last):
  File "/home/raa/gitview", line 166, in on_render
    ctx = window.cairo_create()
AttributeError: 'gtk.gdk.Window' object has no attribute 'cairo_create'
Gentoo, Python 2.4.2, pycairo 1.0.2.
Fernando J. Pereda· Feb 1, 2006, 21:02 UTC · re: Alex Riesen · lore

Re: [Announce] gitview-0.1

On Wed, Feb 01, 2006 at 09:58:05PM +0100, Alex Riesen wrote:
| Gentoo, Python 2.4.2, pycairo 1.0.2.
Just upgrade to a newer pygtk and it'll work fine:
[ebuild   R   ] dev-python/pygtk-2.8.2  -doc +opengl 0 kB
I had the same problem until I installed the above version.

Cheers, Ferdy

-- 
Fernando J. Pereda Garcimartín
Gentoo Developer (Alpha,net-mail,mutt,git)
20BB BDC3 761A 4781 E6ED  ED0B 0A48 5B0C 60BD 28D4

← back to recent threads