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

Re: [RFC/PATCH 2/2] blame: fix output in case of replacement by using parse_commit_repl()

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Aug 17, 2010, 03:44 UTC
Message-ID
<AANLkTimMXmi1ZhVYXtbMz3doOUZMzbRggqcUY0L7wKyY@mail.gmail.com>
In-Reply-To
<20100817015901.5592.419.chriscool@tuxfamily.org>

On Tue, Aug 17, 2010 at 11:59 AM, Christian Couder <chriscool@tuxfamily.org> wrote:

Show 20 quoted lines
> git blame was not showing the sha1 of the replacement commit while
> it was properly showing other information from the replacement commit,
> because parse_commit() is buggy regarding replacement.
>
> Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
> ---
>  builtin/blame.c    |    4 ++--
>  t/t6050-replace.sh |    8 ++++++++
>  2 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/builtin/blame.c b/builtin/blame.c
> index 8f9e7b0..c469e09 100644
> --- a/builtin/blame.c
> +++ b/builtin/blame.c
> @@ -1226,7 +1226,7 @@ static void pass_blame(struct scoreboard *sb, struct origin *origin, int opt)
>
>                        if (sg_origin[i])
>                                continue;
> -                       if (parse_commit(p))
> +                       if (parse_commit_repl(&p))

This is the hard way. There are another ~40 parse_commit() calls elsewhere. Most of them are in git commands, so we can check one by one. There are some calls in revision.c, sha1_name.c, tree.c, upload-pack.c and walker.c, which may be used in many places. Checking them would be harder.

-- 
Duy
Previous: Christian CouderNext: Christian Couder
Message 2 of 3 in “blame: fix output in case of replacement by using parse_commit_repl()”
  1. 2/2 blame: fix output in case of replacement by using parse_commit_repl()Christian Couder, Aug 17, 2010
  2. Nguyen Thai Ngoc DuyAug 17, 2010
  3. Christian CouderAug 17, 2010

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.