From 3ef6eb2df7d01d3fda6d6b89657c26d8ebedc589 Mon Sep 17 00:00:00 2001 From: kx Date: Wed, 14 Nov 2018 08:24:16 +0300 Subject: [PATCH 1/4] Created from upstream/master 5d6aba91dbff3157e498b0a795e99e2fcb7d9ec4 From 29a1e4669d9a1852a3e582ecbed5fca631657a7e Mon Sep 17 00:00:00 2001 From: kx Date: Wed, 14 Nov 2018 08:44:36 +0300 Subject: [PATCH 2/4] Move the .gitrepo config file to .gitrepo/config --- Changes | 6 ++++ Intro.pod | 10 +++--- ReadMe.pod | 28 ++++++++-------- doc/git-subrepo.swim | 28 ++++++++-------- doc/intro-to-subrepo.swim | 10 +++--- lib/git-subrepo | 48 ++++++++++++++------------- lib/git-subrepo.d/help-functions.bash | 16 ++++----- man/man1/git-subrepo.1 | 28 ++++++++-------- note/Story1 | 4 +-- note/ToDo | 4 +-- note/design.swim | 10 +++--- note/design2.swim | 6 ++-- note/init-test | 4 +-- share/zsh-completion/_git-subrepo | 2 +- test/branch.t | 2 +- test/clone.t | 4 +-- test/config.t | 4 +-- test/error.t | 2 +- test/gitignore.t | 4 +-- test/init.t | 4 +-- test/pull-merge.t | 6 ++-- test/pull-new-branch.t | 2 +- test/pull.t | 4 +-- test/push-after-init.t | 6 ++-- test/push-squash.t | 2 +- test/push.t | 6 ++-- test/setup | 8 ++--- 27 files changed, 133 insertions(+), 125 deletions(-) diff --git a/Changes b/Changes index aee5e7c1..832906d1 100644 --- a/Changes +++ b/Changes @@ -2,6 +2,7 @@ version: 0.4.0 date: Thu Nov 8 12:26:38 CET 2018 changes: +- Moved .gitrepo to .gitrepo/config - Fix #325 Do not squash main repo commits - Improve error message for worktree handling - Make version checking portable. #307 @@ -35,6 +36,11 @@ changes: - Fix env var bug in test/push.t - Do not overwrite author information --- +version: 0.4.0 +date: Tue Oct 25 23:08:56 PST 2018 +changes: +- Move .gitrepo to .gitrepo/config +--- version: 0.3.1 date: Tue Jan 3 23:08:56 PST 2017 changes: diff --git a/Intro.pod b/Intro.pod index b7316fec..9a761f48 100644 --- a/Intro.pod +++ b/Intro.pod @@ -260,7 +260,7 @@ Consider the equivalent subrepo commands: $ git subrepo pull foo $ git subrepo push foo -Collaborators see a file called 'foo/.gitrepo', and know that the subdir is a +Collaborators see a file called 'foo/.gitrepo/config', and know that the subdir is a subrepo. The file contains all the information needed by future commands applied to that subrepo. @@ -348,7 +348,7 @@ Given this we do the following steps internally: =item * Create a new subrepo commit object for the subdir content -=item * Add a state file called .gitrepo to the new subrepo/subdir +=item * Add a state file called .gitrepo/config to the new subrepo/subdir =item * Amend the merge commit with this new file @@ -365,7 +365,7 @@ as possible. You don't need to have the subrepo history in your main project, since it is immutably available elsewhere, and you have a pointer to that place. -The new foo/.gitrepo file looks like this: +The new foo/.gitrepo/config file looks like this: [subrepo] remote = git@github.com:you/foo.git @@ -382,7 +382,7 @@ collaborators need this url to pull/push in the future. The next command is the pull command. Normally you just give it the subrepo's subdir path (although you can change the branch with -b), and it will get the -other info from the subdir/.gitrepo file. +other info from the subdir/.gitrepo/config file. The pull command does these steps: @@ -398,7 +398,7 @@ The pull command does these steps: =item * Commit the HEAD of the rebased content -=item * Update/amend the .gitrepo file +=item * Update/amend the .gitrepo/config file =back diff --git a/ReadMe.pod b/ReadMe.pod index de035fa3..2fee848d 100644 --- a/ReadMe.pod +++ b/ReadMe.pod @@ -70,9 +70,9 @@ The C command benefits these roles in the following ways: =item * Collaborators do not need to install unless they want to push/pull. -=item * Collaborators know when a subdir is a subrepo (it has a C<.gitrepo> file). +=item * Collaborators know when a subdir is a subrepo (it has a C<.gitrepo/config> file). -=item * The C<.gitrepo> file never gets pushed back to the subrepo upstream. +=item * The C<.gitrepo/config> file never gets pushed back to the subrepo upstream. =item * Well named branches and remotes are generated for manual operations. @@ -141,7 +141,7 @@ and merged into the subdir. The subrepo history is I into a single commit that contains the reference information. This information is also stored in a special file -called C<< /.gitrepo >>. The presence of this file indicates that the +called C<< /.gitrepo/config >>. The presence of this file indicates that the directory is a subrepo. All subsequent commands refer to the subrepo by the name of the @@ -164,14 +164,14 @@ If you want to expose a subdirectory of your project as a published subrepo, this command will do that. It will split out the content of a normal subdirectory into a branch and start tracking it as a subrepo. Afterwards your original repo will look exactly the same except that there will be a C<< -/.gitrepo >> file. +/.gitrepo/config >> file. If you specify the C<--remote> (and optionally the C<--branch>) option, the -values will be added to the C<< /.gitrepo >> file. The C<--remote> +values will be added to the C<< /.gitrepo/config >> file. The C<--remote> option is the upstream URL, and the C<--branch> option is the upstream branch to push to. These values will be needed to do a C command, but they can be provided later on the C command (and saved to C<< -/.gitrepo >> if you also specify the C<--update> option). +/.gitrepo/config >> if you also specify the C<--update> option). Note: You will need to create the empty upstream repo and push to it on your own, using C<< git subrepo push >>. @@ -186,11 +186,11 @@ The C command accepts the C<--branch=> and C<--remote=> options. Update the subrepo subdir with the latest upstream changes. The C command fetches the latest content from the remote branch pointed -to by the subrepo's C<.gitrepo> file, and then tries to merge the changes into +to by the subrepo's C<.gitrepo/config> file, and then tries to merge the changes into the corresponding subdir. It does this by making a branch of the local commits to the subdir and then merging or rebasing (see below) it with the fetched upstream content. After the merge, the content of the new branch replaces your -subdir, the C<.gitrepo> file is updated and a single 'pull' commit is added to +subdir, the C<.gitrepo/config> file is updated and a single 'pull' commit is added to your mainline history. The C command will attempt to do the following commands in one go: @@ -339,9 +339,9 @@ The C command accepts the C<--all>, C<--ALL>, and C<--force> options. =item C<< git subrepo config