twosigma / git-meta

Repository for the git-meta project -- build your own monorepo using Git submodules
http://twosigma.github.io/git-meta
BSD 3-Clause "New" or "Revised" License
219 stars 50 forks source link

Improve git meta merge-bare #744

Closed shijinglu closed 4 years ago

shijinglu commented 4 years ago
  1. output plumbing outputs to stderr, like

    Submodule s123: merging commit ...

  2. output a clear mege commit at then end of merge bare
  3. allow setting author and committer
  4. better print merge conflicts, if merge conflicting at submodule level, for example both their side and our side added the same submodule, then show conflict at submodule level. Otherwise, show each individual conflicting file, like git meta status does.
shijinglu commented 4 years ago

for bullet 1 & 2:

$ git meta merge-bare f0 f2 -m 'merge f0 f2'
Merging meta-repo commits 1d9a5eb70f2dea18fbea73f2f3ade9e1a6350d5e and 92e659eac8a80e89482e53cd1adc1817a99abf80
Merge commit created at 8ca64470fd2c80b6800ffe97f5177630a65750ae.
8ca64470fd2c80b6800ffe97f5177630a65750ae

$ git meta merge-bare f0 f2 -m 'merge f0 f2' 2>/dev/null
7c79b5a8eefe9085f0e5d6a072648291d5b20470
shijinglu commented 4 years ago

for bullet 2:

$ git meta merge-bare f0 f2 -m 'merge f0 f2' --author-name 'alice' --author-email 'alice@abc.com' --committer-name 'bob' --committer-email 'bob@def.com'
> Merging meta-repo commits 1d9a5eb70f2dea18fbea73f2f3ade9e1a6350d5e and 92e659eac8a80e89482e53cd1adc1817a99abf80
> Merge commit created at f35cc71f830527ebf029af344692fe2be0eb0c83.
> f35cc71f830527ebf029af344692fe2be0eb0c83

$ git cat-file -p f35cc71f830527ebf029af344692fe2be0eb0c83
> tree 6e44a9a655aae4da8c96cfc48ab2fc82a1956eb2
> parent 1d9a5eb70f2dea18fbea73f2f3ade9e1a6350d5e
> parent 92e659eac8a80e89482e53cd1adc1817a99abf80
> author alice <alice@abc.com> 1578432118 -0500
> committer bob <bob@def.com> 1578432118 -0500
>
> merge f0 f2
shijinglu commented 4 years ago

for bullet 3:

$ git meta merge-bare f1 f3 -m 'merge f1 f3'
Submodule s123: merging commit 5944ff17f5486f9418ee93f47b44c666e62bf16c.
Submodule s1234: merging commit cbb2bde919d74ac44ac38f85b02db49c91e4dbf3.
CONFLICT (content):
    conflicted:  s123/README.md
    conflicted:  s1234/README.md

Automatic merge failed