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

Re: [RFC/PATCH] patch-ids: check modified paths before calculating diff

From
Jonathan Nieder <jrnieder@gmail.com>
Date
May 20, 2013, 06:36 UTC
Message-ID
<20130520063623.GB2919@elie.Belkin>
In-Reply-To
<20130519220206.GK27005@serenity.lan>
John Keeping wrote:
> On Sun, May 19, 2013 at 12:36:12PM -0700, Jonathan Nieder wrote:
Show 9 quoted lines
>>                                        Who is responsible for freeing
>> "path"?  Would it make sense to use a strbuf here?
>>
>> 	strbuf_setlen(&buf, traverse_path_len(info, n));
>> 	make_traverse_path(&buf.buf, info, n);
>
> Perhaps alloc_traverse_path?  I'm not sure the strbuf buys us much for
> this case, since we only use the result for a few lines before freeing
> it.

Good idea. Generally strbufs are nice for this kind of thing because they make it easy to reuse buffers, but in this case there's no opportunity for that.

[...]
> then this is "process_changed_path".
Sounds good.
[...]
Show 6 quoted lines
>> What should happen for commits with more than 1 parent?  If they're
>> supposed to not enter this codepath because of a previous check, a
>> die("BUG: ...") could be a good way to make reading easier.
>
> Currently the patch ID code compares the commit with its first parent,
> so I think this should do the same.

Ok. I guess a comment nearby would help future readers avoid the same question.

I don't know what it should mean to try to use --cherry without --no-merges or --first-parent, so I guess this is harmless.

[...]
> Thanks for the review.
No problem.  Thanks for a pleasant read.

Ciao, Jonathan

Previous: John KeepingNext: John Keeping
Message 4 of 13 in “patch-ids: check modified paths before calculating diff”
  1. patch-ids: check modified paths before calculating diffJohn Keeping, May 19, 2013
  2. Jonathan NiederMay 19, 2013
  3. John KeepingMay 19, 2013
  4. Jonathan NiederMay 20, 2013
  5. John KeepingMay 20, 2013
  6. Junio C HamanoMay 20, 2013
  7. Jeff KingMay 29, 2013
  8. Jeff KingMay 29, 2013
  9. Jeff KingMay 29, 2013
  10. Junio C HamanoMay 29, 2013
  11. Jeff KingMay 29, 2013
  12. Junio C HamanoMay 29, 2013
  13. John KeepingMay 29, 2013

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.