git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Mike Hommey <mh@glandium.org>
Date
Nov 4, 2007, 08:26 UTC
Message-ID
<20071104082623.GA3514@glandium.org>
In-Reply-To
<7vabpuvb4e.fsf@gitster.siamese.dyndns.org>
On Sat, Nov 03, 2007 at 10:21:53PM -0700, Junio C Hamano wrote:
Show 27 quoted lines
> 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
Previous: Junio C Hamano
Message 7 of 7 in “Delay pager setup in git blame”
  1. Delay pager setup in git blameMike Hommey, Nov 3, 2007
  2. Allow 'git blame rev path' to work on bare repositoryMike Hommey, Nov 3, 2007
  3. Make git-blame fail when working tree is needed and we're not in oneMike Hommey, Nov 3, 2007
  4. Mike HommeyNov 3, 2007
  5. Andreas EricssonNov 3, 2007
  6. Junio C HamanoNov 4, 2007
  7. Mike HommeyNov 4, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.