[PATCH] Delay pager setup in git blame

Subsystems: the rest

DORMANTno replies

5 messages, 2 authors, 2016-06-15 · open the first message on its own page

[PATCH] Delay pager setup in git blame

From: Mike Hommey <hidden>
Date: 2016-06-15 22:43:46

This avoids to launch the pager when git blame fails for any reason.

Signed-off-by: Mike Hommey <redacted>
---
 builtin-blame.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/builtin-blame.c b/builtin-blame.c
index 8432b82..aedc294 100644
--- a/builtin-blame.c
+++ b/builtin-blame.c
@@ -2215,9 +2215,6 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
 			argv[unk++] = arg;
 	}
 
-	if (!incremental)
-		setup_pager();
-
 	if (!blame_move_score)
 		blame_move_score = BLAME_DEFAULT_MOVE_SCORE;
 	if (!blame_copy_score)
@@ -2411,6 +2408,9 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
 
 	read_mailmap(&mailmap, ".mailmap", NULL);
 
+	if (!incremental)
+		setup_pager();
+
 	assign_blame(&sb, &revs, opt);
 
 	if (incremental)
-- 
1.5.3.5

[PATCH] Make git-blame fail when working tree is needed and we're not in one

From: Mike Hommey <hidden>
Date: 2016-06-15 22:43:46

Signed-off-by: Mike Hommey <redacted>
---
 builtin-blame.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/builtin-blame.c b/builtin-blame.c
index 141287e..500ae77 100644
--- a/builtin-blame.c
+++ b/builtin-blame.c
@@ -2338,6 +2338,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
 		 * do not default to HEAD, but use the working tree
 		 * or "--contents".
 		 */
+		setup_work_tree();
 		sb.final = fake_working_tree_commit(path, contents_from);
 		add_pending_object(&revs, &(sb.final->object), ":");
 	}
-- 
1.5.3.5

[PATCH] Allow 'git blame rev path' to work on bare repository

From: Mike Hommey <hidden>
Date: 2016-06-15 22:43:46

While 'git blame rev -- path' works, 'git blame rev path' didn't.

Signed-off-by: Mike Hommey <redacted>
---
 builtin-blame.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/builtin-blame.c b/builtin-blame.c
index aedc294..141287e 100644
--- a/builtin-blame.c
+++ b/builtin-blame.c
@@ -2294,10 +2294,6 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
 			}
 			else if (i != argc - 1)
 				usage(blame_usage); /* garbage at end */
-
-			if (!has_path_in_work_tree(path))
-				die("cannot stat path %s: %s",
-				    path, strerror(errno));
 		}
 	}
 
-- 
1.5.3.5

Re: [PATCH] Make git-blame fail when working tree is needed and we're not in one

From: Mike Hommey <hidden>
Date: 2016-06-15 22:43:46

Oops, I forgot -n to format-patch. Wasn't there a proposal to have -n
automatically set when outputing several patches ?

Mike

Re: [PATCH] Make git-blame fail when working tree is needed and we're not in one

From: Andreas Ericsson <hidden>
Date: 2016-06-15 22:43:46

Mike Hommey wrote:
Oops, I forgot -n to format-patch. Wasn't there a proposal to have -n
automatically set when outputing several patches ?
No. There was a patch to skip numbering when only one patch was created.
I suppose a different implementation of that patch could make the default
to number when multiple patches are created but not when a single one is.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help