All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] Interactive difftool
@ 2009-03-26 15:29 Ping Yin
  2009-03-27 14:51 ` David Aguilar
  0 siblings, 1 reply; 5+ messages in thread
From: Ping Yin @ 2009-03-26 15:29 UTC (permalink / raw)
  To: Git Mailing List, davvid

Before git-difftool goes to master, i want to propose a new feature to
add to or replace the current behaviour of difftool. With current
difftool, we can only see the diff one by one. However, sometimes what
we want is to see the diff of selected files, or in a different order,
just like what we can do in the gui. So here is what i propose

$ git difftool --interactive [options]
[1] diff.c                   |   10 +++++++++-
[2] t/t4020-diff-external.sh |    8 ++++++++
Choose the file you want to see the diff of: 2

When the user types 2 and then <enter>, the external diff program is called

Further more, instead of just type a number, a letter can be prepended
to the number to represent different ways of diff. For example

t2 (tool 2): see the diff for file 2 with the configured diff tool
p2 (patch 2): see the diff for file 2 in the patch format

What do you think?

Ping Yin

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

* Re: [RFC] Interactive difftool
  2009-03-26 15:29 [RFC] Interactive difftool Ping Yin
@ 2009-03-27 14:51 ` David Aguilar
  2009-03-27 15:23   ` Ping Yin
  0 siblings, 1 reply; 5+ messages in thread
From: David Aguilar @ 2009-03-27 14:51 UTC (permalink / raw)
  To: Ping Yin; +Cc: Git Mailing List

On  0, Ping Yin <pkufranky@gmail.com> wrote:
> Before git-difftool goes to master, i want to propose a new feature to
> add to or replace the current behaviour of difftool. With current
> difftool, we can only see the diff one by one. However, sometimes what
> we want is to see the diff of selected files, or in a different order,
> just like what we can do in the gui. So here is what i propose
> 
> $ git difftool --interactive [options]
> [1] diff.c                   |   10 +++++++++-
> [2] t/t4020-diff-external.sh |    8 ++++++++
> Choose the file you want to see the diff of: 2
> 
> When the user types 2 and then <enter>, the external diff program is called
> 
> Further more, instead of just type a number, a letter can be prepended
> to the number to represent different ways of diff. For example
> 
> t2 (tool 2): see the diff for file 2 with the configured diff tool
> p2 (patch 2): see the diff for file 2 in the patch format
> 
> What do you think?
> 
> Ping Yin

That would be pretty cool.  I don't know about the
merge-to-master timing and whether we'd want to include new
features before the move.

I guess most of the work would have to be done in
git-difftool-helper.sh.  I had a co-worker that asked for this
exact feature just the other day (and ditto for mergetool).

Patches are welcome if you have an idea for how it could work.
Right now we get called indirectly by git-diff so I
don't know if there's an easy way to hook into it like that.
It might be a matter of changing git-difftool.perl so that it
does more of the dispatching itself.

-- 

	David

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

* Re: [RFC] Interactive difftool
  2009-03-27 14:51 ` David Aguilar
@ 2009-03-27 15:23   ` Ping Yin
  2009-03-28  7:32     ` Jeff King
  0 siblings, 1 reply; 5+ messages in thread
From: Ping Yin @ 2009-03-27 15:23 UTC (permalink / raw)
  To: David Aguilar; +Cc: Git Mailing List

On Fri, Mar 27, 2009 at 10:51 PM, David Aguilar <davvid@gmail.com> wrote:
> On  0, Ping Yin <pkufranky@gmail.com> wrote:
>> Before git-difftool goes to master, i want to propose a new feature to
>> add to or replace the current behaviour of difftool. With current
>> difftool, we can only see the diff one by one. However, sometimes what
>> we want is to see the diff of selected files, or in a different order,
>> just like what we can do in the gui. So here is what i propose
>>
>> $ git difftool --interactive [options]
>> [1] diff.c                   |   10 +++++++++-
>> [2] t/t4020-diff-external.sh |    8 ++++++++
>> Choose the file you want to see the diff of: 2
>>
>> When the user types 2 and then <enter>, the external diff program is called
>>
>> Further more, instead of just type a number, a letter can be prepended
>> to the number to represent different ways of diff. For example
>>
>> t2 (tool 2): see the diff for file 2 with the configured diff tool
>> p2 (patch 2): see the diff for file 2 in the patch format
>>
>> What do you think?
>>
>> Ping Yin
>
> That would be pretty cool.  I don't know about the
> merge-to-master timing and whether we'd want to include new
> features before the move.
>
> I guess most of the work would have to be done in
> git-difftool-helper.sh.  I had a co-worker that asked for this
> exact feature just the other day (and ditto for mergetool).
>
> Patches are welcome if you have an idea for how it could work.
> Right now we get called indirectly by git-diff so I
> don't know if there's an easy way to hook into it like that.
> It might be a matter of changing git-difftool.perl so that it
> does more of the dispatching itself.
>

We can just change git-difftool.perl

The easiest way is first parsing the output of git diff --stat,
adding the number at the beginning, for example
[1] diff.c                   |   10 +++++++++-
[2] t/t4020-diff-external.sh |    8 ++++++++

When the user types a number,  git-difftool-helper is launched to show
the diff for the corresponding file.

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

* Re: [RFC] Interactive difftool
  2009-03-27 15:23   ` Ping Yin
@ 2009-03-28  7:32     ` Jeff King
  2009-03-28  9:14       ` Ping Yin
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff King @ 2009-03-28  7:32 UTC (permalink / raw)
  To: Ping Yin; +Cc: David Aguilar, Git Mailing List

On Fri, Mar 27, 2009 at 11:23:15PM +0800, Ping Yin wrote:

> We can just change git-difftool.perl
> 
> The easiest way is first parsing the output of git diff --stat,
> adding the number at the beginning, for example
> [1] diff.c                   |   10 +++++++++-
> [2] t/t4020-diff-external.sh |    8 ++++++++

I am not paying enough attention to this thread to comment on your
overall goal, but instead of parsing "--stat", try "--numstat".

-Peff

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

* Re: [RFC] Interactive difftool
  2009-03-28  7:32     ` Jeff King
@ 2009-03-28  9:14       ` Ping Yin
  0 siblings, 0 replies; 5+ messages in thread
From: Ping Yin @ 2009-03-28  9:14 UTC (permalink / raw)
  To: Jeff King; +Cc: David Aguilar, Git Mailing List

On Sat, Mar 28, 2009 at 3:32 PM, Jeff King <peff@peff.net> wrote:
> On Fri, Mar 27, 2009 at 11:23:15PM +0800, Ping Yin wrote:
>
>> We can just change git-difftool.perl
>>
>> The easiest way is first parsing the output of git diff --stat,
>> adding the number at the beginning, for example
>> [1] diff.c                   |   10 +++++++++-
>> [2] t/t4020-diff-external.sh |    8 ++++++++
>
> I am not paying enough attention to this thread to comment on your
> overall goal, but instead of parsing "--stat", try "--numstat".
>

Thanks, that helps.

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

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

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-26 15:29 [RFC] Interactive difftool Ping Yin
2009-03-27 14:51 ` David Aguilar
2009-03-27 15:23   ` Ping Yin
2009-03-28  7:32     ` Jeff King
2009-03-28  9:14       ` Ping Yin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.