{"thread":{"id":"25123","subject":"tig show <commit> not working anymore?","startedAt":"2010-09-16T12:53:39Z","lastAt":"2010-09-21T12:56:21Z","messageCount":13,"participants":["Kumar Appaiah","Stefan Naewe","Jonas Fonseca","Michael J Gruber"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"150821","messageId":"20100916125337.GG5785@bowser.ece.utexas.edu","threadId":"25123","inReplyTo":null,"subject":"tig show <commit> not working anymore?","fromName":"Kumar Appaiah","fromEmail":"a.kumar@alumni.iitm.ac.in","sentAt":"2010-09-16T12:53:39Z","receivedAt":"2010-09-16T12:53:39Z","isPatch":false,"sender":{"key":"a.kumar@alumni.iitm.ac.in","avatar":"https://gravatar.com/avatar/7ce299108bfff26792729bde4a1dd0638292f852a042d40a0a1991ff2ae58b0b?d=mp&s=160"},"body":"Hi!\n\nI observed that, since commit\n53c089443cd9885fa677becee4bf7ffd56c3c357, tig show <commit> doesn't\nseem to work the same way as I had expected it to. The documentation\nupdate doesn't seem to indicate that this was to be expected (or I\ndidn't understand it properly). Could someone please confirm that\ntig show <commit> should actually do something similar to git show <commit> | tig ?\n\nThanks!\n\nKumar\n"},{"id":"150822","messageId":"4C921FAC.9000108@atlas-elektronik.com","threadId":"25123","inReplyTo":"20100916125337.GG5785@bowser.ece.utexas.edu","subject":"Re: tig show <commit> not working anymore?","fromName":"Stefan Naewe","fromEmail":"stefan.naewe@atlas-elektronik.com","sentAt":"2010-09-16T13:46:20Z","receivedAt":"2010-09-16T13:46:20Z","isPatch":false,"sender":{"key":"stefan.naewe@gmail.com","avatar":"https://avatars.githubusercontent.com/u/4468?v=4"},"body":"On 9/16/2010 2:53 PM, Kumar Appaiah wrote:\n> Hi!\n> \n> I observed that, since commit\n> 53c089443cd9885fa677becee4bf7ffd56c3c357, tig show <commit> doesn't\n> seem to work the same way as I had expected it to. The documentation\n> update doesn't seem to indicate that this was to be expected (or I\n> didn't understand it properly). Could someone please confirm that\n> tig show <commit> should actually do something similar to git show <commit> | tig ?\n> \n> Thanks!\n\nWorks as expected for me on Debian Linux 5.0.6 i686:\n\n$ git version\ngit version 1.7.2.3\n\n$ git describe\ntig-0.16-11-gf1fe753\n\nand on Cygwin with the same tig version and \"git version 1.7.2.3.msysgit.1\"\n\nYour tig version, OS, etc. ?\n\nRegards,\n  Stefan\n-- \n----------------------------------------------------------------\n/dev/random says: Useless Invention: Leather cutlery.\n"},{"id":"150823","messageId":"AANLkTimug6MC6iZvOu5b3g6rG=GeJiL5Fvnj4AD0ppWp@mail.gmail.com","threadId":"25123","inReplyTo":"20100916125337.GG5785@bowser.ece.utexas.edu","subject":"Re: tig show <commit> not working anymore?","fromName":"Jonas Fonseca","fromEmail":"jonas.fonseca@gmail.com","sentAt":"2010-09-16T13:47:58Z","receivedAt":"2010-09-16T13:47:58Z","isPatch":false,"sender":{"key":"jonas.fonseca@gmail.com","avatar":"https://gravatar.com/avatar/9b7fa23cce50269e5d164312b6ac5ae818a180f837b38f28f3bdf689dd7f96cd?d=mp&s=160"},"body":"On Thu, Sep 16, 2010 at 08:53, Kumar Appaiah <a.kumar@alumni.iitm.ac.in> wrote:\n> Hi!\n\nHello,\n\n> I observed that, since commit\n> 53c089443cd9885fa677becee4bf7ffd56c3c357, tig show <commit> doesn't\n> seem to work the same way as I had expected it to. The documentation\n> update doesn't seem to indicate that this was to be expected (or I\n> didn't understand it properly). Could someone please confirm that\n> tig show <commit> should actually do something similar to git show <commit> | tig ?\n\nWhat is the expected behavoir that is not working anymore?\n\n-- \nJonas Fonseca\n"},{"id":"150824","messageId":"4C922112.404@drmicha.warpmail.net","threadId":"25123","inReplyTo":"20100916125337.GG5785@bowser.ece.utexas.edu","subject":"Re: tig show <commit> not working anymore?","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-09-16T13:52:18Z","receivedAt":"2010-09-16T13:52:18Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Kumar Appaiah venit, vidit, dixit 16.09.2010 14:53:\n> Hi!\n> \n> I observed that, since commit\n> 53c089443cd9885fa677becee4bf7ffd56c3c357, tig show <commit> doesn't\n> seem to work the same way as I had expected it to. The documentation\n> update doesn't seem to indicate that this was to be expected (or I\n> didn't understand it properly). Could someone please confirm that\n> tig show <commit> should actually do something similar to git show <commit> | tig ?\n\nIt seems that since that tig commit, \"tig show <commit>\" shows HEAD\nrather than <commit>. OTOH, \"tig <commit>\" does navigate to <commit>.\n\nThe reason is that tig passes %(commit), not %(revargs), to git show for\nthe \"show\" subcommand, but the obvious simple patch breaks diff view. I\nguess somewhere in the codepath one has to differentiate between those.\ncc'ing Mr. Tig...\n\nMichael\n"},{"id":"150828","messageId":"4C9222A9.4070801@atlas-elektronik.com","threadId":"25123","inReplyTo":"4C922112.404@drmicha.warpmail.net","subject":"Re: tig show <commit> not working anymore?","fromName":"Stefan Naewe","fromEmail":"stefan.naewe@atlas-elektronik.com","sentAt":"2010-09-16T13:59:05Z","receivedAt":"2010-09-16T13:59:05Z","isPatch":false,"sender":{"key":"stefan.naewe@gmail.com","avatar":"https://avatars.githubusercontent.com/u/4468?v=4"},"body":"On 9/16/2010 3:52 PM, Michael J Gruber wrote:\n> Kumar Appaiah venit, vidit, dixit 16.09.2010 14:53:\n>> Hi!\n>>\n>> I observed that, since commit\n>> 53c089443cd9885fa677becee4bf7ffd56c3c357, tig show <commit> doesn't\n>> seem to work the same way as I had expected it to. The documentation\n>> update doesn't seem to indicate that this was to be expected (or I\n>> didn't understand it properly). Could someone please confirm that\n>> tig show <commit> should actually do something similar to git show <commit> | tig ?\n> \n> It seems that since that tig commit, \"tig show <commit>\" shows HEAD\n> rather than <commit>. OTOH, \"tig <commit>\" does navigate to <commit>.\n\n\nOops...how true.\n\nI tested 'tig show <commit>' and noticed it showed something but\ndidn't look close enough 8-|\n\nStefan\n-- \n----------------------------------------------------------------\n/dev/random says: Never argue with a woman when she's tired, or rested.\n"},{"id":"150838","messageId":"20100916185624.GJ5785@bowser.ece.utexas.edu","threadId":"25123","inReplyTo":"AANLkTimug6MC6iZvOu5b3g6rG=GeJiL5Fvnj4AD0ppWp@mail.gmail.com","subject":"Re: tig show <commit> not working anymore?","fromName":"Kumar Appaiah","fromEmail":"a.kumar@alumni.iitm.ac.in","sentAt":"2010-09-16T18:56:24Z","receivedAt":"2010-09-16T18:56:24Z","isPatch":false,"sender":{"key":"a.kumar@alumni.iitm.ac.in","avatar":"https://gravatar.com/avatar/7ce299108bfff26792729bde4a1dd0638292f852a042d40a0a1991ff2ae58b0b?d=mp&s=160"},"body":"Dear Jonas,\n\nOn Thu, Sep 16, 2010 at 09:47:58AM -0400, Jonas Fonseca wrote:\n> On Thu, Sep 16, 2010 at 08:53, Kumar Appaiah <a.kumar@alumni.iitm.ac.in> wrote:\n> > I observed that, since commit\n> > 53c089443cd9885fa677becee4bf7ffd56c3c357, tig show <commit> doesn't\n> > seem to work the same way as I had expected it to. The documentation\n> > update doesn't seem to indicate that this was to be expected (or I\n> > didn't understand it properly). Could someone please confirm that\n> > tig show <commit> should actually do something similar to git show <commit> | tig ?\n> \n> What is the expected behavoir that is not working anymore?\n\nI expect the formatted commit diff of the commit I specify after\nshow. For example, tig show a74fa1900a65384bc4140fe45a55877bc981b185\nused to show me the commit titled \"Misc cleanups\" (in tig), while now,\nit shows me HEAD.\n\nPlease let me know if I have missed something.\n\nThanks!\n\nKumar\n"},{"id":"150839","messageId":"20100916190132.GK5785@bowser.ece.utexas.edu","threadId":"25123","inReplyTo":"4C921FAC.9000108@atlas-elektronik.com","subject":"Re: tig show <commit> not working anymore?","fromName":"Kumar Appaiah","fromEmail":"a.kumar@alumni.iitm.ac.in","sentAt":"2010-09-16T19:01:32Z","receivedAt":"2010-09-16T19:01:32Z","isPatch":false,"sender":{"key":"a.kumar@alumni.iitm.ac.in","avatar":"https://gravatar.com/avatar/7ce299108bfff26792729bde4a1dd0638292f852a042d40a0a1991ff2ae58b0b?d=mp&s=160"},"body":"Dear Stefan,\n\nOn Thu, Sep 16, 2010 at 03:46:20PM +0200, Stefan Naewe wrote:\n> On 9/16/2010 2:53 PM, Kumar Appaiah wrote:\n> > I observed that, since commit\n> > 53c089443cd9885fa677becee4bf7ffd56c3c357, tig show <commit> doesn't\n> > seem to work the same way as I had expected it to. The documentation\n> > update doesn't seem to indicate that this was to be expected (or I\n> > didn't understand it properly). Could someone please confirm that\n> > tig show <commit> should actually do something similar to git show <commit> | tig ?\n> > \n> > Thanks!\n> \n> Works as expected for me on Debian Linux 5.0.6 i686:\n> \n> $ git version\n> git version 1.7.2.3\n> \n> $ git describe\n> tig-0.16-11-gf1fe753\n> \n> and on Cygwin with the same tig version and \"git version 1.7.2.3.msysgit.1\"\n> \n> Your tig version, OS, etc. ?\n\nHere are the details:\n\nTIG_VERSION=\"0.16-11-gf1fe753\"\n\n[kumar@redsun ~/Software/tig/tig] git --version\ngit version 1.7.1\n\n./tig show HEAD\n./tig show HEAD^ # Both show me f1fe753be71ef3ce5abcbb16c2a359f97e5c7e7d\n\nNow, if I check out 53c089443cd9885fa677becee4bf7ffd56c3c357^, then I\nget back the expected behaviour.\n\nPlease let me know if I've made some mistake.\n\nThanks!\n\nKumar\n"},{"id":"150840","messageId":"20100916190323.GL5785@bowser.ece.utexas.edu","threadId":"25123","inReplyTo":"4C9222A9.4070801@atlas-elektronik.com","subject":"Re: tig show <commit> not working anymore?","fromName":"Kumar Appaiah","fromEmail":"a.kumar@alumni.iitm.ac.in","sentAt":"2010-09-16T19:03:23Z","receivedAt":"2010-09-16T19:03:23Z","isPatch":false,"sender":{"key":"a.kumar@alumni.iitm.ac.in","avatar":"https://gravatar.com/avatar/7ce299108bfff26792729bde4a1dd0638292f852a042d40a0a1991ff2ae58b0b?d=mp&s=160"},"body":"On Thu, Sep 16, 2010 at 03:59:05PM +0200, Stefan Naewe wrote:\n> On 9/16/2010 3:52 PM, Michael J Gruber wrote:\n> > It seems that since that tig commit, \"tig show <commit>\" shows HEAD\n> > rather than <commit>. OTOH, \"tig <commit>\" does navigate to <commit>.\n> \n> Oops...how true.\n> \n> I tested 'tig show <commit>' and noticed it showed something but\n> didn't look close enough 8-|\n\nAh, maybe I should have been more explicit and specified that it shows\nme the wrong commit. :-)\n\nI did attempt to fix the code myself, but I require a more thorough\nunderstanding of the code to be able to fix it myself.\n\nThanks.\n\nKumar\n"},{"id":"150923","messageId":"20100918050122.GA24656@bluemoon.alumni.iitm.ac.in","threadId":"25123","inReplyTo":"4C922112.404@drmicha.warpmail.net","subject":"Re: tig show <commit> not working anymore?","fromName":"Kumar Appaiah","fromEmail":"a.kumar@alumni.iitm.ac.in","sentAt":"2010-09-18T05:01:22Z","receivedAt":"2010-09-18T05:01:22Z","isPatch":false,"sender":{"key":"a.kumar@alumni.iitm.ac.in","avatar":"https://gravatar.com/avatar/7ce299108bfff26792729bde4a1dd0638292f852a042d40a0a1991ff2ae58b0b?d=mp&s=160"},"body":"On Thu, Sep 16, 2010 at 03:52:18PM +0200, Michael J Gruber wrote:\n> > I observed that, since commit\n> > 53c089443cd9885fa677becee4bf7ffd56c3c357, tig show <commit> doesn't\n> > seem to work the same way as I had expected it to. The documentation\n> > update doesn't seem to indicate that this was to be expected (or I\n> > didn't understand it properly). Could someone please confirm that\n> > tig show <commit> should actually do something similar to git show <commit> | tig ?\n> \n> It seems that since that tig commit, \"tig show <commit>\" shows HEAD\n> rather than <commit>. OTOH, \"tig <commit>\" does navigate to <commit>.\n> \n> The reason is that tig passes %(commit), not %(revargs), to git show for\n> the \"show\" subcommand, but the obvious simple patch breaks diff view. I\n> guess somewhere in the codepath one has to differentiate between those.\n> cc'ing Mr. Tig...\n\nPlease bear in mind that I am totally new to the code, and not a power\nuser of git either. So please don't club me! ;-)\n\nWell, I was exploring the code a little, and I could not understand\nsome aspects fully. First, I discovered that the following hack fixes\nthe problem to an extent:\n\ndiff --git a/tig.c b/tig.c\nindex e0e812c..aa38e71 100644\n--- a/tig.c\n+++ b/tig.c\n@@ -7864,7 +7864,7 @@ parse_options(int argc, const char *argv[])\n\n        if (filter_argv)\n                filter_options(filter_argv);\n-\n+       if (!strcmp(subcommand, \"show\") && opt_rev_args && opt_rev_args[0]) { string_copy_rev(ref_commit, opt_rev_args[0]); }\n        return request;\n }\n\nHowever, I am pretty certain that that is not the intended use of\nopt_rev_args and ref_commit, and that they should be used in a\ndifferent way. For example, tig show HEAD^^^..HEAD should show me\nthree commits combined, but it shows me only one, since I haven't run\nit through rev-list or the like¸ probably.\n\nI'll continue to try getting at a fix, unless someone comes to it\nbefore me.\n\nThanks!\n\nKumar\n"},{"id":"150954","messageId":"AANLkTimw3F8x5CqkFQ+owR1RHBJndquXE1KamrKeMV0g@mail.gmail.com","threadId":"25123","inReplyTo":"20100918050122.GA24656@bluemoon.alumni.iitm.ac.in","subject":"Re: tig show <commit> not working anymore?","fromName":"Jonas Fonseca","fromEmail":"fonseca@diku.dk","sentAt":"2010-09-18T14:47:42Z","receivedAt":"2010-09-18T14:47:42Z","isPatch":false,"sender":{"key":"fonseca@diku.dk","avatar":"https://gravatar.com/avatar/f82f3ad698717c51873b020c750a92438c820a24056dc39fe4d07baa10a92264?d=mp&s=160"},"body":"On Sat, Sep 18, 2010 at 01:01, Kumar Appaiah <a.kumar@alumni.iitm.ac.in> wrote:\n> I'll continue to try getting at a fix, unless someone comes to it\n> before me.\n\nI will take a look sometime today and hopefully release a new version.\n\n-- \nJonas Fonseca\n"},{"id":"151003","messageId":"AANLkTinwTSOVfdZkt8CM9DHy9mm9nPt133nvUNjUcQO1@mail.gmail.com","threadId":"25123","inReplyTo":"20100918050122.GA24656@bluemoon.alumni.iitm.ac.in","subject":"Re: tig show <commit> not working anymore?","fromName":"Jonas Fonseca","fromEmail":"fonseca@diku.dk","sentAt":"2010-09-19T18:46:22Z","receivedAt":"2010-09-19T18:46:22Z","isPatch":false,"sender":{"key":"fonseca@diku.dk","avatar":"https://gravatar.com/avatar/f82f3ad698717c51873b020c750a92438c820a24056dc39fe4d07baa10a92264?d=mp&s=160"},"body":"On Sat, Sep 18, 2010 at 01:01, Kumar Appaiah <a.kumar@alumni.iitm.ac.in> wrote:\n> Please bear in mind that I am totally new to the code, and not a power\n> user of git either. So please don't club me! ;-)\n\nOK, I will give you a hug. :-)\n\n> Well, I was exploring the code a little, and I could not understand\n> some aspects fully. First, I discovered that the following hack fixes\n> the problem to an extent:\n>\n> [snip]\n>\n> However, I am pretty certain that that is not the intended use of\n> opt_rev_args and ref_commit, and that they should be used in a\n> different way. For example, tig show HEAD^^^..HEAD should show me\n> three commits combined, but it shows me only one, since I haven't run\n> it through rev-list or the like¸ probably.\n\nYou fix is not that far off but to fix the second issue I had to do\nchange the function responsible for expanding %(commit). Anyway,\nshould be fixed in 0.16.1.\n\n-- \nJonas Fonseca\n"},{"id":"151043","messageId":"20100920042522.GA21880@bluemoon.alumni.iitm.ac.in","threadId":"25123","inReplyTo":"AANLkTinwTSOVfdZkt8CM9DHy9mm9nPt133nvUNjUcQO1@mail.gmail.com","subject":"Re: tig show <commit> not working anymore?","fromName":"Kumar Appaiah","fromEmail":"a.kumar@alumni.iitm.ac.in","sentAt":"2010-09-20T04:25:22Z","receivedAt":"2010-09-20T04:25:22Z","isPatch":false,"sender":{"key":"a.kumar@alumni.iitm.ac.in","avatar":"https://gravatar.com/avatar/7ce299108bfff26792729bde4a1dd0638292f852a042d40a0a1991ff2ae58b0b?d=mp&s=160"},"body":"Dear Jonas,\n\nOn Sun, Sep 19, 2010 at 02:46:22PM -0400, Jonas Fonseca wrote:\n> > Well, I was exploring the code a little, and I could not understand\n> > some aspects fully. First, I discovered that the following hack fixes\n> > the problem to an extent:\n> >\n> > [snip]\n> >\n> > However, I am pretty certain that that is not the intended use of\n> > opt_rev_args and ref_commit, and that they should be used in a\n> > different way. For example, tig show HEAD^^^..HEAD should show me\n> > three commits combined, but it shows me only one, since I haven't run\n> > it through rev-list or the like¸ probably.\n> \n> You fix is not that far off but to fix the second issue I had to do\n> change the function responsible for expanding %(commit). Anyway,\n> should be fixed in 0.16.1.\n\nUnfortunately, this has introduced another (albeit minor) bug: it\nbreaks the tree view in some cases. For example:\n\ngit clone git://gitorious.org/taggrepper/taggrepper.git\n\nand run tig there, and press `t'. It always gives me a blank tree.\n\nThe cause for this is that view->parent is null when the tree view\nis invoked, but you merely pass !view->parent in the call to\nformat_argv in prepare_io.\n\nA simple patch to fix this is attached below, but you might have other\nideas or I might have missed something, or not added sufficient checks\nfor the argv vector.\n\nAs always, if I have missed something above, please do let me know.\n\nThanks!\n\nKumar\n\nFrom 1295e58dbb3035bba3ebaf8686dc328b2b457ae2 Mon Sep 17 00:00:00 2001\nFrom: Kumar Appaiah <a.kumar@alumni.iitm.ac.in>\nDate: Sun, 19 Sep 2010 23:19:16 -0500\nSubject: [PATCH] Add check to fix tree view\n\n---\n tig.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/tig.c b/tig.c\nindex 7bc5daa..08042ec 100644\n--- a/tig.c\n+++ b/tig.c\n@@ -3332,7 +3332,7 @@ static bool\n prepare_io(struct view *view, const char *dir, const char *argv[], bool replace)\n {\n \tview->dir = dir;\n-\treturn format_argv(&view->argv, argv, replace, !view->parent);\n+\treturn format_argv(&view->argv, argv, replace, !view->parent && strcmp(argv[1], \"ls-tree\"));\n }\n \n static bool\n-- \n1.7.1\n"},{"id":"151211","messageId":"AANLkTi=AUiLJJp6JLqWoJufBFDUKa7u3Eg9Az5uGteqM@mail.gmail.com","threadId":"25123","inReplyTo":"20100920042522.GA21880@bluemoon.alumni.iitm.ac.in","subject":"Re: tig show <commit> not working anymore?","fromName":"Jonas Fonseca","fromEmail":"fonseca@diku.dk","sentAt":"2010-09-21T12:56:21Z","receivedAt":"2010-09-21T12:56:21Z","isPatch":false,"sender":{"key":"fonseca@diku.dk","avatar":"https://gravatar.com/avatar/f82f3ad698717c51873b020c750a92438c820a24056dc39fe4d07baa10a92264?d=mp&s=160"},"body":"On Mon, Sep 20, 2010 at 00:25, Kumar Appaiah <a.kumar@alumni.iitm.ac.in> wrote:\n> On Sun, Sep 19, 2010 at 02:46:22PM -0400, Jonas Fonseca wrote:\n>> You fix is not that far off but to fix the second issue I had to do\n>> change the function responsible for expanding %(commit). Anyway,\n>> should be fixed in 0.16.1.\n>\n> Unfortunately, this has introduced another (albeit minor) bug: it\n> breaks the tree view in some cases. For example:\n>\n> git clone git://gitorious.org/taggrepper/taggrepper.git\n>\n> and run tig there, and press `t'. It always gives me a blank tree.\n>\n> The cause for this is that view->parent is null when the tree view\n> is invoked, but you merely pass !view->parent in the call to\n> format_argv in prepare_io.\n\nOops, I should really finish the tig.c split up branch and introduce a\ntest suite to catch stuff like this.\n\n> A simple patch to fix this is attached below, but you might have other\n> ideas or I might have missed something, or not added sufficient checks\n> for the argv vector.\n>\n> As always, if I have missed something above, please do let me know.\n\nThanks for the patch and for reporting this. I've fixed this by using\nview->prev instead of view->parent. The view->prev tracks the list of\nviews whereas view->parent tracks parents/child relationships in split\nview mode. It was one of the things I refactored not long ago.\n\n-- \nJonas Fonseca\n"}]}