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

TopGit: problem with patch series generation

From
MKmartin f krafft <madduck@debian.org>
Date
Aug 12, 2008, 16:18 UTC
Message-ID
<20080812161854.GB30067@lapse.rw.madduck.net>
Hi folks,

I am playing around with TopGit and encountered a (conceptual) problem. I'd love to hear some input.

I want to use TopGit for distro packaging. Any of my packages have one or more feature branches, some intended for upstream, some distro-specific. As I am packaging TopGit for Debian, I encountered the situation that two branches conflict with each other (they change the same line), but there is no dependency between the branches. Thus, when I squash the branches into a series, the resulting patches will not apply (they both change the same original line to something else).

Obviously, I can introduce a "fake" dependency to force TopGit to create one patch based on another. However, this then prevents me from testing and developing the depending branch in isolation, meaning that I always have to have the dependent branch applied when I want to work on the second feature. Furthermore, it's not trivially possible in this situation to cherry-pick only the second patch.

I see that this is a hard problem with no obvious solution. The only thing that comes to my mind is maintaining multiple patches for each branch. In the above, if B "fake-depends" on A, which depends on master, then I would have A and B depend on master only, but have TopGit also manage B2 for me, which is a diff against A.

Doing this for all branches is polynomial, but then again, the number of independent branches, or rather branch trees, is likely to be pretty low in most cases.

As an alternative, it may be possible, however, to let TopGit know about a "fake dependency" from B on A. When serialised, TopGit would notice that there are multiple paths from master to B (master->B and master->A->B) and use the longer one.

Do you see any other ways in which the situation could be handled?
Is the above something that TopGit could learn, Petr?
Cheers,
-- 
 .''`.   martin f. krafft <madduck@debian.org>
: :'  :  proud Debian developer, author, administrator, and user
`. `'`   http://people.debian.org/~madduck - http://debiansystem.info
  `-  Debian - when you have better things to do than fixing systems
 
"with sufficient thrust, pigs fly just fine. however, this is not
 necessarily a good idea. it is hard to be sure where they are going
 to land, and it could be dangerous sitting under them as they fly
 overhead."
                                                           -- rfc 1925
Next: Avery Pennarun
Message 1 of 11 in “TopGit: problem with patch series generation”
  1. martin f krafftAug 12, 2008
  2. Avery PennarunAug 12, 2008
  3. Bert WesargAug 12, 2008
  4. Petr BaudisAug 12, 2008
  5. martin f krafftAug 12, 2008
  6. Santi BéjarAug 12, 2008
  7. martin f krafftAug 12, 2008
  8. Petr BaudisAug 12, 2008
  9. martin f krafftAug 12, 2008
  10. martin f krafftAug 12, 2008
  11. Petr BaudisAug 13, 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.