Re: Git repository browsers, drag'n'drop and backlinks



Holger Berndt wrote:
On Sa, 09.01.2010 20:28, Jesse van den Kieboom wrote:

Also it supports 3 selection targets:

x-gitg/treeish: <path>\n<sha1>: <subject>
text: <sha1>: <subject>\n\n<body>
uri: gitg://<path>:<sha1>

I am not entirely sure that this is a good solution. I know that you
can't select more than one commit at a time in gitg, but I don't really
see why this restriction should be reflected in the dnd target. If
there's no real reason to do otherwise, I'd keep it analogous to other
dnd targets, which often work on lists.

Also, a single commit might have (and often has) more "treeish" names
associated to it, e.g. the commit representing the current head of a
branch has both a branch-name and a sha1. Depending on what it wants to
do, a dnd receiver might care for one or the other.
The definition was not meant to be only for one commit (at least the x-gitg/treeish and uri can have multiple values). Maybe you could describe a bit more what exactly you expect to get.
Offering the subject or even the body might be convenient for the
receiver, but given a repository path and a treeish, it can gather this
information itself. It might, for example, care more about the author
than the subject.
The text target is simply provided for applications that cannot (yet) handle the more expressive treeish target. This means that you can drop it in a text editor, and it will simply paste something meaningful. If you want to process it more specifically, you can decide to handle the x-gig/treeish target)
The proof-of-concept Tomboy receiver side, for example, set the link
text to the result of "git log --oneline treeish^..treeish".

2. Make gitg recognise a --select command line option, which takes a
sha1, and selects this one after the repo has been loaded completely
I implemented this too (I modified a few things here). gitg now accepts uris in the form of gitg://<path>[:<sha1>] and installs itself as the default uri handler (for gnome at least). Additionally it also adds the --select option like you proposed (it's implemented is a bit more efficient and accepts partial hashes).

Nice! Ideally, it would accept every treeish notation (e.g. everything
that "git checkout" understands), but your implementation sounds great
already, and would fit my needs as it is, so thank you for that.
At the moment gitg itself accepts arguments that you can also specify to git log, in addition to the uri (or a directory). So something like 'gitg gitg://<path> feature..master works too. Is this what you mean, or?
Currently the tree view does not allow selecting multiple revisions, so it just exports one revision at the moment.

See above about multiple treeish objects associated to a single
commit, and not limiting the dnd target definition to the current
state of the gitg UI.

Thanks a lot (also to Guilhem, of course!) for your comments and
efforts!

Holger




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]