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

Re: [PATCH] Improve parent blame to detect renames by using the previous information

From
Jonas Fonseca <fonseca@diku.dk>
Date
Jun 9, 2010, 16:10 UTC
Message-ID
<AANLkTimGXAXg7fi3zKD3f-pIht0q0qYPp_6ivlt8LgDF@mail.gmail.com>
In-Reply-To
<20100606223545.GA11424@coredump.intra.peff.net>
On Sun, Jun 6, 2010 at 18:35, Jeff King <peff@peff.net> wrote:
Show 22 quoted lines
>
> On Sat, Jun 05, 2010 at 03:56:05PM -0400, Jonas Fonseca wrote:
>
> One minor bug:
>
> > @@ -5204,10 +5148,13 @@ blame_request(struct view *view, enum request request, struct line *line)
> >               break;
> >
> >       case REQ_PARENT:
> > -             if (check_blame_commit(blame, TRUE) &&
> > -                 select_commit_parent(blame->commit->id, opt_ref,
> > -                                      blame->commit->filename)) {
> > -                     string_copy(opt_file, blame->commit->filename);
> > +             if (!check_blame_commit(blame, TRUE))
> > +                     break;
> > +             if (!*blame->commit->parent_id) {
> > +                     report("The selected commit has no parents");
> > +             } else {
> > +                     string_copy_rev(opt_ref, blame->commit->parent_id);
> > +                     string_copy_rev(opt_file, blame->commit->parent_filename);
>
> This second string_copy_rev should be a string_ncopy, shouldn't it?

Oh, yes, a regular copy and paste bug. Thanks for noticing. I will include this and consider tagging another release.

-- Jonas Fonseca

Previous: Jeff KingNext: Jonas Fonseca
Message 8 of 9 in “fix off-by-one on parent selection”
  1. fix off-by-one on parent selectionJeff King, May 10, 2010
  2. Jonas FonsecaMay 22, 2010
  3. Jeff KingMay 23, 2010
  4. Jeff KingMay 23, 2010
  5. Improve parent blame to detect renames by using the previous informationJonas Fonseca, Jun 5, 2010
  6. Jonas FonsecaJun 5, 2010
  7. Jeff KingJun 6, 2010
  8. Jonas FonsecaJun 9, 2010
  9. Jonas FonsecaJun 10, 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.