git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [FEATURE-REQUEST] difftool --dir-diff: use the commit names as directory names instead of left/right
@ 2013-03-22 16:52 Christoph Anton Mitterer
  2013-03-23  4:56 ` David Aguilar
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Anton Mitterer @ 2013-03-22 16:52 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 708 bytes --]

Hi.

Right now, when I use difftool --dir-diff, the temp dirs are creates as
e.g.:
/tmp/git-difftool.QqP8x/left
/tmp/git-difftool.QqP8x/right

Wouldn't it be nice, if instead of left/right... the specified commit
name would be used?

e.g.
/tmp/git-difftool.QqP8x/r1.1.1
/tmp/git-difftool.QqP8x/HEAD
or
/tmp/git-difftool.QqP8x/fd4e4005a4b7b3e638bc405be020b867f8881e72
/tmp/git-difftool.QqP8x/ce0747b74fccd20707b6f495068503e69e5473df

Cause then, one would see in the difftool which side is what, without
the need to remember how git difftool was invoked.


Of course one might probably need to escape the commit names if they
contain stuff like "/" or "..", etc.



Cheers,
Chris.

[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 5165 bytes --]

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

* Re: [FEATURE-REQUEST] difftool --dir-diff: use the commit names as directory names instead of left/right
  2013-03-22 16:52 [FEATURE-REQUEST] difftool --dir-diff: use the commit names as directory names instead of left/right Christoph Anton Mitterer
@ 2013-03-23  4:56 ` David Aguilar
  2013-03-23 12:36   ` John Keeping
  0 siblings, 1 reply; 4+ messages in thread
From: David Aguilar @ 2013-03-23  4:56 UTC (permalink / raw)
  To: Christoph Anton Mitterer; +Cc: git, John Keeping

On Fri, Mar 22, 2013 at 9:52 AM, Christoph Anton Mitterer
<calestyo@scientia.net> wrote:
> Hi.
>
> Right now, when I use difftool --dir-diff, the temp dirs are creates as
> e.g.:
> /tmp/git-difftool.QqP8x/left
> /tmp/git-difftool.QqP8x/right
>
> Wouldn't it be nice, if instead of left/right... the specified commit
> name would be used?
>
> e.g.
> /tmp/git-difftool.QqP8x/r1.1.1
> /tmp/git-difftool.QqP8x/HEAD
> or
> /tmp/git-difftool.QqP8x/fd4e4005a4b7b3e638bc405be020b867f8881e72
> /tmp/git-difftool.QqP8x/ce0747b74fccd20707b6f495068503e69e5473df
>
> Cause then, one would see in the difftool which side is what, without
> the need to remember how git difftool was invoked.
>
>
> Of course one might probably need to escape the commit names if they
> contain stuff like "/" or "..", etc.

I can see that being pretty helpful.
If we do it we should go all the way.

What do you all think about something like the output of
"git describe --always" instead of the SHA-1?


BTW there are some patches in-flight around difftool so
you'll probably want to apply them first if you're going to
give it a try.  patches very much appreciated! ;-)
If no one beats me to it, I can give it a try after the weekend.
-- 
David

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

* Re: [FEATURE-REQUEST] difftool --dir-diff: use the commit names as directory names instead of left/right
  2013-03-23  4:56 ` David Aguilar
@ 2013-03-23 12:36   ` John Keeping
  2013-03-23 15:30     ` Christoph Anton Mitterer
  0 siblings, 1 reply; 4+ messages in thread
From: John Keeping @ 2013-03-23 12:36 UTC (permalink / raw)
  To: David Aguilar; +Cc: Christoph Anton Mitterer, git

On Fri, Mar 22, 2013 at 09:56:17PM -0700, David Aguilar wrote:
> On Fri, Mar 22, 2013 at 9:52 AM, Christoph Anton Mitterer
> <calestyo@scientia.net> wrote:
> > Hi.
> >
> > Right now, when I use difftool --dir-diff, the temp dirs are creates as
> > e.g.:
> > /tmp/git-difftool.QqP8x/left
> > /tmp/git-difftool.QqP8x/right
> >
> > Wouldn't it be nice, if instead of left/right... the specified commit
> > name would be used?
> >
> > e.g.
> > /tmp/git-difftool.QqP8x/r1.1.1
> > /tmp/git-difftool.QqP8x/HEAD
> > or
> > /tmp/git-difftool.QqP8x/fd4e4005a4b7b3e638bc405be020b867f8881e72
> > /tmp/git-difftool.QqP8x/ce0747b74fccd20707b6f495068503e69e5473df
> >
> > Cause then, one would see in the difftool which side is what, without
> > the need to remember how git difftool was invoked.
> >
> >
> > Of course one might probably need to escape the commit names if they
> > contain stuff like "/" or "..", etc.
> 
> I can see that being pretty helpful.
> If we do it we should go all the way.
> 
> What do you all think about something like the output of
> "git describe --always" instead of the SHA-1?

I think Christoph was suggesting that it should use the revision as
specified by the user, presumably falling back to HEAD when only one
revision has been specified.

That's likely to be the easiest to understand since git-describe could
show "v1.8.2-134-g328455f" (or "remotes/origin/maint-121-g328455f" with
--all) where the user specified HEAD^.  I suspect in that case we have
to be careful about special characters, perhaps it's best to just fall
back to the SHA1 if we encounter something like
"origin/master^{/^diff.c}" which is likely to cause issues with shell
quoting.

The interesting question around this is precisely how commit specifiers
map to directory names and at what point (if ever) we give up and use
the SHA1.  At the very least we need to translate '/' to something else
('~' maybe?).

> BTW there are some patches in-flight around difftool so
> you'll probably want to apply them first if you're going to
> give it a try.  patches very much appreciated! ;-)
> If no one beats me to it, I can give it a try after the weekend.
> -- 
> David

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

* Re: [FEATURE-REQUEST] difftool --dir-diff: use the commit names as directory names instead of left/right
  2013-03-23 12:36   ` John Keeping
@ 2013-03-23 15:30     ` Christoph Anton Mitterer
  0 siblings, 0 replies; 4+ messages in thread
From: Christoph Anton Mitterer @ 2013-03-23 15:30 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 1009 bytes --]

On Sat, 2013-03-23 at 12:36 +0000, John Keeping wrote:
> > What do you all think about something like the output of
> > "git describe --always" instead of the SHA-1?
> I think Christoph was suggesting that it should use the revision as
> specified by the user, presumably falling back to HEAD when only one
> revision has been specified.
That was the idea... cause it has the best chance of being somehow
remembered/recognised by the user...
Taking any description, doesn't necessarily mean that the user has ever
seen this before or remembers it.



> I suspect in that case we have
> to be careful about special characters, perhaps it's best to just fall
> back to the SHA1 if we encounter something like
> "origin/master^{/^diff.c}" which is likely to cause issues with shell
> quoting.
Or maybe just pseudo-quote any such special characters by "_".
Otherwise,... one might have to many cases, where one falls back to the
SHA1... and looses a lot of the benefits.


Cheers,
Chris.

[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 5113 bytes --]

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

end of thread, other threads:[~2013-03-23 15:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-22 16:52 [FEATURE-REQUEST] difftool --dir-diff: use the commit names as directory names instead of left/right Christoph Anton Mitterer
2013-03-23  4:56 ` David Aguilar
2013-03-23 12:36   ` John Keeping
2013-03-23 15:30     ` Christoph Anton Mitterer

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