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

[RFC] subtree: handle unmerged history trees

From
Claus Schneider <claus.schneider@eficode.com>
Date
May 6, 2020, 14:00 UTC
Message-ID
<CA+GP4bou+_bvGjnd3Z+fctXX4V2sE=Ta9ivCnYmbn1+JUxKRQg@mail.gmail.com>
In-Reply-To
<CA+GP4bqEjK2V7fGqXsJMkRURod8zVzZAQQ7woUUtqybxfnmSVg@mail.gmail.com>
Hi..
I would like to enhance git subtree functionality

Problem outline: In a scenario where a team develops a software subsystem and part of the code is internal and parts (source and/or interfaces) should be delivered continuously for others to incorporate into their system/product.

One solution is to use submodules structure for both the development team and product which is a hassle for the development team. They need to make logical commits across submodule and parent repository which can be a problem with parallel development and verification.

Subtree has the feature of splitting the repository in order to
achieve this, but there are some constraints that I would fix.
- In bare mode it pushes changes to a separate branch containing the
prefix changes which is fine. You get a problem when you run the next
split. Either you re-split all the commits again - Or you add the
-rejoin parameter with the result that the splitted prefix patches are
part of your history twice or even more if you have further extracts.
So this is either a performance issue or a usability issue.
- You lose traceability from the extracted subtree commit back to you
original commits,
Solution outline using subtree:
- Add traceability to each extracted commit in new history
  - It enables humans to trace from the extracted commit to the
original commit by basic reading, clicking in tools like gitk and
scripting if desired
  - Enable subtree itself to utilize the above mentioned traceability
and simulate the add repository or rejoin merge commit. Subtree can
then "behave" similarly independent of the method being used.
  - Add option for rev-list so it can list based on
prefix/subdirectory. I have not been able to find any error, issues or
side effects adding the "-- $dir" to the rev-list command. All the
manual tests, I have done, behave correctly in my total patched git
revision. It gives a heck of performance for many-commit repositories.
 - Example: split contrib/subtree out of git repository.
    Without the option: parsing ~28000 commit
    With the option: parsing ~100 commits
Patches can be found here:
https://github.com/git/git/compare/master...Praqma:split-append-info-options-master
Commits related to this:
* cd712dda39 subtree: use append-info to only extract new commits in the prefix
* deb2e1cd8b subtree: add append-info option for adding info about
original commit
* ff73b37e22 subtree: Add option for listing commits based on prefix

Best regards Claus Schneider

Next: Tom Clarkson
Message 1 of 2 in “[RFC] subtree: handle unmerged history trees”
  1. Claus SchneiderMay 6, 2020
  2. Tom ClarksonMay 11, 2020

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.