{"thread":{"id":"3936","subject":"git-log produces no output","startedAt":"2006-04-21T17:20:01Z","lastAt":"2006-04-21T20:25:37Z","messageCount":10,"participants":["Bob Portmann","Linus Torvalds","Paolo Ciarrocchi","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"18970","messageId":"20060421172001.44441.qmail@web60325.mail.yahoo.com","threadId":"3936","inReplyTo":null,"subject":"git-log produces no output","fromName":"Bob Portmann","fromEmail":"bportmann@yahoo.com","sentAt":"2006-04-21T17:20:01Z","receivedAt":"2006-04-21T17:20:01Z","isPatch":false,"sender":{"key":"bportmann@yahoo.com","avatar":null},"body":"I am just starting out with git and have a noob question about got-log.\n I cannot get any output out of it and am wondering if I am using it\ncorrectly or it is broken.  As I understand it, git-log should just\nprint out the log messages but not the changes, whereas git-whatchanged\nwill print out both.  But while git-whatchanged works, git-log never\ndoes.  I have a trivial example below which shows what I mean.  But I\nget the same result using my real archives and out of git.git as well.\n\nThanks,\nBob\n\nPS I'm using git 1.3.0 and have tried this on both Mac OS X and Linux\nwith the same results.\n\nTrivial example:\ngit-test> mkdir test-log\ngit-test> cd test-log\ntest-log> git-init-db\ndefaulting to local storage area\ntest-log> echo \"Hello World\" >hello\ntest-log> git add .\ntest-log> git commit -a -m 'One line hello'\nCommitting initial tree 117c62a8c5e01758bd284126a6af69deab9dbbe2\ntest-log> echo \"Hello World 2\" >>hello\ntest-log> git commit -a -m 'Two line hello'\ntest-log> git whatchanged -p\ndiff-tree 9a4d7602fff052b6796c2862edddd11ae2e45d08 (from\na38306518c5e5e8eb630c02Author: Bob Portmann <portmann@xxxx.xx.xx>\nDate:   Fri Apr 21 10:56:11 2006 -0600\n\n    Two line hello\n\ndiff --git a/hello b/hello\nindex 557db03..514e5c5 100644\n--- a/hello\n+++ b/hello\n@@ -1 +1,2 @@\n Hello World\n+Hello World 2\ntest-log> git log\ntest-log> \n\nAs you can see git log produces no output.  I've tried it with other\noptions with the same result.\n\n\n__________________________________________________\nDo You Yahoo!?\nTired of spam?  Yahoo! Mail has the best spam protection around \nhttp://mail.yahoo.com \n"},{"id":"18972","messageId":"Pine.LNX.4.64.0604211102000.3701@g5.osdl.org","threadId":"3936","inReplyTo":"20060421172001.44441.qmail@web60325.mail.yahoo.com","subject":"Re: git-log produces no output","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-04-21T18:11:17Z","receivedAt":"2006-04-21T18:11:17Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Fri, 21 Apr 2006, Bob Portmann wrote:\n>\n>  I cannot get any output out of it and am wondering if I am using it\n> correctly or it is broken.\n\nYou're using it correctly, but it isn't broken for me. \n\n> As I understand it, git-log should just print out the log messages but \n> not the changes, whereas git-whatchanged will print out both.\n\nWell, in 1.3.0, \"git log\" can actually do both, and you can get the \nwhatchanged output by just saying \"git log -p\".\n\nBut yes, without the \"-p\", you should get just the log.\n\nAnd that's exactly what I get, both with current HEAD git, and with a \nv1.3.0 checkout.\n\n> test-log> git log\n> test-log> \n> \n> As you can see git log produces no output.  I've tried it with other\n> options with the same result.\n\nVery strange indeed. Can you do\n\n\tgit log > file\n\nto see if that changes (and see if the file contains anything)? The reason \nI mention that is that by default \"git log\" will start a pager for you, \nand if you somehow have a broken PAGER setup, I could imagine exactly the \nbehaviour you see (although I don't see why \"git whatchanged\" would work \neither, in that case).\n\nFinally, if that doesn't output anything either, please do (for just that \nsmall repository, so that the trace is also small)\n\n\tstrace -o git-trace git log > /dev/null\n\nand send out the result. Again, for PAGER reasons, that \"> /dev/null\" is \nactually important, because we don't want to trigger the pager code.\n\n\t\tLinus\n"},{"id":"18973","messageId":"20060421184815.22939.qmail@web60319.mail.yahoo.com","threadId":"3936","inReplyTo":"Pine.LNX.4.64.0604211102000.3701@g5.osdl.org","subject":"Re: git-log produces no output","fromName":"Bob Portmann","fromEmail":"bportmann@yahoo.com","sentAt":"2006-04-21T18:48:15Z","receivedAt":"2006-04-21T18:48:15Z","isPatch":false,"sender":{"key":"bportmann@yahoo.com","avatar":null},"body":"--- Linus Torvalds <torvalds@osdl.org> wrote:\n> On Fri, 21 Apr 2006, Bob Portmann wrote:\n> >\n> >  I cannot get any output out of it and am wondering if I am using\n> it\n> > correctly or it is broken.\n> \n> You're using it correctly, but it isn't broken for me. \n> \n> > As I understand it, git-log should just print out the log messages\n> but \n> > not the changes, whereas git-whatchanged will print out both.\n> \n> Well, in 1.3.0, \"git log\" can actually do both, and you can get the \n> whatchanged output by just saying \"git log -p\".\n> \n> But yes, without the \"-p\", you should get just the log.\n> \n> And that's exactly what I get, both with current HEAD git, and with a\n> \n> v1.3.0 checkout.\n> \n> > test-log> git log\n> > test-log> \n> > \n> > As you can see git log produces no output.  I've tried it with\n> other\n> > options with the same result.\n> \n> Very strange indeed. Can you do\n> \n> \tgit log > file\n> \n> to see if that changes (and see if the file contains anything)? The\n> reason \n> I mention that is that by default \"git log\" will start a pager for\n> you, \n> and if you somehow have a broken PAGER setup, I could imagine exactly\n> the \n> behaviour you see (although I don't see why \"git whatchanged\" would\n> work \n> either, in that case).\n\nYes, this is the problem.  It works when I send it to a file.  It seems\nto be that having any extra options my PAGER command that messes it up\n(see below).  If get-log was a shell script I would imagine that some\nquotes are missing:-)\n\nBob\n\ntest-log> export PAGER='more'\ntest-log> git log\ncommit 9a4d7602fff052b6796c2862edddd11ae2e45d08\nAuthor: Bob Portmann <portmann@removed>\nDate:   Fri Apr 21 10:56:11 2006 -0600\n\n    Two line hello\n\ncommit a38306518c5e5e8eb630c02a47bec2a9fc292025\nAuthor: Bob Portmann <portmann@removed>\nDate:   Fri Apr 21 10:55:44 2006 -0600\n\n    One line hello\n\ntest-log> export PAGER='more -i'\ntest-log> git log\ntest-log> \n\nAdding the option -i (which should do nothing) has eliminated the\noutput.\n\n\n> Finally, if that doesn't output anything either, please do (for just\n> that \n> small repository, so that the trace is also small)\n> \n> \tstrace -o git-trace git log > /dev/null\n> \n> and send out the result. Again, for PAGER reasons, that \"> /dev/null\"\n> is \n> actually important, because we don't want to trigger the pager code.\n> \n> \t\tLinus\n> \n\n\n__________________________________________________\nDo You Yahoo!?\nTired of spam?  Yahoo! Mail has the best spam protection around \nhttp://mail.yahoo.com \n"},{"id":"18974","messageId":"4d8e3fd30604211158w71e97efew9646203a5510f409@mail.gmail.com","threadId":"3936","inReplyTo":"20060421184815.22939.qmail@web60319.mail.yahoo.com","subject":"Re: git-log produces no output","fromName":"Paolo Ciarrocchi","fromEmail":"paolo.ciarrocchi@gmail.com","sentAt":"2006-04-21T18:58:40Z","receivedAt":"2006-04-21T18:58:40Z","isPatch":false,"sender":{"key":"paolo.ciarrocchi@gmail.com","avatar":null},"body":"On 4/21/06, Bob Portmann <bportmann@yahoo.com> wrote:\n[...]\n> test-log> export PAGER='more -i'\n> test-log> git log\n> test-log>\n>\n> Adding the option -i (which should do nothing) has eliminated the\n> output.\n\nWell, on my machine:\npaolo@Italia:~/gkernel$ more -i\nmore: unknown option \"-i\"\nusage: more [-dflpcsu] [+linenum | +/pattern] name1 name2 ...\n\nCiao,\n--\nPaolo\nhttp://paolociarrocchi.googlepages.com\n"},{"id":"18975","messageId":"20060421191316.48338.qmail@web60314.mail.yahoo.com","threadId":"3936","inReplyTo":"4d8e3fd30604211158w71e97efew9646203a5510f409@mail.gmail.com","subject":"Re: git-log produces no output","fromName":"Bob Portmann","fromEmail":"bportmann@yahoo.com","sentAt":"2006-04-21T19:13:16Z","receivedAt":"2006-04-21T19:13:16Z","isPatch":false,"sender":{"key":"bportmann@yahoo.com","avatar":null},"body":"--- Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com> wrote:\n> On 4/21/06, Bob Portmann <bportmann@yahoo.com> wrote:\n> [...]\n> > test-log> export PAGER='more -i'\n> > test-log> git log\n> > test-log>\n> >\n> > Adding the option -i (which should do nothing) has eliminated the\n> > output.\n> \n> Well, on my machine:\n> paolo@Italia:~/gkernel$ more -i\n> more: unknown option \"-i\"\n> usage: more [-dflpcsu] [+linenum | +/pattern] name1 name2 ...\n\nWell, then try an option that does work.  On my system less and more\nare essentially the same and -i just causes it to ignore case on\nsearches.  The PAGER is automatically setup to 'less -XRse' on my\nsystem (not sure why).  Changing it to 'more' makes git-log work, but\nit should work with 'less -XRse' as well since that works with other\ncommands on the system (e.g. man) and git-whatchanged as well.\n\nBob\n \n> Ciao,\n> --\n> Paolo\n> http://paolociarrocchi.googlepages.com\n> \n\n\n__________________________________________________\nDo You Yahoo!?\nTired of spam?  Yahoo! Mail has the best spam protection around \nhttp://mail.yahoo.com \n"},{"id":"18976","messageId":"Pine.LNX.4.64.0604211214560.3701@g5.osdl.org","threadId":"3936","inReplyTo":"20060421184815.22939.qmail@web60319.mail.yahoo.com","subject":"Re: git-log produces no output","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-04-21T19:18:38Z","receivedAt":"2006-04-21T19:18:38Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Fri, 21 Apr 2006, Bob Portmann wrote:\n> \n> Yes, this is the problem.  It works when I send it to a file.  It seems\n> to be that having any extra options my PAGER command that messes it up\n> (see below).  If get-log was a shell script I would imagine that some\n> quotes are missing:-)\n\nIt's the other way around: it's got \"too much\" quoting.\n\n\"git log\" will literally _execute_ the PAGER environment, not pass it to a \nshell, and not interpret any arguments.\n\nSo it will look for a program called \"more -i\" (space and all), and no \nsuch program exists, so the execve fails, and git log ends up being \nsilent.\n\nThis patch would have made things a lot more obvious.\n\nJunio?\n\n\t\tLinus\n---\ndiff --git a/pager.c b/pager.c\nindex b063353..9204641 100644\n--- a/pager.c\n+++ b/pager.c\n@@ -47,5 +47,6 @@ void setup_pager(void)\n \n \tsetenv(\"LESS\", \"-S\", 0);\n \trun_pager(pager);\n+\tdie(\"unable to execute pager '%s'\", pager);\n \texit(255);\n }\n"},{"id":"18977","messageId":"Pine.LNX.4.64.0604211223561.3701@g5.osdl.org","threadId":"3936","inReplyTo":"Pine.LNX.4.64.0604211214560.3701@g5.osdl.org","subject":"Re: git-log produces no output","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-04-21T19:25:13Z","receivedAt":"2006-04-21T19:25:13Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Fri, 21 Apr 2006, Linus Torvalds wrote:\n> \n> This patch would have made things a lot more obvious.\n\nActually, scratch that one, and use this one instead. Much better, and \nactually allows Bob's crazy PAGER environment variable to work, rather \nthan just reporting an error about it.\n\n\t\tLinus\n---\ndiff --git a/pager.c b/pager.c\nindex b063353..9a30939 100644\n--- a/pager.c\n+++ b/pager.c\n@@ -8,6 +8,7 @@ #include \"cache.h\"\n static void run_pager(const char *pager)\n {\n \texeclp(pager, pager, NULL);\n+\texecl(\"/bin/sh\", \"sh\", \"-c\", pager, NULL);\n }\n \n void setup_pager(void)\n@@ -47,5 +48,6 @@ void setup_pager(void)\n \n \tsetenv(\"LESS\", \"-S\", 0);\n \trun_pager(pager);\n+\tdie(\"unable to execute pager '%s'\", pager);\n \texit(255);\n }\n"},{"id":"18978","messageId":"20060421193808.57328.qmail@web60314.mail.yahoo.com","threadId":"3936","inReplyTo":"Pine.LNX.4.64.0604211223561.3701@g5.osdl.org","subject":"Re: git-log produces no output","fromName":"Bob Portmann","fromEmail":"bportmann@yahoo.com","sentAt":"2006-04-21T19:38:08Z","receivedAt":"2006-04-21T19:38:08Z","isPatch":false,"sender":{"key":"bportmann@yahoo.com","avatar":null},"body":"Yes, that fixes it, even with the crazy PAGER (which is going to be\nplain 'more' from now on:-)\n\nThanks,\nBob\n\n--- Linus Torvalds <torvalds@osdl.org> wrote:\n\n> On Fri, 21 Apr 2006, Linus Torvalds wrote:\n> > \n> > This patch would have made things a lot more obvious.\n> \n> Actually, scratch that one, and use this one instead. Much better,\n> and \n> actually allows Bob's crazy PAGER environment variable to work,\n> rather \n> than just reporting an error about it.\n> \n> \t\tLinus\n> ---\n> diff --git a/pager.c b/pager.c\n> index b063353..9a30939 100644\n> --- a/pager.c\n> +++ b/pager.c\n> @@ -8,6 +8,7 @@ #include \"cache.h\"\n>  static void run_pager(const char *pager)\n>  {\n>  \texeclp(pager, pager, NULL);\n> +\texecl(\"/bin/sh\", \"sh\", \"-c\", pager, NULL);\n>  }\n>  \n>  void setup_pager(void)\n> @@ -47,5 +48,6 @@ void setup_pager(void)\n>  \n>  \tsetenv(\"LESS\", \"-S\", 0);\n>  \trun_pager(pager);\n> +\tdie(\"unable to execute pager '%s'\", pager);\n>  \texit(255);\n>  }\n> \n\n\n__________________________________________________\nDo You Yahoo!?\nTired of spam?  Yahoo! Mail has the best spam protection around \nhttp://mail.yahoo.com \n"},{"id":"18979","messageId":"7vpsjasnh5.fsf@assigned-by-dhcp.cox.net","threadId":"3936","inReplyTo":"Pine.LNX.4.64.0604211223561.3701@g5.osdl.org","subject":"Re: git-log produces no output","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-04-21T20:05:58Z","receivedAt":"2006-04-21T20:05:58Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Linus Torvalds <torvalds@osdl.org> writes:\n\n> On Fri, 21 Apr 2006, Linus Torvalds wrote:\n>> \n>> This patch would have made things a lot more obvious.\n>\n> Actually, scratch that one, and use this one instead. Much better, and \n> actually allows Bob's crazy PAGER environment variable to work, rather \n> than just reporting an error about it.\n\nAgreed, this is much better than just punting.  Sign-off?\n\nBTW: The extended extended SHA1 is a great addition.  I do not\nusually have contrib/colordiff checked out (it is in \"pu\", not\nin \"next\"), but I can easily do:\n\n\tgit tar-tree pu:contrib/colordiff colordiff | tar xf -\n\nOf course \"git tar-tree pu | tar xf - contrib/colordiff\" would\nwork for this particular case, but that is besides the point.\n\nBTW: Allow me to try \"git fmt-patch -1\" ;-).\n\n-- >8 --\nFrom 34fd1c9ac5845d541e3196983df7f993e751b544  Thu Apr 7 15:13:13 2005\nFrom: Linus Torvalds <torvalds@osdl.org>\nDate: Fri Apr 21 12:25:13 2006 -0700\nSubject: git-log produces no output\n\nWhen $PAGER is set to 'less -i', we used to fail because we\nassumed the $PAGER is a command and simply exec'ed it.\n\nTry exec first, and then run it through shell if it fails.  This\nallows even funkier PAGERs like these ;-):\n\n\tPAGER='sed -e \"s/^/`date`: /\" | more'\n\tPAGER='contrib/colordiff.perl | less -RS'\n\nSigned-off-by: Linus Torvalds <torvalds@osdl.org>\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n pager.c |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/pager.c b/pager.c\nindex e5ba273..f7b8e78 100644\n--- a/pager.c\n+++ b/pager.c\n@@ -8,6 +8,7 @@ #include \"cache.h\"\n static void run_pager(const char *pager)\n {\n \texeclp(pager, pager, NULL);\n+\texecl(\"/bin/sh\", \"sh\", \"-c\", pager, NULL);\n }\n \n void setup_pager(void)\n@@ -47,5 +48,6 @@ void setup_pager(void)\n \n \tsetenv(\"LESS\", \"-S\", 0);\n \trun_pager(pager);\n+\tdie(\"unable to execute pager '%s'\", pager);\n \texit(255);\n }\n-- \n1.3.0.gd1e3\n"},{"id":"18980","messageId":"Pine.LNX.4.64.0604211322140.3701@g5.osdl.org","threadId":"3936","inReplyTo":"7vpsjasnh5.fsf@assigned-by-dhcp.cox.net","subject":"Re: git-log produces no output","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-04-21T20:25:37Z","receivedAt":"2006-04-21T20:25:37Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Fri, 21 Apr 2006, Junio C Hamano wrote:\n>\n> Linus Torvalds <torvalds@osdl.org> writes:\n> \n> > On Fri, 21 Apr 2006, Linus Torvalds wrote:\n> >> \n> >> This patch would have made things a lot more obvious.\n> >\n> > Actually, scratch that one, and use this one instead. Much better, and \n> > actually allows Bob's crazy PAGER environment variable to work, rather \n> > than just reporting an error about it.\n> \n> Agreed, this is much better than just punting.  Sign-off?\n\nYup, you can just go wild with the \n\n\tSigned-off-by: Linus Torvalds <torvalds@osdl.org>\n\nlines. My employment contract requires that everything I produce is open \nsource ;)\n\n> BTW: The extended extended SHA1 is a great addition.  I do not\n> usually have contrib/colordiff checked out (it is in \"pu\", not\n> in \"next\"), but I can easily do:\n> \n> \tgit tar-tree pu:contrib/colordiff colordiff | tar xf -\n\nAhh, yes. That is one situation where a sub-tree SHA1 makes more sense \nthan most (the fact that it works with \"git diff\" and directory renames is \nlikely more of a curiosity than anything widely useful, I think)\n\n> BTW: Allow me to try \"git fmt-patch -1\" ;-).\n\nLooks good to me.\n\n\t\tLinus\n"}]}