Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Managing Git workflows in large repos #47

Closed
maizo9 opened this issue Dec 26, 2017 · 1 comment
Closed

Managing Git workflows in large repos #47

maizo9 opened this issue Dec 26, 2017 · 1 comment
Labels
question Prefer discussions in Q&A.

Comments

@maizo9
Copy link

maizo9 commented Dec 26, 2017

I have been looking at your tool and several others and they all seem to not be able to handle the following scenario. Suppose you have a large repo with lots of developers working on some of the same files. The file metadata is used to control the build process, which is lengthy due to the size of the project; the metadata is limited to file access and modification times.
How do you handle the file metadata when a developer decides to pull the official repo or merges his/her code with the official repo, and the official repo contains changes to the same files that he/she is working on? Obviously, you want to preserve the file changes so a file contents merge will need to occur but what to do with the metadata? What if the metadata in the official repo points to a time earlier than the metadata for such file in the developers node? What if the opposite is true. There are several scenarios at play in here but I think the 2 described above are the main ones.

Can megastore handle such scenarios?

@przemoc przemoc added the question Prefer discussions in Q&A. label Apr 7, 2021
@przemoc
Copy link
Owner

przemoc commented Apr 7, 2021

metastore is only a tool for storing or applying metadata.
In examples/ directory you can find some scripts helping to some extent using it in scenarios you describe. Check their descriptions:

  • git-metapull:
    # This script can be used instead of git pull when updating from
    # a remote repo to make sure the metadata matches what is stored in
    # the repo.
    # It will do a git pull, show a list of changes to be made to
    # the metadata, and after getting confirmation, apply the changes.
  • git hook: post-checkout
    # An example hook script to set metadata information using
    # metastore after each checkout.
  • git hook: pre-commit
    # An example hook script to store metadata information using
    # metastore on each commit.
    #
    # WARNING:
    #
    # If the commit is aborted (e.g. by not entering any synopsis),
    # then updated metastore file (.metadata by default) is not reverted,
    # so its new version remains in the index.
    # To undo any changes in metastore file written since HEAD commit,
    # you may want to reset and checkout HEAD version of the file:
    #
    # git reset HEAD -- .metadata
    # git checkout HEAD -- .metadata

There is no metastore documentation regarding this topic beside above mentioned comments in scripts and one paragraph in README file:

metastore/README

Lines 34 to 41 in d2a1530

If you want to use metastore within git repository, then consider
copying exemplary scripts from examples/hooks/ directory to hooks
subdirectory in your git directory, and make them executable.
You can also tune them if it's necessary. But.
Before using, please read the warning in the comments of pre-commit hook.
Mind that merge conflicts can only be solved manually, because metastore
file is binary in its current form (there's a plan to fix it in future).
Dump action can be really helpful in such cases.

There is issue #33 for tracking that. Patches are welcomed.

But, I wrote "to some extent", because collisions are effectively merge conflicts (or local forms of them, i.e. how users should integrate their changes with regards to metadata), which need manual intervention/decision, especially if you want some particular behavior.
How to handle merge conflicts is up to the user. Dump action has been introduced in metastore to help investigate stuff (you can dump state stored in .metadata or in file system for given path).

What we also lack is proper textual format (#6) that would help in such cases, because then you could resolve conflicts using your favorite tools (meld, kdiff3, you name it). Binary formats are not really handy for that.

@przemoc przemoc closed this as completed Apr 7, 2021
Repository owner locked and limited conversation to collaborators Apr 7, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
question Prefer discussions in Q&A.
Projects
None yet
Development

No branches or pull requests

2 participants