git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git alias question

From
MHMichael Horowitz <michael.horowitz@ieee.org>
Date
Dec 31, 2011, 21:31 UTC
Message-ID
<CAFLRborAuoWKxOeHtPRujSYbQPk67RCxTiVBavtWDeh-Byfa2w@mail.gmail.com>
In-Reply-To
<CAJDDKr5a8TB82h4ULWtamLOVu_4Fv+cGw1YfEL987gM3yM4TMg@mail.gmail.com>

The log operation does seem to make the most sense as the mechanism to search for the results. Making it work with difftool would work... Not sure if "--log" to difftool or some other options as suggested in the other thread would be most consistent UI-wise as stated, but either would work for me.

On a separate note, some environment variable like GIT_PREFIX with the CWD would make the alias functionality more flexible.

Mike
On Thu, Dec 29, 2011 at 8:59 PM, David Aguilar <davvid@gmail.com> wrote:
Show 37 quoted lines
>
> On Thu, Dec 29, 2011 at 9:08 AM, Dave Borowitz <dborowitz@google.com> wrote:
> > On Wed, Dec 28, 2011 at 17:27, Michael Horowitz
> > <michael.horowitz@ieee.org> wrote:
> >> ldiff = "!git diff `git rev-list --reverse -n 2 HEAD -- $1` -- $1"
> >
> > FWIW, you can also do this as:
> >  ldiff = log -p -1 --format=format: --
> >
> >> ldifft = "!git difftool `git rev-list --reverse -n 2 HEAD -- $1` -- $1"
> >
> > I don't know that you can do something equivalent with difftool. I
> > suppose you could do the above with "GIT_EXTERNAL_DIFF=<some difftool
> > wrapper> git ldiff", but that's not very helpful.
>
> difftool cannot be driven by log right now.  It is something we
> thought would be helpful in the past:
>
> http://thread.gmane.org/gmane.comp.version-control.git/114269/focus=114367
>
> On 2009-03-23 Junio C Hamano <gitster <at> pobox.com> wrote:
> > Perhaps we would want a convenient way for "log -p" or "show -p" to drive
> > difftool as a backend?
>
> I think that's exactly it.  difftool wraps diff; a log equivalent
> would be quite helpful.
>
> One idea is for difftool to learn a "--log" option to make it wrap log
> instead.  I don't know if a diff-like command having a "--log" option
> is ideal from a consistency-of-user-interface POV so I'm open to
> ideas.  It is convenient, though.  It does seem like difftool would be
> a good place to expose this feature.
>
> I'd be interested in the "teach log / show -p about GIT_EXTERNAL_DIFF"
> route, if that sounds like a good idea.
> --
>             David
Previous: David AguilarNext: Jakub Narebski
Message 6 of 8 in “git alias question”
  1. Michael HorowitzDec 29, 2011
  2. Miles BaderDec 29, 2011
  3. Junio C HamanoDec 29, 2011
  4. Dave BorowitzDec 29, 2011
  5. David AguilarDec 30, 2011
  6. Michael HorowitzDec 31, 2011
  7. Jakub NarebskiDec 31, 2011
  8. Michael HorowitzJan 2, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.