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

Re: [PATCH v3 1/4] replace: add --graft option

From
Jeff King <peff@peff.net>
Date
Jun 8, 2014, 12:09 UTC
Message-ID
<20140608120936.GB21827@sigill.intra.peff.net>
In-Reply-To
<20140608120439.GA21827@sigill.intra.peff.net>
On Sun, Jun 08, 2014 at 08:04:39AM -0400, Jeff King wrote:
Show 10 quoted lines
> diff --git a/builtin/blame.c b/builtin/blame.c
> index a52a279..1945ea4 100644
> --- a/builtin/blame.c
> +++ b/builtin/blame.c
> @@ -2313,7 +2313,7 @@ static struct commit *fake_working_tree_commit(struct diff_options *opt,
>  		    ident, ident, path,
>  		    (!contents_from ? path :
>  		     (!strcmp(contents_from, "-") ? "standard input" : contents_from)));
> -	commit->buffer = strbuf_detach(&msg, NULL);
> +	set_commit_buffer(commit, strbuf_detach(&msg, NULL), msg.len);

Side note: this is wrong, as the fake commit created by blame here does not have its "index" field set. This is a bug waiting to happen the first time somebody uses a slab in builtin/blame.c. It looks like merge-recursive does the same thing in make_virtual_commit.

We probably want to provide a function to allocate a commit, including the index, and use it consistently.

I'll try to work up a series doing that, and the fuller slab API I mentioned in the previous message, but probably not until tomorrow.

-Peff
Previous: Jeff KingNext: Junio C Hamano
Message 9 of 19 in “Add --graft option to git replace”
  1. 0/4 Add --graft option to git replaceChristian Couder, Jun 4, 2014
  2. 1/4 replace: add --graft optionChristian Couder, Jun 4, 2014
  3. Junio C HamanoJun 5, 2014
  4. Christian CouderJun 6, 2014
  5. Christian CouderJun 6, 2014
  6. Christian CouderJun 8, 2014
  7. Jeff KingJun 8, 2014
  8. Jeff KingJun 8, 2014
  9. Jeff KingJun 8, 2014
  10. Junio C HamanoJun 9, 2014
  11. Junio C HamanoJun 6, 2014
  12. 2/4 replace: add test for --graftChristian Couder, Jun 4, 2014
  13. 3/4 Documentation: replace: add --graft optionChristian Couder, Jun 4, 2014
  14. 4/4 contrib: add convert-grafts-to-replace-refs.shChristian Couder, Jun 4, 2014
  15. Junio C HamanoJun 5, 2014
  16. Christian CouderJun 6, 2014
  17. Christian CouderJun 29, 2014
  18. Junio C HamanoJun 30, 2014
  19. Christian CouderJun 30, 2014

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.