git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Delay pager setup in git blame
@ 2007-11-03 12:22 Mike Hommey
  2007-11-03 12:22 ` [PATCH] Allow 'git blame rev path' to work on bare repository Mike Hommey
  0 siblings, 1 reply; 7+ messages in thread
From: Mike Hommey @ 2007-11-03 12:22 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

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

Signed-off-by: Mike Hommey <mh@glandium.org>
---
 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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH] Allow 'git blame rev path' to work on bare repository
  2007-11-03 12:22 [PATCH] Delay pager setup in git blame Mike Hommey
@ 2007-11-03 12:22 ` Mike Hommey
  2007-11-03 12:22   ` [PATCH] Make git-blame fail when working tree is needed and we're not in one Mike Hommey
  2007-11-04  5:21   ` [PATCH] Allow 'git blame rev path' to work on bare repository Junio C Hamano
  0 siblings, 2 replies; 7+ messages in thread
From: Mike Hommey @ 2007-11-03 12:22 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

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

Signed-off-by: Mike Hommey <mh@glandium.org>
---
 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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH] Make git-blame fail when working tree is needed and we're not in one
  2007-11-03 12:22 ` [PATCH] Allow 'git blame rev path' to work on bare repository Mike Hommey
@ 2007-11-03 12:22   ` Mike Hommey
  2007-11-03 12:30     ` Mike Hommey
  2007-11-04  5:21   ` [PATCH] Allow 'git blame rev path' to work on bare repository Junio C Hamano
  1 sibling, 1 reply; 7+ messages in thread
From: Mike Hommey @ 2007-11-03 12:22 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano


Signed-off-by: Mike Hommey <mh@glandium.org>
---
 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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] Make git-blame fail when working tree is needed and we're not in one
  2007-11-03 12:22   ` [PATCH] Make git-blame fail when working tree is needed and we're not in one Mike Hommey
@ 2007-11-03 12:30     ` Mike Hommey
  2007-11-03 15:01       ` Andreas Ericsson
  0 siblings, 1 reply; 7+ messages in thread
From: Mike Hommey @ 2007-11-03 12:30 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

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

Mike

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Make git-blame fail when working tree is needed and we're not in one
  2007-11-03 12:30     ` Mike Hommey
@ 2007-11-03 15:01       ` Andreas Ericsson
  0 siblings, 0 replies; 7+ messages in thread
From: Andreas Ericsson @ 2007-11-03 15:01 UTC (permalink / raw)
  To: Mike Hommey; +Cc: git, Junio C Hamano

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Allow 'git blame rev path' to work on bare repository
  2007-11-03 12:22 ` [PATCH] Allow 'git blame rev path' to work on bare repository Mike Hommey
  2007-11-03 12:22   ` [PATCH] Make git-blame fail when working tree is needed and we're not in one Mike Hommey
@ 2007-11-04  5:21   ` Junio C Hamano
  2007-11-04  8:26     ` Mike Hommey
  1 sibling, 1 reply; 7+ messages in thread
From: Junio C Hamano @ 2007-11-04  5:21 UTC (permalink / raw)
  To: Mike Hommey; +Cc: git

Mike Hommey <mh@glandium.org> writes:

> While 'git blame rev -- path' works, 'git blame rev path' didn't.
>
> Signed-off-by: Mike Hommey <mh@glandium.org>
> ---
>  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));
>  		}
>  	}
>  

Sorry but a NAK; at least limit the removal of the test only to a bare
repository case.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Allow 'git blame rev path' to work on bare repository
  2007-11-04  5:21   ` [PATCH] Allow 'git blame rev path' to work on bare repository Junio C Hamano
@ 2007-11-04  8:26     ` Mike Hommey
  0 siblings, 0 replies; 7+ messages in thread
From: Mike Hommey @ 2007-11-04  8:26 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On Sat, Nov 03, 2007 at 10:21:53PM -0700, Junio C Hamano wrote:
> Mike Hommey <mh@glandium.org> writes:
> 
> > While 'git blame rev -- path' works, 'git blame rev path' didn't.
> >
> > Signed-off-by: Mike Hommey <mh@glandium.org>
> > ---
> >  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));
> >  		}
> >  	}
> >  
> 
> Sorry but a NAK; at least limit the removal of the test only to a bare
> repository case.

I fail to see why this test is necessary here. The lack of file in the
working tree is caught in fake_working_tree_commit() anyways.

Mike

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-11-04  8:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-03 12:22 [PATCH] Delay pager setup in git blame Mike Hommey
2007-11-03 12:22 ` [PATCH] Allow 'git blame rev path' to work on bare repository Mike Hommey
2007-11-03 12:22   ` [PATCH] Make git-blame fail when working tree is needed and we're not in one Mike Hommey
2007-11-03 12:30     ` Mike Hommey
2007-11-03 15:01       ` Andreas Ericsson
2007-11-04  5:21   ` [PATCH] Allow 'git blame rev path' to work on bare repository Junio C Hamano
2007-11-04  8:26     ` Mike Hommey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).