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

Re: git-blame: handling of revisions and filenames

From
Junio C Hamano <junkio@cox.net>
Date
Nov 29, 2006, 18:29 UTC
Message-ID
<7v8xhuqf7w.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20061115215225.GA4595@steel.home>
fork0@t-online.de (Alex Riesen) writes:
> And I afraid the patch has a small chance of crashing: I don't check
> if there is enough space in argv (don't actually even know how to),

Actually this is a safe thing to do because we already know (and removed) the "path" argument from the command line at that point. If the original command line did not have "path" we have already rejected it. So unk at that point never exceeds argc.

Show 12 quoted lines
> diff --git a/builtin-blame.c b/builtin-blame.c
> index 066dee7..83c8905 100644
> --- a/builtin-blame.c
> +++ b/builtin-blame.c
> @@ -1787,6 +1787,7 @@ int cmd_blame(int argc, const char **arg
>         /* Now we got rev and path.  We do not want the path pruning
>          * but we may want "bottom" processing.
>          */
> +       argv[unk++] = "--";
>         argv[unk] = NULL;
>  
>         init_revisions(&revs, NULL);
Thanks.
Previous: Alex Riesen
Message 2 of 2 in “git-blame: handling of revisions and filenames”
  1. Alex RiesenNov 15, 2006
  2. Junio C HamanoNov 29, 2006

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.