git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [POC PATCH] diff options: Introduce --interactive
       [not found] <1238391670-4421-1-git-send-email-pkufranky@gmail.com>
@ 2009-03-30  9:04 ` David Aguilar
  2009-03-30  9:38   ` Ping Yin
  0 siblings, 1 reply; 2+ messages in thread
From: David Aguilar @ 2009-03-30  9:04 UTC (permalink / raw)
  To: Ping Yin; +Cc: git

On  0, Ping Yin <pkufranky@gmail.com> wrote:
> The new option --interactive introduces an interactive diff mode. Now we
> can choose to see the diff for a selected file.

I just tried it out.  Very cool.
It's exactly the functionality users have asked me about.

I just sent a for-the-future patch that teaches difftool
to tell difftool-helper that it shouldn't prompt when
you're using --interactive.

I noticed git-diff doesn't have a -i flag yet,
perhaps it could be the shorthand for --interactive?

(I'd have to change that for-the-future patch I just sent
 too since it also only checks for the long form...)

I like it.

> 
> This is a preparation to introduce the --tool option to launch the
> external diff tool for a selected file.

With both of our latest patches:

	git difftool --interactive <revargs>

does exactly what one would expect it to.


How are you envisioning --tool?  It'd be great if we didn't
need the perl wrapper, though something does need to set
GIT_EXTERNAL_DIFF/GIT_PAGER/etc... (that is, unless you have a
better way =))


> >> When the user types a number,  git-difftool-helper is launched to show
> >> the diff for the corresponding file.
> >
> > Cool.
> > I had two patches that I sent to the list for
> > git-difftool.perl.  If you're going to patch it then you might
> > want to base it on top of those.
> >
> When i try to code on git-difftool.perl, i find it is more appropriate to add
> the --interactive and then --tool options to git-diff itself. So here is a
> proof of concept patch based on next. What we should do next is to try to
> design a good UI.

I'll see if I can come up with any suggestions.
I liked it on the first test drive.


-- 

	David

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

* Re: [POC PATCH] diff options: Introduce --interactive
  2009-03-30  9:04 ` [POC PATCH] diff options: Introduce --interactive David Aguilar
@ 2009-03-30  9:38   ` Ping Yin
  0 siblings, 0 replies; 2+ messages in thread
From: Ping Yin @ 2009-03-30  9:38 UTC (permalink / raw)
  To: David Aguilar; +Cc: git

On Mon, Mar 30, 2009 at 5:04 PM, David Aguilar <davvid@gmail.com> wrote:
> On  0, Ping Yin <pkufranky@gmail.com> wrote:
>> The new option --interactive introduces an interactive diff mode. Now we
>> can choose to see the diff for a selected file.
>
> I just tried it out.  Very cool.
> It's exactly the functionality users have asked me about.
>
> I just sent a for-the-future patch that teaches difftool
> to tell difftool-helper that it shouldn't prompt when
> you're using --interactive.
>
> I noticed git-diff doesn't have a -i flag yet,
> perhaps it could be the shorthand for --interactive?
>
> (I'd have to change that for-the-future patch I just sent
>  too since it also only checks for the long form...)
>
> I like it.
>
>>
>> This is a preparation to introduce the --tool option to launch the
>> external diff tool for a selected file.
>
> With both of our latest patches:
>
>        git difftool --interactive <revargs>
>
> does exactly what one would expect it to.
>
>
> How are you envisioning --tool?  It'd be great if we didn't
> need the perl wrapper, though something does need to set
> GIT_EXTERNAL_DIFF/GIT_PAGER/etc... (that is, unless you have a
> better way =))

These environment vars can be set in diff.c directly, by passing the
git-difftool. So i think the difftool wrapper can be just removed once
the --tool option is available

>
>
>> >> When the user types a number,  git-difftool-helper is launched to show
>> >> the diff for the corresponding file.
>> >
>> > Cool.
>> > I had two patches that I sent to the list for
>> > git-difftool.perl.  If you're going to patch it then you might
>> > want to base it on top of those.
>> >
>> When i try to code on git-difftool.perl, i find it is more appropriate to add
>> the --interactive and then --tool options to git-diff itself. So here is a
>> proof of concept patch based on next. What we should do next is to try to
>> design a good UI.
>
> I'll see if I can come up with any suggestions.
> I liked it on the first test drive.
>

Here is the UI i am envisioning, although i am not a good ui designer

1. interactive diff

$ git diff --interactive
1: M -10/+20   a.c
2: R -5 /+0    a1.c => a2.c
3: C -5 /+0    b1.c => b2.c

[p] What now [<n>,t<n>?,p<n>,t,p,q,?]?

When hitting '?'
<n>  - see diff of file <n> in default mode
p<n> - see diff of file <n> in patch mode
t<n> - see diff of file <n> in tool mode
p    - change to patch diff mode
t    - change to tool diff mode
q    - quit this ineraction
?    - print help

When hitting 't'
[t] What now [<n>,t<n>?,p<n>,t,p,q,?]?

2. interactive diff with --tool
if using "git diff --interactive --tool", then the default diff mode is tool

$ git diff --interactive --tool
1: M -10/+20   a.c
2: R -5 /+0    a1.c => a2.c
3: C -5 /+0    b1.c => b2.c

[t] What now [<n>,t<n>?,p<n>,t,p,q,?]?

3. other considerations
 - --tool can imply --interactive
 - --interactive can imply -p
 - pager is disabled in interactive mode

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

end of thread, other threads:[~2009-03-30  9:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1238391670-4421-1-git-send-email-pkufranky@gmail.com>
2009-03-30  9:04 ` [POC PATCH] diff options: Introduce --interactive David Aguilar
2009-03-30  9:38   ` Ping Yin

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).