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

Re: tig show <commit> not working anymore?

From
Kumar Appaiah <a.kumar@alumni.iitm.ac.in>
Date
Sep 18, 2010, 05:01 UTC
Message-ID
<20100918050122.GA24656@bluemoon.alumni.iitm.ac.in>
In-Reply-To
<4C922112.404@drmicha.warpmail.net>
On Thu, Sep 16, 2010 at 03:52:18PM +0200, Michael J Gruber wrote:
Show 14 quoted lines
> > I observed that, since commit
> > 53c089443cd9885fa677becee4bf7ffd56c3c357, tig show <commit> doesn't
> > seem to work the same way as I had expected it to. The documentation
> > update doesn't seem to indicate that this was to be expected (or I
> > didn't understand it properly). Could someone please confirm that
> > tig show <commit> should actually do something similar to git show <commit> | tig ?
> 
> It seems that since that tig commit, "tig show <commit>" shows HEAD
> rather than <commit>. OTOH, "tig <commit>" does navigate to <commit>.
> 
> The reason is that tig passes %(commit), not %(revargs), to git show for
> the "show" subcommand, but the obvious simple patch breaks diff view. I
> guess somewhere in the codepath one has to differentiate between those.
> cc'ing Mr. Tig...

Please bear in mind that I am totally new to the code, and not a power user of git either. So please don't club me! ;-)

Well, I was exploring the code a little, and I could not understand some aspects fully. First, I discovered that the following hack fixes the problem to an extent:

diff --git a/tig.c b/tig.c
index e0e812c..aa38e71 100644
--- a/tig.c
+++ b/tig.c
@@ -7864,7 +7864,7 @@ parse_options(int argc, const char *argv[])

        if (filter_argv)
                filter_options(filter_argv);
-
+       if (!strcmp(subcommand, "show") && opt_rev_args && opt_rev_args[0]) { string_copy_rev(ref_commit, opt_rev_args[0]); }
        return request;
 }

However, I am pretty certain that that is not the intended use of
opt_rev_args and ref_commit, and that they should be used in a
different way. For example, tig show HEAD^^^..HEAD should show me
three commits combined, but it shows me only one, since I haven't run
it through rev-list or the like¸ probably.

I'll continue to try getting at a fix, unless someone comes to it
before me.

Thanks!

Kumar
Previous: Kumar AppaiahNext: Jonas Fonseca
Message 9 of 13 in “tig show <commit> not working anymore?”
  1. Kumar AppaiahSep 16, 2010
  2. Stefan NaeweSep 16, 2010
  3. Kumar AppaiahSep 16, 2010
  4. Jonas FonsecaSep 16, 2010
  5. Kumar AppaiahSep 16, 2010
  6. Michael J GruberSep 16, 2010
  7. Stefan NaeweSep 16, 2010
  8. Kumar AppaiahSep 16, 2010
  9. Kumar AppaiahSep 18, 2010
  10. Jonas FonsecaSep 18, 2010
  11. Jonas FonsecaSep 19, 2010
  12. Kumar AppaiahSep 20, 2010
  13. Jonas FonsecaSep 21, 2010

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.