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

Re: [PATCH] git-apply doesn't handle same name patches well

From
DZDon Zickus <dzickus@redhat.com>
Date
Jun 13, 2008, 20:42 UTC
Message-ID
<20080613204219.GE7703@redhat.com>
In-Reply-To
<alpine.DEB.1.00.0806132131180.6439@racer>
On Fri, Jun 13, 2008 at 09:32:52PM +0100, Johannes Schindelin wrote:
Show 33 quoted lines
> Hi,
> 
> On Fri, 13 Jun 2008, Don Zickus wrote:
> 
> > When working with a lot of people who backport patches all day long, 
> > every once in a while I get a patch that modifies the same file more 
> > than once inside the same patch.  git-apply either fails if the second 
> > change relies on the first change or silently drops the first change if 
> > the second change is independent.
> > 
> > The silent part is the scary scenario for us.  Also this behaviour is 
> > different from the patch-utils.
> > 
> > I have modified git-apply to cache the filenames of files it modifies 
> > such that if a later patch chunk modifies a file in the cache it will 
> > buffer the previously changed file instead of reading the original file 
> > from disk.
> > 
> > Logic has been put in to handle creations/deletions/renames/copies.  All the
> > relevant tests of git-apply succeed.
> > 
> > A new test has been added to cover the two cases I addressed.
> > 
> > The fix is relatively straight-forward.  But I'm not sure if this new
> > behaviour is something the git community wants.
> 
> The scary part is about adding a linked list for file names you want to 
> look up.
> 
> Not that performance matters here, I guess, but we _already_ have 
> something much more efficient in Git, namely path-lists.
> 
> You could use that, and end up with a substantially smaller patch.

Thanks for the feedback. I was unaware of path-lists. I'll try to find an example and implement it if it works.

Cheers, Don

Previous: Johannes SchindelinNext: Miklos Vajna
Message 3 of 15 in “git-apply doesn't handle same name patches well”
  1. git-apply doesn't handle same name patches wellDon Zickus, Jun 13, 2008
  2. Johannes SchindelinJun 13, 2008
  3. Don ZickusJun 13, 2008
  4. path-list documentation: document all functions and data structuresMiklos Vajna, Jun 13, 2008
  5. Olivier MarinJun 13, 2008
  6. path-list documentation: document all functions and data structuresMiklos Vajna, Jun 14, 2008
  7. path-list documentation: document all functions and data structuresMiklos Vajna, Jun 14, 2008
  8. Olivier MarinJun 14, 2008
  9. Miklos VajnaJun 14, 2008
  10. Johannes SchindelinJun 14, 2008
  11. path-list documentation: document all functions and data structuresMiklos Vajna, Jun 14, 2008
  12. Jakub NarebskiJun 15, 2008
  13. path-list documentation: document all functions and data structuresMiklos Vajna, Jun 15, 2008
  14. Junio C HamanoJun 15, 2008
  15. Mike RalphsonJun 16, 2008

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.