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

Re: Storing state in $GIT_DIR

From
Eric W. Biederman <ebiederm@xmission.com>
Date
Aug 26, 2005, 06:53 UTC
Message-ID
<m17je9tcj0.fsf@ebiederm.dsl.xmission.com>
In-Reply-To
<46a038f90508252115415acc04@mail.gmail.com>
Martin Langhoff <martin.langhoff@gmail.com> writes:
Show 9 quoted lines
> Hmmm. That repo is in sync, but there are no guarantees that they will
> travel together to a different repo. In fact, the push/pull
> infrastructure wants to push/pull one head at a time.
>
> And if they are not in sync, I have no way of knowing. Hmpf. I lie:
> the arch metadata could keep track of what it expects the last head
> commits to be, and complain bitterly if something smells rotten.
>
> let me think about it ;)

Thinking about it going from arch to git should be just a matter of checking sha1 hashes, possibly back to the beginning of the arch tree.

Going from git to arch is the trickier mapping, because you need to know the full repo--category--branch--version--patch mapping.

Hmm. Thinking about arch from a git perspective arch tags every commit. So the really sane thing to do (I think) is to create a git tag object for every arch commit.

With that structure you would just need to create a git-arch-rev-list so you can get a list of which arch branches you already have. And then a git-arch-push and a git-arch-pull should be just a matter of finding the common ancestor and continuing along the branch until you reach the head. Handling all heads in an arch repository is a little trickier but should not be too bad.

On the push side you can just treat git as an arch working directory and push changsets into the appropriate branch. For branches that do not have tla as the ancestor you can do the equivalent of tla archive-mirror.

Changes can be merged on whichever side make sense.

With patch trading (Martin I think I know what you are refering to) arch does seem to have a concept that does not map very well to git, and this I think is a failing in git. Arch can record that just the changes from a single changset/patch were merged. This happens all of the time in the kernel tree when patches are merged. The interesting case for merge algorithms is when two maintainers merge the same patches into separate branches and then the branches are merged. Does git have a good way of coping with that case?

On the simple side it for patch trading it might just be worth treating them as a special git merge with just one parent in the parents line and the real parent listed in the merge comment, along with the original parents commit comment. But that just might be too ugly to think about.

How does StGit handle this?
Eric
Previous: Martin LanghoffNext: Martin Langhoff
Message 13 of 17 in “Storing state in $GIT_DIR”
  1. Martin LanghoffAug 25, 2005
  2. Linus TorvaldsAug 25, 2005
  3. Martin LanghoffAug 26, 2005
  4. Linus TorvaldsAug 26, 2005
  5. Martin LanghoffAug 26, 2005
  6. Junio C HamanoAug 26, 2005
  7. Daniel BarkalowAug 26, 2005
  8. Linus TorvaldsAug 26, 2005
  9. Junio C HamanoAug 26, 2005
  10. Linus TorvaldsAug 27, 2005
  11. Junio C HamanoAug 26, 2005
  12. Martin LanghoffAug 26, 2005
  13. Eric W. BiedermanAug 26, 2005
  14. Martin LanghoffAug 26, 2005
  15. Eric W. BiedermanAug 26, 2005
  16. Accept -m and friends for initial commits and merge commits.Junio C Hamano, Aug 26, 2005
  17. Martin LanghoffAug 26, 2005

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.