{"thread":{"id":"38085","subject":"[BUG] Documentation: git log: --exit-code undocumented?","startedAt":"2014-12-01T11:50:43Z","lastAt":"2014-12-02T12:27:05Z","messageCount":10,"participants":["Sergey Organov","Junio C Hamano","David Kastrup","John Keeping"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"252776","messageId":"87zjb78u7g.fsf@osv.gnss.ru","threadId":"38085","inReplyTo":null,"subject":"[BUG] Documentation: git log: --exit-code undocumented?","fromName":"Sergey Organov","fromEmail":"sorganov@gmail.com","sentAt":"2014-12-01T11:50:43Z","receivedAt":"2014-12-01T11:50:43Z","isPatch":false,"sender":{"key":"sorganov@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8501568?v=4"},"body":"Hello,\n\n$ git help log | grep exit-code\n           problems are found. Not compatible with --exit-code.\n$\n\nWhat --exit-code does in \"git log\"?\n\n-- \nSergey.\n"},{"id":"252786","messageId":"xmqqegsjqqox.fsf@gitster.dls.corp.google.com","threadId":"38085","inReplyTo":"87zjb78u7g.fsf@osv.gnss.ru","subject":"Re: [BUG] Documentation: git log: --exit-code undocumented?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-12-01T16:29:18Z","receivedAt":"2014-12-01T16:29:18Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sergey Organov <sorganov@gmail.com> writes:\n\n> Hello,\n>\n> $ git help log | grep exit-code\n>            problems are found. Not compatible with --exit-code.\n> $\n>\n> What --exit-code does in \"git log\"?\n\nIt doesn't.  That is why it is not listed.\n"},{"id":"252787","messageId":"87wq6bgwl6.fsf@osv.gnss.ru","threadId":"38085","inReplyTo":"xmqqegsjqqox.fsf@gitster.dls.corp.google.com","subject":"Re: [BUG] Documentation: git log: --exit-code undocumented?","fromName":"Sergey Organov","fromEmail":"sorganov@gmail.com","sentAt":"2014-12-01T16:32:05Z","receivedAt":"2014-12-01T16:32:05Z","isPatch":false,"sender":{"key":"sorganov@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8501568?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Sergey Organov <sorganov@gmail.com> writes:\n>\n>> Hello,\n>>\n>> $ git help log | grep exit-code\n>>            problems are found. Not compatible with --exit-code.\n>> $\n>>\n>> What --exit-code does in \"git log\"?\n>\n> It doesn't.  That is why it is not listed.\n\nThen, how can --check possibly interfer with it?\n\n-- \nSergey.\n"},{"id":"252788","messageId":"xmqqa937qqb7.fsf@gitster.dls.corp.google.com","threadId":"38085","inReplyTo":"87wq6bgwl6.fsf@osv.gnss.ru","subject":"Re: [BUG] Documentation: git log: --exit-code undocumented?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-12-01T16:37:32Z","receivedAt":"2014-12-01T16:37:32Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sergey Organov <sorganov@gmail.com> writes:\n\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>> Sergey Organov <sorganov@gmail.com> writes:\n>>\n>>> Hello,\n>>>\n>>> $ git help log | grep exit-code\n>>>            problems are found. Not compatible with --exit-code.\n>>> $\n>>>\n>>> What --exit-code does in \"git log\"?\n>>\n>> It doesn't.  That is why it is not listed.\n>\n> Then, how can --check possibly interfer with it?\n\nThe description is shared with \"git diff\" and friends, which is\ninvoked via \"git log -p\".  As \"log\" does not give the exit code\nof individual \"diff-tree\" invocation for each commit, --exit-code\noption is irrelevant.\n"},{"id":"252789","messageId":"87oarngw2b.fsf@osv.gnss.ru","threadId":"38085","inReplyTo":"xmqqa937qqb7.fsf@gitster.dls.corp.google.com","subject":"Re: [BUG] Documentation: git log: --exit-code undocumented?","fromName":"Sergey Organov","fromEmail":"sorganov@gmail.com","sentAt":"2014-12-01T16:43:24Z","receivedAt":"2014-12-01T16:43:24Z","isPatch":false,"sender":{"key":"sorganov@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8501568?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Sergey Organov <sorganov@gmail.com> writes:\n>\n>> Junio C Hamano <gitster@pobox.com> writes:\n>>\n>>> Sergey Organov <sorganov@gmail.com> writes:\n>>>\n>>>> Hello,\n>>>>\n>>>> $ git help log | grep exit-code\n>>>>            problems are found. Not compatible with --exit-code.\n>>>> $\n>>>>\n>>>> What --exit-code does in \"git log\"?\n>>>\n>>> It doesn't.  That is why it is not listed.\n>>\n>> Then, how can --check possibly interfer with it?\n>\n> The description is shared with \"git diff\" and friends, which is\n> invoked via \"git log -p\".  As \"log\" does not give the exit code\n> of individual \"diff-tree\" invocation for each commit, --exit-code\n> option is irrelevant.\n\nDo you agree there is some minor problem here? First, \"git log\"\nsilently eats the --exit-code option that does nothing. Next, git-log\nmanual page doesn't include --exit-log description while refers to it\nelsewhere. What's proposed resulution?\n\n-- \nSergey.\n"},{"id":"252791","messageId":"874mtfl1hx.fsf@fencepost.gnu.org","threadId":"38085","inReplyTo":"xmqqegsjqqox.fsf@gitster.dls.corp.google.com","subject":"Re: [BUG] Documentation: git log: --exit-code undocumented?","fromName":"David Kastrup","fromEmail":"dak@gnu.org","sentAt":"2014-12-01T17:32:26Z","receivedAt":"2014-12-01T17:32:26Z","isPatch":false,"sender":{"key":"dak@gnu.org","avatar":"https://avatars.githubusercontent.com/u/52141349?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Sergey Organov <sorganov@gmail.com> writes:\n>\n>> Hello,\n>>\n>> $ git help log | grep exit-code\n>>            problems are found. Not compatible with --exit-code.\n>> $\n>>\n>> What --exit-code does in \"git log\"?\n>\n> It doesn't.  That is why it is not listed.\n\nI disagree that --exit-code does nothing: it indicates whether the\nlisted log is empty.  So for example\n\ngit log -1 --exit-code a..b > /dev/null\n\ncan be used to figure out whether \"a\" is a proper ancestor of \"b\" or\nnot.\n\n-- \nDavid Kastrup\n"},{"id":"252795","messageId":"xmqqwq6bp8ey.fsf@gitster.dls.corp.google.com","threadId":"38085","inReplyTo":"874mtfl1hx.fsf@fencepost.gnu.org","subject":"Re: [BUG] Documentation: git log: --exit-code undocumented?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-12-01T17:49:25Z","receivedAt":"2014-12-01T17:49:25Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"David Kastrup <dak@gnu.org> writes:\n\n> I disagree that --exit-code does nothing: it indicates whether the\n> listed log is empty.  So for example\n>\n> git log -1 --exit-code a..b > /dev/null\n>\n> can be used to figure out whether \"a\" is a proper ancestor of \"b\" or\n> not.\n\nHmph.\n\n    $ git log --exit-code master..maint >/dev/null; echo $?\n    0\n    $ git log --exit-code maint..master >/dev/null; echo $?\n    1\n\nThat is a strange way to use --exit-code.  I suspect that if you did\nthis, you will get 0 from the log between HEAD~..HEAD\n\n    $ git checkout master^0\n    $ git commit --allow-empty -m empty\n    $ git log --exit-code HEAD~..HEAD\n\neven though HEAD~ is a proper ancestor of HEAD, so it is not giving\nus anything useful.  Isn't it a mere artifact that \"log\" happens to\nshare the underlying machinery with \"diff\" that --exit-code shows a\nnon-zero exit when there is any single commit in the range that has\nany change?\n"},{"id":"252799","messageId":"87zjb7jk8q.fsf@fencepost.gnu.org","threadId":"38085","inReplyTo":"xmqqwq6bp8ey.fsf@gitster.dls.corp.google.com","subject":"Re: [BUG] Documentation: git log: --exit-code undocumented?","fromName":"David Kastrup","fromEmail":"dak@gnu.org","sentAt":"2014-12-01T18:30:29Z","receivedAt":"2014-12-01T18:30:29Z","isPatch":false,"sender":{"key":"dak@gnu.org","avatar":"https://avatars.githubusercontent.com/u/52141349?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> David Kastrup <dak@gnu.org> writes:\n>\n>> I disagree that --exit-code does nothing: it indicates whether the\n>> listed log is empty.  So for example\n>>\n>> git log -1 --exit-code a..b > /dev/null\n>>\n>> can be used to figure out whether \"a\" is a proper ancestor of \"b\" or\n>> not.\n>\n> Hmph.\n>\n>     $ git log --exit-code master..maint >/dev/null; echo $?\n>     0\n>     $ git log --exit-code maint..master >/dev/null; echo $?\n>     1\n>\n> That is a strange way to use --exit-code.  I suspect that if you did\n> this, you will get 0 from the log between HEAD~..HEAD\n>\n>     $ git checkout master^0\n>     $ git commit --allow-empty -m empty\n>     $ git log --exit-code HEAD~..HEAD\n>\n> even though HEAD~ is a proper ancestor of HEAD, so it is not giving\n> us anything useful.  Isn't it a mere artifact that \"log\" happens to\n> share the underlying machinery with \"diff\" that --exit-code shows a\n> non-zero exit when there is any single commit in the range that has\n> any change?\n\nPossibly: I haven't checked the underlying code for the details.  At any\nrate, it is an option git log accepts for whatever reason.\n\n-- \nDavid Kastrup\n"},{"id":"252848","messageId":"87ppc2xp9k.fsf@osv.gnss.ru","threadId":"38085","inReplyTo":"xmqqwq6bp8ey.fsf@gitster.dls.corp.google.com","subject":"Re: [BUG] Documentation: git log: --exit-code undocumented?","fromName":"Sergey Organov","fromEmail":"sorganov@gmail.com","sentAt":"2014-12-02T11:30:31Z","receivedAt":"2014-12-02T11:30:31Z","isPatch":false,"sender":{"key":"sorganov@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8501568?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> David Kastrup <dak@gnu.org> writes:\n>\n>> I disagree that --exit-code does nothing: it indicates whether the\n>> listed log is empty.  So for example\n>>\n>> git log -1 --exit-code a..b > /dev/null\n>>\n>> can be used to figure out whether \"a\" is a proper ancestor of \"b\" or\n>> not.\n>\n> Hmph.\n>\n>     $ git log --exit-code master..maint >/dev/null; echo $?\n>     0\n>     $ git log --exit-code maint..master >/dev/null; echo $?\n>     1\n>\n> That is a strange way to use --exit-code.\n\nWhat's the best way then to tell if \"a\" is an ancestor of \"b\"?\n\n-- \nSergey.\n"},{"id":"252860","messageId":"20141202122705.GA22967@serenity.lan","threadId":"38085","inReplyTo":"87ppc2xp9k.fsf@osv.gnss.ru","subject":"Re: [BUG] Documentation: git log: --exit-code undocumented?","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2014-12-02T12:27:05Z","receivedAt":"2014-12-02T12:27:05Z","isPatch":false,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"On Tue, Dec 02, 2014 at 02:30:31PM +0300, Sergey Organov wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n> \n> > David Kastrup <dak@gnu.org> writes:\n> >\n> >> I disagree that --exit-code does nothing: it indicates whether the\n> >> listed log is empty.  So for example\n> >>\n> >> git log -1 --exit-code a..b > /dev/null\n> >>\n> >> can be used to figure out whether \"a\" is a proper ancestor of \"b\" or\n> >> not.\n> >\n> > Hmph.\n> >\n> >     $ git log --exit-code master..maint >/dev/null; echo $?\n> >     0\n> >     $ git log --exit-code maint..master >/dev/null; echo $?\n> >     1\n> >\n> > That is a strange way to use --exit-code.\n> \n> What's the best way then to tell if \"a\" is an ancestor of \"b\"?\n\ngit merge-base --is-ancestor a b\n"}]}