{"thread":{"id":"38806","subject":"[PATCH] forbid log --graph --no-walk","startedAt":"2015-03-14T21:31:59Z","lastAt":"2015-03-14T22:42:42Z","messageCount":2,"participants":["epilys","Kevin D"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"257686","messageId":"5504A8CF.9080202@norn.io","threadId":"38806","inReplyTo":null,"subject":"[PATCH] forbid log --graph --no-walk","fromName":"epilys","fromEmail":"epilys@norn.io","sentAt":"2015-03-14T21:31:59Z","receivedAt":"2015-03-14T21:31:59Z","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\ncontinuous commit history, and --no-walk shows discrete specified\ncommits without continuity. This doesn't make sense, so we forbid the\ncombined use of these flags.\n\nSigned-off-by: Manos Pitsidianakis <epilys@norn.io>\n---\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..0194133 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\n**argv, const char *prefix,\n \tmemset(&w, 0, sizeof(w));\n \tuserformat_find_requirements(NULL, &w);\n +    if (rev->graph && rev->no_walk)\n+        die(\"--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..4dd939b 100755\n--- a/t/t4202-log.sh\n+++ b/t/t4202-log.sh\n@@ -887,4 +887,8 @@ test_expect_success GPG 'log --graph\n--show-signature for merged tag' '\n \tgrep \"^| | gpg: Good signature\" actual\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-- \n2.1.4\n"},{"id":"257692","messageId":"20150314224242.GA3311@vps892.directvps.nl","threadId":"38806","inReplyTo":"5504A8CF.9080202@norn.io","subject":"Re: [PATCH] forbid log --graph --no-walk","fromName":"Kevin D","fromEmail":"me@ikke.info","sentAt":"2015-03-14T22:42:42Z","receivedAt":"2015-03-14T22:42:42Z","isPatch":true,"sender":{"key":"me@ikke.info","avatar":"https://avatars.githubusercontent.com/u/135698?v=4"},"body":"Subject is usually prefixed with the part that is changed, in this case\nlog.\n\nFor example: \n\nlog: forbid log --graph --no-walk\n\nOn Sat, Mar 14, 2015 at 11:31:59PM +0200, epilys wrote:\n> In git-log, --graph shows a graphical representation of a\n> continuous commit history, and --no-walk shows discrete specified\n> commits without continuity. This doesn't make sense, so we forbid the\n> combined use of these flags.\n> \n> Signed-off-by: Manos Pitsidianakis <epilys@norn.io>\n> ---\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..0194133 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\n> **argv, const char *prefix,\n>  \tmemset(&w, 0, sizeof(w));\n>  \tuserformat_find_requirements(NULL, &w);\n>  +    if (rev->graph && rev->no_walk)\n\nPatch got corrupted here (Space before +)\n\n> +        die(\"--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)\n> diff --git a/t/t4202-log.sh b/t/t4202-log.sh\n> index 5f2b290..4dd939b 100755\n> --- a/t/t4202-log.sh\n> +++ b/t/t4202-log.sh\n> @@ -887,4 +887,8 @@ test_expect_success GPG 'log --graph\n> --show-signature for merged tag' '\n>  \tgrep \"^| | gpg: Good signature\" actual\n>  '\n>  +test_expect_success 'forbid log --graph --no-walk' '\n\nHere also\n\n> +    test_must_fail git log --graph --no-walk\n> +'\n> +\n>  test_done\n"}]}