Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
643 commits
Select commit Hold shift + click to select a range
0479e22
Merge pull request #698 from bpeabody/fix-pull-rebase-deduction
bpeabody Mar 26, 2019
cb2a576
turn off merge with bare in normal merge mode
shijinglu May 22, 2019
2a1377b
Merge pull request #706 from shijinglu/turnOffDefaultMergeInBare
shijinglu May 22, 2019
60ac10b
upgrade NodeGit to v0.23.0
shijinglu Jun 4, 2019
44fd9c7
Merge pull request #708 from shijinglu/upgradeNodeGit23
novalis Jun 7, 2019
f21ed7f
fix #707: failed to set workdir correctly if submodule first opened i…
shijinglu Jun 5, 2019
14716bd
Merge pull request #709 from shijinglu/fixBareReopenIssue
novalis Jun 10, 2019
4e79f8f
message may have had a newline automatically added
novalis Jun 28, 2019
2e0df32
it is ok to delete refs
novalis Jun 28, 2019
f9d0d4d
store notes in a common location
novalis Jul 1, 2019
863bbe9
Exec pre-commit of each submodule before start commiting.
angleets Jul 30, 2019
d0c94bb
Merge pull request #718 from anglee/master
novalis Jul 31, 2019
731f3a2
retry certain push failures
novalis Jul 31, 2019
84c9926
Merge branch 'retry'
novalis Jul 31, 2019
d534534
support nested urls in push
novalis Aug 23, 2019
02f9948
allow the synthetic ref check to exclude by path
novalis Sep 4, 2019
6c84d12
refuse to open unmerged submodules, like git does
novalis Sep 6, 2019
38c5e9e
doc: Replaced refs/meta with refs/commits to reflect code behavior.
jhdub23 Sep 6, 2019
4f2a656
remove docstring for unused parameter
novalis Sep 6, 2019
d40a885
do not crash in status on empty repo
novalis Sep 6, 2019
3e16822
rename variable to avoid shadowing
novalis Sep 9, 2019
a24562d
Merge branch 'no-open-conflicted'
novalis Sep 9, 2019
a16faef
Write notes for all parents and simplify the synthetic branch check to
novalis Sep 13, 2019
9610e6f
move delete check to place where it will actually work
novalis Sep 20, 2019
1964ea4
set exec's maxBuffer
novalis Sep 23, 2019
a59c3ef
Make push start with submodule's workdir if one exists
angleets Oct 14, 2019
909ea82
fix #735
novalis Oct 23, 2019
af3500c
Bump lodash from 4.17.11 to 4.17.15 in /node
dependabot[bot] Oct 30, 2019
0582e9b
Do not fail to push when a changed submodule is closed; all we need i…
novalis Nov 15, 2019
c538925
Open fewer submodules in parallel
novalis Jan 6, 2020
52e6004
Merge pull request #741 from novalis/open-less
motlin Jan 6, 2020
1da9e2f
fix merge-bare no-ff param behavior not be inverted
Jan 6, 2020
8b2fcff
fix merge to use a commit for submodules instead of HEAD so merge-bar…
Jan 6, 2020
2e3b836
fix git meta fails when HEAD does not exist #742
shijinglu Jan 7, 2020
6bd26af
Merge pull request #743 from shijinglu/null_head_checkout
shijinglu Jan 8, 2020
4121a2a
Allow git merge reading GIT_AUTHOR_xxx and GIT_COMMITTER_xxx environe…
shijinglu Jan 9, 2020
2d13ed7
Merge pull request #746 from shijinglu/allow_setting_author
shijinglu Jan 9, 2020
bfb7212
Imporve git meta merge-bare #744
shijinglu Jan 9, 2020
06e2f77
Add error message to remind user to use git meta push other than git …
shijinglu Jan 15, 2020
dbb62a6
Combine two error messages for failed synthetic branch check.
motlin Jan 16, 2020
eca1c48
Create synthetic ref for fetches in submodules
novalis Jan 16, 2020
265cf64
Allow merge-bare and merge to best effort merge submodule urls
shijinglu Feb 28, 2020
5e127d9
Merge pull request #752 from shijinglu/merge_bare_remove_submodule
shijinglu Feb 29, 2020
5c1ecd7
Express fetch error during merging more explicitly
shijinglu Mar 3, 2020
47a6902
Merge pull request #753 from shijinglu/suface_fetch_error
shijinglu Mar 3, 2020
5cdb724
Revert node_js version bump
shijinglu Mar 4, 2020
bd296a6
Merge pull request #754 from shijinglu/revert_node_upgrade
shijinglu Mar 4, 2020
939724e
If our sha is a descendant of their sha, we need to make sure that our
novalis Apr 1, 2020
257b553
merge-bare creates a commit but doesn't update HEAD, so it doesn't ne…
novalis Apr 1, 2020
9928411
Support --do-not-recurse for merge and merge-bare
novalis Mar 31, 2020
a646afe
add option to merge{,-bare} to read commit message from a file
novalis Apr 1, 2020
ac87408
Skip url changes check in normal merge.
shijinglu May 20, 2020
7e47503
Merge pull request #759 from shijinglu/skipUrlCheckForNormalMerge
shijinglu May 21, 2020
73b9a88
Pull: do not check remote name
novalis May 26, 2020
9295a15
Pull: use FETCH_HEAD after fetch since raw URL fetches do not update …
novalis May 26, 2020
0a51aa5
only call post-open if any subs opened
novalis Jun 3, 2020
8c9d282
submodule commit hook failures should be silent
novalis Jun 3, 2020
8fe2c27
Improve message for direct submodule conflicts
novalis Jun 3, 2020
0fe08d6
Improve language usage
novalis Jun 15, 2020
e1b1a77
If merge failed in a submodule, print what submodule it was.
shijinglu Jul 7, 2020
05871af
Do not crash even if a submodule is corruptted and its HEAD points to…
shijinglu Jul 8, 2020
9c7e047
Merge pull request #767 from shijinglu/deal_with_null_sub_head
shijinglu Jul 9, 2020
28d4eb4
Merge pull request #766 from shijinglu/merge_error
shijinglu Jul 9, 2020
c4199d6
Bump lodash from 4.17.15 to 4.17.19 in /node
dependabot[bot] Jul 17, 2020
04b136a
Merge pull request #769 from twosigma/dependabot/npm_and_yarn/node/lo…
novalis Jul 17, 2020
326b18a
rename confusingly-named function
novalis Jul 16, 2020
68bca90
spelling
novalis Jul 17, 2020
6bd74a7
Give pre-commit hooks in submodules access to temp index
novalis Jul 21, 2020
9d19657
Merge pull request #770 from novalis/precommit
novalis Jul 24, 2020
fc66830
re-plumb no-verify thru
novalis Jul 27, 2020
a375af1
jsdoc
novalis Jul 27, 2020
b9a4d62
Merge pull request #771 from novalis/precommit
motlin Jul 28, 2020
de7b4d9
Allow git-meta concatenating multiple --message arguments like vanill…
shijinglu Jul 30, 2020
37c7f4f
Merge pull request #772 from shijinglu/joinMultipleCommitMessages
shijinglu Aug 3, 2020
ad0828e
precommit in meta too
novalis Aug 3, 2020
c40c8f6
Merge pull request #773 from novalis/precommit
novalis Aug 3, 2020
55299f2
Run hooks after opening a submodule everywhere, not just in git meta …
novalis Aug 4, 2020
04815f9
Merge pull request #774 from novalis/post-open
novalis Aug 5, 2020
b512ddb
git meta open -c
novalis Aug 6, 2020
6cf373b
Merge pull request #775 from novalis/open-c
novalis Aug 8, 2020
79ac5ab
migrate to use yarn
shijinglu Aug 19, 2020
2721543
Merge pull request #776 from shijinglu/moveToUseYarn
novalis Aug 19, 2020
66f97e9
Bump nodegit to ^0.25.0
shijinglu Aug 20, 2020
b787051
Merge pull request #779 from shijinglu/bumpNodeGit
shijinglu Aug 21, 2020
d5ed4bb
fix travis-ci not triggered
shijinglu Aug 21, 2020
b9ce32d
Support multiple commits in cherry-pick
novalis Aug 19, 2020
8abefe0
Merge pull request #780 from shijinglu/fixTravisCi
shijinglu Aug 22, 2020
139f7c9
Handle ranges in cherry-pick
novalis Aug 22, 2020
72057ba
Merge pull request #777 from novalis/cp-many
novalis Aug 24, 2020
8145032
Let git-meta notice changes to .gitmodules
shijinglu Aug 25, 2020
861368a
Merge pull request #781 from shijinglu/metaSee.gitmodules
shijinglu Aug 26, 2020
48d58fe
Cherry-pick command should test if "args.commit" is an empty array
shijinglu Sep 1, 2020
bed9d01
Do not display a backtrace for hook failure
novalis Sep 1, 2020
dc34e18
Merge pull request #782 from shijinglu/fixCommitCheck
shijinglu Sep 1, 2020
9aa066e
Merge pull request #783 from novalis/cp-msg
novalis Sep 1, 2020
cda00b2
Change Diff.OPTION.EXCLUDE_SUBMODULE to Diff.OPTION.IGNORE_SUBMODULE
shijinglu Sep 3, 2020
e10e9d0
Fix NodeGit.Reference.TYPE.LISTALL warning
shijinglu Sep 3, 2020
824a37e
Merge pull request #784 from shijinglu/fixDiffOption
shijinglu Sep 4, 2020
73393a5
Merge pull request #785 from shijinglu/fixListAllWarning
shijinglu Sep 4, 2020
3cea11c
optimize isOpen for the common case, to not read all submodule dirs
novalis Sep 10, 2020
11ac151
Merge pull request #786 from novalis/optimizeIsOpen
novalis Sep 10, 2020
21658fe
Reject amend commits mid merge/rebase/cherry-pick
novalis Sep 14, 2020
5787c55
Do not allow partial commits mid-merge/rebase/etc
novalis Sep 14, 2020
0594fae
Merge pull request #787 from novalis/reject
novalis Sep 15, 2020
746d683
make commit --all mid-merge continue the merge
novalis Sep 16, 2020
2f7a096
Use git instead of node-git to determine what commit's submodules nee…
novalis Sep 22, 2020
00eef5f
do not shell out unnecessarily (which should eliminate E2BIG)
novalis Sep 24, 2020
0269a4f
Fix generate-repo.js.
alexst2 Sep 25, 2020
d068db5
avoid exceptions from calling git-meta checkout on unopened submodules
tsuikevi-twosigma Sep 25, 2020
9d52074
Merge branch 'alexst2-fix-generate-repo'
novalis Sep 25, 2020
e0213ff
adjust maxbuffer for rev-list
novalis Sep 25, 2020
1f28379
Show error when committing with -i and -a flags
kaaniboy Sep 25, 2020
f245ec8
Fix formatting
kaaniboy Sep 25, 2020
9fa9d5d
Add submodule foreach by forwarding to vanilla git
kaaniboy Sep 25, 2020
a331f06
Merge pull request #795 from kaaniboy/issue409
novalis Sep 25, 2020
49852dc
only filter out submodules when checking out files if no commit is sp…
tsuikevi-twosigma Sep 28, 2020
c4df05f
Merge pull request #792 from tsuikevi-twosigma/master
novalis Sep 28, 2020
d17a6e2
Add mutex for commit hooks to serialize execution (since hooks might …
novalis Sep 28, 2020
ae11e99
rename function
novalis Sep 28, 2020
b02d269
fix indent
novalis Sep 28, 2020
1ea06e8
Support commit-msg hook
novalis Sep 29, 2020
0f13e1a
Better error message (no stack trace) if editor exits non-zero
novalis Sep 30, 2020
fa0d4a2
Avoid searching the whole repo when we only care about changes to .gi…
novalis Oct 21, 2020
17f1ee6
Oops, empty lists apparently aren't false in JS
novalis Oct 22, 2020
56354c7
Stop calling NodeGit.Branch.upstream on non-branches (e.g. detached H…
novalis Nov 6, 2020
fecb725
Merge branch 'tracking'
novalis Nov 6, 2020
e99f6b0
Correctly handle tz offset.
alexst2 Dec 4, 2020
86f1138
Add --force-with-lease to push.
alexst2 Dec 4, 2020
171736a
Merge pull request #803 from alexst2/push-force-with-lease
novalis Dec 5, 2020
65695d1
Remove bogus params to createBranch
novalis Dec 9, 2020
d0b6265
Bump ini from 1.3.5 to 1.3.8 in /node
dependabot[bot] Dec 13, 2020
778c440
Merge branch 'dependabot/npm_and_yarn/node/ini-1.3.8'
novalis Dec 15, 2020
32a9535
Bump bl from 1.2.2 to 1.2.3 in /node
dependabot[bot] Dec 15, 2020
72d0bd8
Merge branch 'issue711' of https://github.com/kaaniboy/git-meta
novalis Dec 16, 2020
eaaeb3b
Merge commit 'e99f6b0c96b96c80fc98ecfe3c2b26cc095d9740'
novalis Dec 16, 2020
fbfec71
remove unused parameter
novalis Dec 15, 2020
bc39376
Remove redundant synthetic ref update. Fetch already fetches into
novalis Dec 16, 2020
7a0d853
stitch: prefix ref names for submodule refs
novalis Dec 16, 2020
589c468
fix quoting
novalis Dec 16, 2020
c2e3369
fix test
novalis Dec 17, 2020
fc2eb8c
run precommit hook on non-all amend
novalis Dec 17, 2020
8d528ed
Merge branch 'precommit-amend'
novalis Dec 17, 2020
bc377d4
Improve message when attempting to push with .gitmodules in a bad state
novalis Dec 28, 2020
86ea3cc
fix missing $
novalis Dec 29, 2020
245c877
Fix missing '$'
novalis Dec 31, 2020
36f6045
Make commit faster with many open submodules
novalis Jan 22, 2021
4e6910a
Merge branch 'faster-commit'
novalis Jan 22, 2021
7ee2492
make reset (and probably also push) faster by using a modern version …
novalis Jan 22, 2021
5d442b7
Merge branch 'faster-reset'
novalis Jan 25, 2021
dd6ebe8
Test for cherry-pick
novalis Jan 22, 2021
09db552
Merge branch 'cp-test'
novalis Jan 25, 2021
9ba33c8
make git meta open open ts/foo if ts/foo/bar is requested
novalis Jan 25, 2021
66a12d1
workAroundLibgit2MergeBug to skip creating synthetic ancestor if ance…
shijinglu Feb 2, 2021
8bef90f
Merge branch 'shijinglu-doNotCreateEmptySubmoduleChangeObject'
novalis Feb 5, 2021
3d4364e
Do not tell the user that we "finished" opening a submodule when we a…
novalis Feb 5, 2021
3ff2428
format
novalis Feb 5, 2021
59ec5c7
Merge branch 'message'
novalis Feb 12, 2021
363a471
Merge branch 'format'
novalis Feb 12, 2021
24f08d9
Make stash support commits inside submodules
novalis Mar 1, 2021
4f76e97
Merge branch 'stash'
novalis Mar 3, 2021
9dd0493
support '-uno' in git-meta-status
tsuikevi-twosigma Mar 12, 2021
711d530
Support an alternate submodule repository for stitching
novalis Mar 16, 2021
8d1a648
Merge branch 'altsubs'
novalis Mar 16, 2021
3796d6b
Fail git meta open if you request a sub that does not exist
novalis Mar 16, 2021
479c71d
Merge branch 'open-fail'
novalis Mar 16, 2021
692f242
Fail git meta close if you request a sub that does not exist, instead…
novalis Apr 8, 2021
b8df24a
Merge branch 'close-strict'
novalis Apr 8, 2021
9bc87c8
Use better notes ref update method
novalis Apr 15, 2021
b518ec7
Merge branch 'update-retry'
novalis Apr 15, 2021
056367e
stitch: Handle missing converted commit
novalis Apr 27, 2021
a279b96
Merge branch 'missing-converted'
novalis Apr 27, 2021
e00aebc
Bump handlebars from 4.7.6 to 4.7.7 in /node
dependabot[bot] May 9, 2021
cf50cec
Merge pull request #828 from twosigma/dependabot/npm_and_yarn/node/ha…
novalis May 11, 2021
7607675
Bump lodash from 4.17.19 to 4.17.21 in /node
dependabot[bot] May 11, 2021
5a7bf92
Merge pull request #829 from twosigma/dependabot/npm_and_yarn/node/lo…
novalis May 11, 2021
b77d742
git meta checkout should write to stderr
novalis Jun 29, 2021
084aa80
Better error message for open with implicit ./
novalis Jun 29, 2021
ab0f0e5
Move commit message request mostly after pre-commit hooks
novalis Jun 30, 2021
ff9feb7
Merge branch 'stdout'
novalis Jul 2, 2021
b8f0052
Merge branch 'open-msg'
novalis Jul 2, 2021
7aa818f
Merge branch 'hook-order'
novalis Jul 2, 2021
d58f3c8
fix jshint
novalis Jul 8, 2021
174a59a
Fix stitch tests
novalis Jul 8, 2021
b8e3bde
Consider the index when comparing the tree to worktree during a commit.
novalis Jul 9, 2021
a57722c
add -f option to open
novalis Jul 13, 2021
f9e761c
Merge branch 'ignored-added'
novalis Jul 19, 2021
4517eed
Merge branch 'fix-test'
novalis Jul 19, 2021
5d5c1af
Merge branch 'open-f'
novalis Jul 19, 2021
a829a33
Fix hook chdir race
novalis Jul 20, 2021
a188f4d
Merge branch 'hook-race'
novalis Jul 20, 2021
9b6f72b
Bump tar from 4.4.9 to 4.4.15 in /node
dependabot[bot] Aug 5, 2021
4d8b22a
Merge remote-tracking branch 'upstream/dependabot/npm_and_yarn/node/t…
novalis Aug 5, 2021
25b6d60
replace travis with github actions
novalis Aug 5, 2021
3895dcb
allow half open submodules from a commit
xueqilsj Aug 10, 2021
35b4208
Merge branch 'actions'
novalis Aug 11, 2021
d2eae13
Stash deletion of submodules
novalis Aug 5, 2021
a2af467
differentiate regular and meta rebases when warning user
novalis Aug 11, 2021
be62e7b
action on pr
novalis Aug 11, 2021
bee8534
Better logging for cherry-pick
novalis Aug 11, 2021
5e5a854
Merge branch 'actions-pr'
novalis Aug 11, 2021
e1b3eed
Merge branch 'mid-rebase'
novalis Aug 11, 2021
588e633
Merge branch 'deleted-subs'
novalis Aug 11, 2021
991f528
Merge pull request #840 from shijinglu/half_open
shijinglu Aug 12, 2021
551b22d
in git meta open, get list of all submodules from index instead of co…
xueqilsj Aug 12, 2021
593be1d
Merge pull request #844 from shijinglu/read_subs_from_index
shijinglu Aug 12, 2021
aef8939
fix SubmoduleConfigUtil.getSubmodulesFromIndex returns a map, open.js…
xueqilsj Aug 12, 2021
4c6a742
Merge pull request #845 from shijinglu/read_subs_from_index2
shijinglu Aug 13, 2021
87920e1
Better logging for cherry-pick
novalis Aug 11, 2021
377a0b3
Revert "Stash deletion of submodules"
novalis Aug 18, 2021
ff40b77
Merge branch 'rv-stash'
novalis Aug 18, 2021
c3e9e53
Stash deletion of submodules (second try)
novalis Aug 5, 2021
3c498c9
Merge branch 'stash-deleted-2'
novalis Aug 25, 2021
2b7751c
fix git meta submodule status .
novalis Aug 26, 2021
d5e7c73
Merge branch 'fix-submodule-dot'
novalis Sep 1, 2021
9465231
Merge pull request #843 from novalis/cp-logging
shijinglu Dec 13, 2021
b0e185a
Add a command that allows creating a new tree by patching an existing…
shijinglu Jan 26, 2022
974389c
Merge pull request #854 from shijinglu/amendTreeCommand
shijinglu Jan 28, 2022
ced6ad4
add workflow_dispatch event to enable manual triggering of workflows
leahnp Feb 16, 2022
23e1f60
Fix broken test on newer Node.js versions
geofft Apr 1, 2022
9ed0aff
Merge pull request #862 from geofft/broken-test
shijinglu Apr 4, 2022
a6eb8a1
Fix flaky test "rebase in a sub, was conflicted" (fixes #864)
geofft Jun 10, 2022
ee21b1c
Make hooks work with hooksPath config
anglee Jan 21, 2022
c1af129
Merge pull request #853 from anglee/master
shijinglu Jun 17, 2022
b0f3737
Merge pull request #866 from geofft/issue-864-better
tsiq-shu Jul 21, 2022
1f5c0f9
Fixed typos in architecture.md
Dsl03 Jul 27, 2022
2ea67bf
Merge pull request #867 from Dsl03/typo_fix
Jul 27, 2022
9e3a6c0
Typo in comment
selsky Mar 4, 2022
8afd587
implemented extra error message when running into git-meta cherry-pic…
Dsl03 Aug 9, 2022
1f923c4
Allow `git meta add -u` with no path
gobisaTS Sep 21, 2022
c370405
Use 'PrintStatusUtil' in cmd/add
anglee Oct 20, 2022
23f7069
Move require statement down
anglee Oct 20, 2022
5676c75
Merge pull request #871 from anglee/master
tsiq-shu Oct 20, 2022
b411859
Fix `add -u` command re-resolving relative paths
gobisaTS Oct 25, 2022
ca297ce
Merge pull request #872 from gobisaTS/patch-add-double-relative-paths
tsiq-shu Oct 25, 2022
fe2e118
Add no-commit option to cherry-pick
cstaykov Dec 10, 2022
c1fa65c
Update ci.yml
tsiq-shu Dec 12, 2022
b67fd77
Merge pull request #876 from twosigma/tsiq-shu-patch-1
tsiq-shu Dec 12, 2022
7e56eaf
implement git meta add verbose flag
geeli123 Dec 10, 2022
0b215bd
Merge pull request #874 from geeli123/implement-add-verbose
tsiq-shu Dec 15, 2022
3222c5a
fix jshint issues
geeli123 Dec 15, 2022
8da623a
log 'modified' on git add existing file
geeli123 Dec 15, 2022
1df3c2a
Add more detail to help command
cstaykov Dec 15, 2022
27a0822
modified -> modify
geeli123 Dec 15, 2022
67bb252
Merge pull request #1 from twosigma/master
cstaykov Dec 15, 2022
2a69a9f
Merge pull request #877 from geeli123/fix-implement-verbose
tsiq-shu Dec 15, 2022
6ea510b
update test env to 20.04 ubuntu
geeli123 Dec 15, 2022
de11cfd
Merge pull request #878 from geeli123/update-ubuntu-environment
tsiq-shu Dec 15, 2022
9ef8e29
Merge pull request #2 from twosigma/master
cstaykov Dec 15, 2022
2839613
Add semicolon
cstaykov Dec 15, 2022
b1e1908
Merge pull request #873 from cstaykov/cherry-pick
tsiq-shu Dec 16, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: CI
on: [push, pull_request, workflow_dispatch]
jobs:
Test-Git-Meta:
runs-on: ubuntu-20.04
steps:
- run: echo "The job was automatically triggered by a ${{ github.event_name }} event."
- run: sudo apt-get install libkrb5-dev
- name: Check out repository code
uses: actions/checkout@v2
- run: git config --global user.name "A U Thor"
- run: git config --global user.email author@example.com
- run: yarn install
working-directory: ${{ github.workspace }}/node
- run: yarn test
working-directory: ${{ github.workspace }}/node
- run: echo "This job's status is ${{ job.status }}."
3 changes: 2 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"undef" : true,
"node" : true,
"unused" : true,
"esnext" : true,
"esversion": 8,
"noyield" : true,
"varstmt" : true,
"predef": [
"Intl"
Expand Down
29 changes: 0 additions & 29 deletions .travis.yml

This file was deleted.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
<img src="/doc/git-meta-logo.png" width="600">
</p>

[![Build Status](https://travis-ci.org/twosigma/git-meta.svg?branch=master)](https://travis-ci.org/twosigma/git-meta)

# What is git-meta?

Git-meta allows developers to work with extremely large codebases --
Expand Down
118 changes: 62 additions & 56 deletions doc/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,23 +108,29 @@ products that take a similar approach:

- [Gitslave](http://gitslave.sourceforge.net)
- [myrepos](https://myrepos.branchable.com)
- [Android Repo](https://source.android.com/source/using-repo.html)
- [git-repo](https://gerrit.googlesource.com/git-repo/)
- [gclient](http://dev.chromium.org/developers/how-tos/depottools#TOC-gclient)
- [Git subtrees](https://git-scm.com/book/en/v1/Git-Tools-Subtree-Merging)
- [Git submodules](https://git-scm.com/docs/git-submodule)

All of these tools overlap with the problems git-meta is trying to solve, but
none of them are sufficient:
none of them is sufficient:

- most don't provide a way to reference the state of all repositories
(Gitslave, Android Repo, Myrepos)
- some require a custom server (Android Repo)
- many are strongly focused on supporting a specific software platform (Android
Repo, gclient)
- Most don't provide a way to reference the state of all repositories (Gitslave
and Myrepos). git-repo has the ability to reference the state of all repos,
but not in a way that can be used easily with normal Git commands (the state
is tracked in an XML file in a separate repository).
- or are strongly focused on supporting a specific piece of software (gclient)
- doesn't fully solve the scaling issue (Git subtrees)
- prohibitively difficult to use (Git submodules)
- lack scalable collaboration (e.g., pull request) strategies

The git-repo project uses an approach that is structurally similar to the one
used by git-meta: a (remote) meta-repo tracks the state of the sub-repos in an
XML file. It does not generally try to provide a full suite of
cross-repository operations (such as `rebase`, `cherry-pick`, etc.) and assumes
the use of the Gerrit code review tool.

Git submodules come the closest: they do provide the technical ability to solve
the problem, but are very difficult to use and lack some of the desired
features. With git-meta, we build on top of Git submodules to provide the
Expand Down Expand Up @@ -292,13 +298,13 @@ explain our high-level branching and tagging strategy. Then, we define
synthetic-meta-refs and discuss how they fit into git-meta workflows. Finally,
we present two variations on synthetic-meta-refs to help illustrate how the
concept evolved; one of these variations, *mega-refs*, may prove necessary for
old version of Git.
old versions of Git.

## Branches and Tags

In git-meta, branches and tags are applied only to meta-repos. Because each
commit in a meta-repo unambiguously describes the state of all sub-repos, it is
unnecessary to apply branches and tags to sup-repos. Furthermore, as described
unnecessary to apply branches and tags to sub-repos. Furthermore, as described
in the "Design and Evolution" section below, schemes relying on sub-repo
branches proved to be impractical.

Expand All @@ -322,7 +328,7 @@ of this strategy on client-side checkouts.

A synthetic-meta-ref is a ref in a sub-repo whose name includes the commit ID
of the commit to which it points, such as:
`refs/meta/929e8afc03fef8d64249ad189341a4e8889561d7`. The term is derived from
`refs/commits/929e8afc03fef8d64249ad189341a4e8889561d7`. The term is derived from
the fact that such a ref is:

1. _synthetic_ -- generated by a tool
Expand All @@ -341,35 +347,35 @@ A mono-repo has two invariants with respect to synthetic-meta-refs:
Some mono-repos in valid states:

```
'-------------------` '-------------------`
| meta-repo | | a |
| - - - - - - - - - | | - - - - - - - - - |
| master | a [a1] | | refs/meta/a1 [a1] |
`-------------------, `-------------------,
'-------------------` '-----------------------`
| meta-repo | | a |
| - - - - - - - - - | | - - - - - - - - - - - |
| master | a [a1] | | refs/commits/a1 [a1] |
`-------------------, `-----------------------,

The 'master' branch in the meta-repo indicates commit 'a1' for repo 'a' and a
valid synthetic-meta-ref exists.
```

```
'-------------------` '-------------------`
| meta-repo | | a |
| - - - - - - - - - | | - - - - - - - - - |
| master | a [a1] | | refs/meta/a1 [a1] |
| - - - - -+- - - - | | refs/meta/ab [ab] |
| release | a [ab] | `-------------------,
'-------------------` '-----------------------`
| meta-repo | | a |
| - - - - - - - - - | | - - - - - - - - - - - |
| master | a [a1] | | refs/commits/a1 [a1] |
| - - - - -+- - - - | | refs/commits/ab [ab] |
| release | a [ab] | `-----------------------,
`-------------------,

The meta-repo has another branch, 'release', indicating commit 'ab' in 'a',
which also has a valid synthetic-meta-ref.
```

```
'-----------------------` '-------------------`
| meta-repo | | a |
| - - - - - - - - - - - | | - - - - - - - - - |
| master | a [a1] | | refs/meta/a2 [a2] |
| - - - - -+- - - - - - | `-------------------,
'-----------------------` '-----------------------`
| meta-repo | | a |
| - - - - - - - - - - - | | - - - - - - - - - - - |
| master | a [a1] | | refs/commits/a2 [a2] |
| - - - - -+- - - - - - | `-----------------------,
| release | a [a2->a1] |
`-----------------------,

Expand All @@ -381,31 +387,31 @@ for 'a1'.
A few mono-repos in invalid states:

```
'-------------------` '-------------------`
| meta-repo | | a |
| - - - - - - - - - | | - - - - - - - - - |
| master | a [a1] | | refs/meta/a1 [a2] |
`-------------------, `-------------------,
'-------------------` '-----------------------`
| meta-repo | | a |
| - - - - - - - - - | | - - - - - - - - - - - |
| master | a [a1] | | refs/commits/a1 [a2] |
`-------------------, `-----------------------,

The synthetic-meta-ref for 'a1' does not point to 'a1'.
```

```
'-------------------` '-------------------`
| meta-repo | | a |
| - - - - - - - - - | | - - - - - - - - - |
| master | a [a1] | | refs/meta/ab [ab] |
`-------------------, `-------------------,
'-------------------` '-----------------------`
| meta-repo | | a |
| - - - - - - - - - | | - - - - - - - - - - - |
| master | a [a1] | | refs/commits/ab [ab] |
`-------------------, `-----------------------,

No synthetic-meta-ref for commit 'a1'.
```

```
'-----------------------` '-------------------`
| meta-repo | | a |
| - - - - - - - - - - - | | - - - - - - - - - |
| master | a [a1] | | refs/meta/a1 [a1] |
| - - - - -+- - - - - - | `-------------------,
'-----------------------` '-----------------------`
| meta-repo | | a |
| - - - - - - - - - - - | | - - - - - - - - - - - |
| master | a [a1] | | refs/commits/a1 [a1] |
| - - - - -+- - - - - - | `-----------------------,
| release | a [a2->a1] |
`-----------------------,

Expand Down Expand Up @@ -452,32 +458,32 @@ local
`---------------------------------,

remote
'---------------------` '--------------` '--------------`
| meta-repo | | | a | | b |
| master | a [a1] | | refs/meta/a1 | | refs/meta/b1 |
| [m1] | b [b1] | | [a1] | | [b1] |
`---------------------, `--------------, `--------------,
'---------------------` '-----------------` '-----------------`
| meta-repo | | | a | | b |
| master | a [a1] | | refs/commits/a1 | | refs/commits/b1 |
| [m1] | b [b1] | | [a1] | | [b1] |
`---------------------, `-----------------, `-----------------,
```
Where we have new commits, `a2` and `b2` in repos `a` and `b`, respectively,
and a new meta-repo commit, `m2` that references them. Note that `a1` and `b1`
have appropriate synthetic-meta-refs
have appropriate synthetic-meta-refs

After invoking `git meta push`, the remote repos would look like:

```
'---------------------` '--------------` '--------------`
| meta-repo | | | a | | b |
| master | a [a2] | | refs/meta/a1 | | refs/meta/b1 |
| [m2] | b [b2] | | [a1] | | [b1] |
`---------------------, | refs/meta/a2 | | refs/meta/b2 |
| [a2] | | [b2] |
`--------------, `--------------,
'---------------------` '-----------------` '-----------------`
| meta-repo | | | a | | b |
| master | a [a2] | | refs/commits/a1 | | refs/commits/b1 |
| [m2] | b [b2] | | [a1] | | [b1] |
`---------------------, | refs/commits/a2 | | refs/commits/b2 |
| [a2] | | [b2] |
`-----------------, `-----------------,
```
Note that `git meta push` created meta-refs in the sub-repos for the new
commits before it updated the meta-repo. If the process had been interrupted,
for example, after pushing `refs/meta/a2` but before pushing `refs/meta/b2`,
for example, after pushing `refs/commits/a2` but before pushing `refs/commits/b2`,
the mono-repo would still be in a valid state. If no meta-repo commit ever
referenced `a2`, the synthetic-meta-ref `refs/meta/a2` would eventually be
referenced `a2`, the synthetic-meta-ref `refs/commits/a2` would eventually be
cleand up.

### Client-side access to sub-repo commits
Expand Down
69 changes: 69 additions & 0 deletions doc/stitch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<!--
Copyright (c) 2021, Two Sigma Open Source
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of git-meta nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
-->

# Overview

The stitcher stitches a git-meta repository into a single unified
repository (perhaps leaving behind some submodules, depending on
configuration).

# Motivation

You might want this because you are migrating away from git-meta. Or
you might just want a unified repo to power code search or code review
tooling.

There's also a destitched, which reverses the process. Of course,
that's a little trickier: if you create a new subdirectory which
itself contains two subdirectories, how many sub*modules* do you
create?

# An implementation note

The most efficient repository layout that we have yet discovered for
stitching has three repositories:
1. just the meta objects
2. just the submodule objects
3. the stitched commits, which has objects/info/alternates pointed at
(1) and (2).

This makes fetches from the meta repo faster, without making other
fetches slower.

If you can managed to remove the alternates for meta commits during
pushes from the local unity repo to a remote one, that's even faster.

The configuration variable gitmeta.stitchSubmodulesRepository can hold
the path to the submodule-only repo; if it's present, the stitcher
assumes that the alternates configuration is set up correctly.

We have not yet considered the efficiency of destitching, and it does
not support this configuration variable.
3 changes: 3 additions & 0 deletions node/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
/node_modules/
/coverage
/yarn/
.vscode

34 changes: 34 additions & 0 deletions node/bin/destitch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env node
/*
* Copyright (c) 2018, Two Sigma Open Source
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of git-meta nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

require("./../lib/destitch.js");

Loading