{"thread":{"id":"38809","subject":"[PATCH v3] log: forbid log --graph --no-walk","startedAt":"2015-03-15T00:43:14Z","lastAt":"2015-03-16T19:15:59Z","messageCount":7,"participants":["Manos Pitsidianakis","Dongcan Jiang","Junio C Hamano"],"isPatch":true,"patchVersion":3,"patchTotal":null},"messages":[{"id":"257698","messageId":"5504D5A2.2070405@norn.io","threadId":"38809","inReplyTo":"md5:DbynqDqKsm8mpedJ3B12rw==","subject":"[PATCH v3] log: forbid log --graph --no-walk","fromName":"Manos Pitsidianakis","fromEmail":"epilys@norn.io","sentAt":"2015-03-15T00:43:14Z","receivedAt":"2015-03-15T00:43:14Z","isPatch":true,"sender":{"key":"epilys@norn.io","avatar":"https://gravatar.com/avatar/f68083a5405ad14d6e324de2eb2dc2beab603134c1847f421fb0c0095f3b4625?d=mp&s=160"},"body":"In git-log, --graph shows a graphical representation of a continuous\ncommit history, and --no-walk shows discrete specified commits without\ncontinuity. Using both doesn't make sense, so we forbid the combined use\nof these flags.\n\nSigned-off-by: Manos Pitsidianakis <epilys@norn.io>\n---\nThis is a microproject intended to complement my GSoC application.\n builtin/log.c  | 2 ++\n t/t4202-log.sh | 4 ++++\n 2 files changed, 6 insertions(+)\n\ndiff --git a/builtin/log.c b/builtin/log.c\nindex dd8f3fc..5aaf964 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -155,6 +155,8 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,\n \tmemset(&w, 0, sizeof(w));\n \tuserformat_find_requirements(NULL, &w);\n \n+\tif (rev->graph && rev->no_walk)\n+\t\tdie(\"--graph and --no-walk are incompatible\");\n \tif (!rev->show_notes_given && (!rev->pretty_given || w.notes))\n \t\trev->show_notes = 1;\n \tif (rev->show_notes)\ndiff --git a/t/t4202-log.sh b/t/t4202-log.sh\nindex 5f2b290..5d72713 100755\n--- a/t/t4202-log.sh\n+++ b/t/t4202-log.sh\n@@ -887,4 +887,8 @@ test_expect_success GPG 'log --graph --show-signature for merged tag' '\n \tgrep \"^| | gpg: Good signature\" actual\n '\n \n+test_expect_success 'forbid log --graph --no-walk' '\n+\ttest_must_fail git log --graph --no-walk\n+'\n+\n test_done\n-- \n2.1.4\n"},{"id":"257699","messageId":"CABwkPcpdpsVUFa_GSr=qYazYQDBr_ygQTctFXmYQf2ZsRt5bpA@mail.gmail.com","threadId":"38809","inReplyTo":"5504D5A2.2070405@norn.io","subject":"Re: [PATCH v3] log: forbid log --graph --no-walk","fromName":"Dongcan Jiang","fromEmail":"dongcan.jiang@gmail.com","sentAt":"2015-03-15T01:08:57Z","receivedAt":"2015-03-15T01:08:57Z","isPatch":true,"sender":{"key":"dongcan.jiang@gmail.com","avatar":"https://avatars.githubusercontent.com/u/10103762?v=4"},"body":"it seems that your patch could not pass t4052-stat-output.sh.\n\nI think it would be better if you could improve the specification for\nthis change in Document/rev-list-options.txt\n\n2015-03-15 8:43 GMT+08:00 Manos Pitsidianakis <epilys@norn.io>:\n> In git-log, --graph shows a graphical representation of a continuous\n> commit history, and --no-walk shows discrete specified commits without\n> continuity. Using both doesn't make sense, so we forbid the combined use\n> of these flags.\n>\n> Signed-off-by: Manos Pitsidianakis <epilys@norn.io>\n> ---\n> This is a microproject intended to complement my GSoC application.\n>  builtin/log.c  | 2 ++\n>  t/t4202-log.sh | 4 ++++\n>  2 files changed, 6 insertions(+)\n>\n> diff --git a/builtin/log.c b/builtin/log.c\n> index dd8f3fc..5aaf964 100644\n> --- a/builtin/log.c\n> +++ b/builtin/log.c\n> @@ -155,6 +155,8 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,\n>         memset(&w, 0, sizeof(w));\n>         userformat_find_requirements(NULL, &w);\n>\n> +       if (rev->graph && rev->no_walk)\n> +               die(\"--graph and --no-walk are incompatible\");\n>         if (!rev->show_notes_given && (!rev->pretty_given || w.notes))\n>                 rev->show_notes = 1;\n>         if (rev->show_notes)\n> diff --git a/t/t4202-log.sh b/t/t4202-log.sh\n> index 5f2b290..5d72713 100755\n> --- a/t/t4202-log.sh\n> +++ b/t/t4202-log.sh\n> @@ -887,4 +887,8 @@ test_expect_success GPG 'log --graph --show-signature for merged tag' '\n>         grep \"^| | gpg: Good signature\" actual\n>  '\n>\n> +test_expect_success 'forbid log --graph --no-walk' '\n> +       test_must_fail git log --graph --no-walk\n> +'\n> +\n>  test_done\n> --\n> 2.1.4\n>\n>\n>\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n\n\n\n-- \n江东灿（Dongcan Jiang）\nTeam of Search Engine & Web Mining\nSchool of Electronic Engineering & Computer Science\nPeking University, Beijing, 100871, P.R.China\n"},{"id":"257700","messageId":"5504DF62.4050104@norn.io","threadId":"38809","inReplyTo":"CABwkPcpdpsVUFa_GSr=qYazYQDBr_ygQTctFXmYQf2ZsRt5bpA@mail.gmail.com","subject":"Re: [PATCH v3] log: forbid log --graph --no-walk","fromName":"Manos Pitsidianakis","fromEmail":"epilys@norn.io","sentAt":"2015-03-15T01:24:50Z","receivedAt":"2015-03-15T01:24:50Z","isPatch":true,"sender":{"key":"epilys@norn.io","avatar":"https://gravatar.com/avatar/f68083a5405ad14d6e324de2eb2dc2beab603134c1847f421fb0c0095f3b4625?d=mp&s=160"},"body":"On 03/15/2015 03:08 AM, Dongcan Jiang wrote:\n> it seems that your patch could not pass t4052-stat-output.sh.\n> \n> I think it would be better if you could improve the specification for\n> this change in Document/rev-list-options.txt\n\nCan't grok why this happens. What exactly is happening in\nt4052-stat-output.sh? Is it testing every possible combination of git\ncommands and arguments?\n"},{"id":"257701","messageId":"CABwkPcpRG0d23OCuoktRdXt9nyA3RtmxGkqkoQ-wApzZvtfYDQ@mail.gmail.com","threadId":"38809","inReplyTo":"5504DF62.4050104@norn.io","subject":"Re: [PATCH v3] log: forbid log --graph --no-walk","fromName":"Dongcan Jiang","fromEmail":"dongcan.jiang@gmail.com","sentAt":"2015-03-15T01:39:48Z","receivedAt":"2015-03-15T01:39:48Z","isPatch":true,"sender":{"key":"dongcan.jiang@gmail.com","avatar":"https://avatars.githubusercontent.com/u/10103762?v=4"},"body":"Because \"revs->no_walk\" gets set when it comes to \"git show\". You can\nfind more information on [1].\n\n[1] http://article.gmane.org/gmane.comp.version-control.git/264921\n\n2015-03-15 9:24 GMT+08:00 Manos Pitsidianakis <epilys@norn.io>:\n> On 03/15/2015 03:08 AM, Dongcan Jiang wrote:\n>> it seems that your patch could not pass t4052-stat-output.sh.\n>>\n>> I think it would be better if you could improve the specification for\n>> this change in Document/rev-list-options.txt\n>\n> Can't grok why this happens. What exactly is happening in\n> t4052-stat-output.sh? Is it testing every possible combination of git\n> commands and arguments?\n\n\n\n-- \n江东灿（Dongcan Jiang）\nTeam of Search Engine & Web Mining\nSchool of Electronic Engineering & Computer Science\nPeking University, Beijing, 100871, P.R.China\n"},{"id":"257811","messageId":"55072856.5090308@norn.io","threadId":"38809","inReplyTo":"CABwkPcpRG0d23OCuoktRdXt9nyA3RtmxGkqkoQ-wApzZvtfYDQ@mail.gmail.com","subject":"Re: [PATCH v3] log: forbid log --graph --no-walk","fromName":"Manos Pitsidianakis","fromEmail":"epilys@norn.io","sentAt":"2015-03-16T19:00:38Z","receivedAt":"2015-03-16T19:00:38Z","isPatch":true,"sender":{"key":"epilys@norn.io","avatar":"https://gravatar.com/avatar/f68083a5405ad14d6e324de2eb2dc2beab603134c1847f421fb0c0095f3b4625?d=mp&s=160"},"body":"On 03/15/2015 03:39 AM, Dongcan Jiang wrote:\n> Because \"revs->no_walk\" gets set when it comes to \"git show\".\n\nSo basically rewriting t4052-stat-output.sh to exclude git show --graph\ncases (or similar) is not enough. If rewriting git-show code is what is\nneeded, is that in the scope of a microproject?\n"},{"id":"257812","messageId":"xmqq7fugrc9m.fsf@gitster.dls.corp.google.com","threadId":"38809","inReplyTo":"55072856.5090308@norn.io","subject":"Re: [PATCH v3] log: forbid log --graph --no-walk","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-03-16T19:08:21Z","receivedAt":"2015-03-16T19:08:21Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Manos Pitsidianakis <epilys@norn.io> writes:\n\n> On 03/15/2015 03:39 AM, Dongcan Jiang wrote:\n>> Because \"revs->no_walk\" gets set when it comes to \"git show\".\n>\n> So basically rewriting t4052-stat-output.sh to exclude git show --graph\n> cases (or similar) is not enough. If rewriting git-show code is what is\n> needed, is that in the scope of a microproject?\n\nPerhaps 13b25381 (revision: forbid combining --graph and --no-walk,\n2015-03-11) that is queued on 'pu' would be a good answer to this\nquestion?\n"},{"id":"257813","messageId":"55072BEF.5040608@norn.io","threadId":"38809","inReplyTo":"xmqq7fugrc9m.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH v3] log: forbid log --graph --no-walk","fromName":"Manos Pitsidianakis","fromEmail":"epilys@norn.io","sentAt":"2015-03-16T19:15:59Z","receivedAt":"2015-03-16T19:15:59Z","isPatch":true,"sender":{"key":"epilys@norn.io","avatar":"https://gravatar.com/avatar/f68083a5405ad14d6e324de2eb2dc2beab603134c1847f421fb0c0095f3b4625?d=mp&s=160"},"body":"On 03/16/2015 09:08 PM, Junio C Hamano wrote:\n> Perhaps 13b25381 (revision: forbid combining --graph and --no-walk,\n> 2015-03-11) that is queued on 'pu' would be a good answer to this\n> question?\n\nDidn't notice a patch was queued on 'pu', thanks.\n"}]}