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
John Keeping <john@keeping.me.uk>
Date
May 29, 2013, 21:30 UTC
Message-ID
<20130529213037.GC17475@serenity.lan>
In-Reply-To
<7vy5axsju2.fsf@alter.siamese.dyndns.org>
On Wed, May 29, 2013 at 11:48:53AM -0700, Junio C Hamano wrote:
Show 25 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> > On Wed, May 29, 2013 at 11:08:46AM -0700, Junio C Hamano wrote:
> >
> >> This has rather interesting ramifications on cherry-pick and rebase,
> >> though.  Both command can handle changes that come from an old tree
> >> before some paths were renamed, but strict patch-id would not spot
> >> equivalent changes we already have in our history if our change
> >> happened after a rename, i.e.
> >> 
> >>    Z
> >>   /
> >>  O---R---X---Y
> >> 
> >> where Z updates path F, R moves F to G and X changes G the same way
> >> as Z changes F, and we are trying to cherry-pick Z on top of Y.  The
> >> cherry-pick filter will see different patch-id for Z and X.
> >
> > True. That is a problem with the current patch-id system, no?
> 
> Correct.  That is why I suggested not to change the external
> interface (i.e. what is shown from patch-id command) as people may
> have kept them, but wondered if a possible improvement may be to
> exclude the name from ids when we internally generate two sets of
> Ids and intersect them, i.e. log --cherry.

Would that not rely on the files still being in the same order? Since we essentially hash the content of the patch, it will presumably be quite different if the order of the files in the patch changes.

I expect it's possible to work around that by being a bit more clever though. Perhaps hash each file individually and then sort those and hash the concatenated result?

Previous: Junio C Hamano
Message 13 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.