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

Re: new stacked git feature

From
CMCatalin Marinas <catalin.marinas@gmail.com>
Date
Feb 22, 2008, 13:54 UTC
Message-ID
<b0943d9e0802220554x4c0a6c98q39e8b253bb108f1e@mail.gmail.com>
In-Reply-To
<20080221074543.GB8250@diana.vm.bytemark.co.uk>
On 21/02/2008, Karl Hasselström <kha@treskal.com> wrote:
Show 17 quoted lines
> On 2008-02-20 23:06:07 +0000, Catalin Marinas wrote:
>  > There is also a situation when patches on the remote stack were
>  > reordered and with some conflicts fixed. In this case, merging gets
>  > even more complicated (I think darcs solves this by making all the
>  > patches immutable but the base feature of StGIT is that patches are
>  > easily modifiable).
>
>
> The scheme I described should be able to handle this. When a patch is
>  pushed, its base is set, and we can just make a normal 3-way merge.
>
>  Consider a stack with two patches, a:A->B and b:B->C (A, B, and C are
>  commits). In one branch, this is modified to a:A->B1 and b:B1->C1; and
>  in the other, the patch order is changed so we get b:A->X and a:X->C.
>
>  When we merge these, the base is unchanged (so still A), and the patch
>  order is b, a (since it was changed in one branch but not the other).

"stg sync" does pretty much the same now but in a more manual way. I don't really like the way the conflicts are presented - i.e. you don't know which patch was modified afterwards because the patches lose this information (they are not topic branches).

>   1. First we push b. The A->X variant applies trivially, but the
>      B1->C1 variant needs the standard 3-way merge.

3-way merge with X and B1 as base? This leads to the current "sync" issue, you can't tell which patch was original and which was modified.

Just a thought (not that I'd like this feature in StGIT). Someone tried a project some time ago, similar to StGIT, but using topic branches rather than individual commits per patch. The GIT history looked very ugly, especially after re-ordering, but the advantage was that you can avoid rebasing patches and simply merging changes from bottom patches into top ones. This would make synchronisation of patches between branches much easier.

-- 
Catalin
Previous: Karl HasselströmNext: Karl Hasselström
Message 7 of 8 in “Re: new stacked git feature”
  1. Catalin MarinasFeb 12, 2008
  2. Karl HasselströmFeb 13, 2008
  3. Catalin MarinasFeb 13, 2008
  4. Karl HasselströmFeb 13, 2008
  5. Catalin MarinasFeb 20, 2008
  6. Karl HasselströmFeb 21, 2008
  7. Catalin MarinasFeb 22, 2008
  8. Karl HasselströmFeb 22, 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.