{"thread":{"id":"10617","subject":"[PATCH] Make git-blame fail when working tree is needed and we're not in one","startedAt":"2007-11-03T12:22:53Z","lastAt":"2007-11-04T08:26:23Z","messageCount":7,"participants":["Mike Hommey","Andreas Ericsson","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"58116","messageId":"1194092575-7133-1-git-send-email-mh@glandium.org","threadId":"10617","inReplyTo":null,"subject":"[PATCH] Delay pager setup in git blame","fromName":"Mike Hommey","fromEmail":"mh@glandium.org","sentAt":"2007-11-03T12:22:53Z","receivedAt":"2007-11-03T12:22:53Z","isPatch":true,"sender":{"key":"mh@glandium.org","avatar":"https://avatars.githubusercontent.com/u/1038527?v=4"},"body":"This avoids to launch the pager when git blame fails for any reason.\n\nSigned-off-by: Mike Hommey <mh@glandium.org>\n---\n builtin-blame.c |    6 +++---\n 1 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin-blame.c b/builtin-blame.c\nindex 8432b82..aedc294 100644\n--- a/builtin-blame.c\n+++ b/builtin-blame.c\n@@ -2215,9 +2215,6 @@ int cmd_blame(int argc, const char **argv, const char *prefix)\n \t\t\targv[unk++] = arg;\n \t}\n \n-\tif (!incremental)\n-\t\tsetup_pager();\n-\n \tif (!blame_move_score)\n \t\tblame_move_score = BLAME_DEFAULT_MOVE_SCORE;\n \tif (!blame_copy_score)\n@@ -2411,6 +2408,9 @@ int cmd_blame(int argc, const char **argv, const char *prefix)\n \n \tread_mailmap(&mailmap, \".mailmap\", NULL);\n \n+\tif (!incremental)\n+\t\tsetup_pager();\n+\n \tassign_blame(&sb, &revs, opt);\n \n \tif (incremental)\n-- \n1.5.3.5\n"},{"id":"58117","messageId":"1194092575-7133-2-git-send-email-mh@glandium.org","threadId":"10617","inReplyTo":"1194092575-7133-1-git-send-email-mh@glandium.org","subject":"[PATCH] Allow 'git blame rev path' to work on bare repository","fromName":"Mike Hommey","fromEmail":"mh@glandium.org","sentAt":"2007-11-03T12:22:54Z","receivedAt":"2007-11-03T12:22:54Z","isPatch":true,"sender":{"key":"mh@glandium.org","avatar":"https://avatars.githubusercontent.com/u/1038527?v=4"},"body":"While 'git blame rev -- path' works, 'git blame rev path' didn't.\n\nSigned-off-by: Mike Hommey <mh@glandium.org>\n---\n builtin-blame.c |    4 ----\n 1 files changed, 0 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin-blame.c b/builtin-blame.c\nindex aedc294..141287e 100644\n--- a/builtin-blame.c\n+++ b/builtin-blame.c\n@@ -2294,10 +2294,6 @@ int cmd_blame(int argc, const char **argv, const char *prefix)\n \t\t\t}\n \t\t\telse if (i != argc - 1)\n \t\t\t\tusage(blame_usage); /* garbage at end */\n-\n-\t\t\tif (!has_path_in_work_tree(path))\n-\t\t\t\tdie(\"cannot stat path %s: %s\",\n-\t\t\t\t    path, strerror(errno));\n \t\t}\n \t}\n \n-- \n1.5.3.5\n"},{"id":"58115","messageId":"1194092575-7133-3-git-send-email-mh@glandium.org","threadId":"10617","inReplyTo":"1194092575-7133-2-git-send-email-mh@glandium.org","subject":"[PATCH] Make git-blame fail when working tree is needed and we're not in one","fromName":"Mike Hommey","fromEmail":"mh@glandium.org","sentAt":"2007-11-03T12:22:55Z","receivedAt":"2007-11-03T12:22:55Z","isPatch":true,"sender":{"key":"mh@glandium.org","avatar":"https://avatars.githubusercontent.com/u/1038527?v=4"},"body":"\nSigned-off-by: Mike Hommey <mh@glandium.org>\n---\n builtin-blame.c |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/builtin-blame.c b/builtin-blame.c\nindex 141287e..500ae77 100644\n--- a/builtin-blame.c\n+++ b/builtin-blame.c\n@@ -2338,6 +2338,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)\n \t\t * do not default to HEAD, but use the working tree\n \t\t * or \"--contents\".\n \t\t */\n+\t\tsetup_work_tree();\n \t\tsb.final = fake_working_tree_commit(path, contents_from);\n \t\tadd_pending_object(&revs, &(sb.final->object), \":\");\n \t}\n-- \n1.5.3.5\n"},{"id":"58121","messageId":"20071103123031.GA7425@glandium.org","threadId":"10617","inReplyTo":"1194092575-7133-3-git-send-email-mh@glandium.org","subject":"Re: [PATCH] Make git-blame fail when working tree is needed and we're not in one","fromName":"Mike Hommey","fromEmail":"mh@glandium.org","sentAt":"2007-11-03T12:30:31Z","receivedAt":"2007-11-03T12:30:31Z","isPatch":true,"sender":{"key":"mh@glandium.org","avatar":"https://avatars.githubusercontent.com/u/1038527?v=4"},"body":"Oops, I forgot -n to format-patch. Wasn't there a proposal to have -n\nautomatically set when outputing several patches ?\n\nMike\n"},{"id":"58143","messageId":"472C8D60.4070809@op5.se","threadId":"10617","inReplyTo":"20071103123031.GA7425@glandium.org","subject":"Re: [PATCH] Make git-blame fail when working tree is needed and we're not in one","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2007-11-03T15:01:52Z","receivedAt":"2007-11-03T15:01:52Z","isPatch":true,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Mike Hommey wrote:\n> Oops, I forgot -n to format-patch. Wasn't there a proposal to have -n\n> automatically set when outputing several patches ?\n> \n\nNo. There was a patch to skip numbering when only one patch was created.\nI suppose a different implementation of that patch could make the default\nto number when multiple patches are created but not when a single one is.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"58213","messageId":"7vabpuvb4e.fsf@gitster.siamese.dyndns.org","threadId":"10617","inReplyTo":"1194092575-7133-2-git-send-email-mh@glandium.org","subject":"Re: [PATCH] Allow 'git blame rev path' to work on bare repository","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-11-04T05:21:53Z","receivedAt":"2007-11-04T05:21:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Mike Hommey <mh@glandium.org> writes:\n\n> While 'git blame rev -- path' works, 'git blame rev path' didn't.\n>\n> Signed-off-by: Mike Hommey <mh@glandium.org>\n> ---\n>  builtin-blame.c |    4 ----\n>  1 files changed, 0 insertions(+), 4 deletions(-)\n>\n> diff --git a/builtin-blame.c b/builtin-blame.c\n> index aedc294..141287e 100644\n> --- a/builtin-blame.c\n> +++ b/builtin-blame.c\n> @@ -2294,10 +2294,6 @@ int cmd_blame(int argc, const char **argv, const char *prefix)\n>  \t\t\t}\n>  \t\t\telse if (i != argc - 1)\n>  \t\t\t\tusage(blame_usage); /* garbage at end */\n> -\n> -\t\t\tif (!has_path_in_work_tree(path))\n> -\t\t\t\tdie(\"cannot stat path %s: %s\",\n> -\t\t\t\t    path, strerror(errno));\n>  \t\t}\n>  \t}\n>  \n\nSorry but a NAK; at least limit the removal of the test only to a bare\nrepository case.\n"},{"id":"58226","messageId":"20071104082623.GA3514@glandium.org","threadId":"10617","inReplyTo":"7vabpuvb4e.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Allow 'git blame rev path' to work on bare repository","fromName":"Mike Hommey","fromEmail":"mh@glandium.org","sentAt":"2007-11-04T08:26:23Z","receivedAt":"2007-11-04T08:26:23Z","isPatch":true,"sender":{"key":"mh@glandium.org","avatar":"https://avatars.githubusercontent.com/u/1038527?v=4"},"body":"On Sat, Nov 03, 2007 at 10:21:53PM -0700, Junio C Hamano wrote:\n> Mike Hommey <mh@glandium.org> writes:\n> \n> > While 'git blame rev -- path' works, 'git blame rev path' didn't.\n> >\n> > Signed-off-by: Mike Hommey <mh@glandium.org>\n> > ---\n> >  builtin-blame.c |    4 ----\n> >  1 files changed, 0 insertions(+), 4 deletions(-)\n> >\n> > diff --git a/builtin-blame.c b/builtin-blame.c\n> > index aedc294..141287e 100644\n> > --- a/builtin-blame.c\n> > +++ b/builtin-blame.c\n> > @@ -2294,10 +2294,6 @@ int cmd_blame(int argc, const char **argv, const char *prefix)\n> >  \t\t\t}\n> >  \t\t\telse if (i != argc - 1)\n> >  \t\t\t\tusage(blame_usage); /* garbage at end */\n> > -\n> > -\t\t\tif (!has_path_in_work_tree(path))\n> > -\t\t\t\tdie(\"cannot stat path %s: %s\",\n> > -\t\t\t\t    path, strerror(errno));\n> >  \t\t}\n> >  \t}\n> >  \n> \n> Sorry but a NAK; at least limit the removal of the test only to a bare\n> repository case.\n\nI fail to see why this test is necessary here. The lack of file in the\nworking tree is caught in fake_working_tree_commit() anyways.\n\nMike\n"}]}