From 84bb2dfd9f4873c9ca19537efe62219b09ec03bf Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 17 Apr 2008 13:17:20 +0200 Subject: Add a remote.*.mirror configuration option This patch adds a remote.*.mirror configuration option that, when set, automatically puts git-push in --mirror mode for that remote. Furthermore, the option is set automatically by `git remote add --mirror'. The code in remote.c to parse remote.*.skipdefaultupdate had a subtle problem: a comment in the code indicated that special care was needed for boolean options, but this care was not used in parsing the option. Since I was touching related code, I did this fix too. [jc: and I further fixed up the "ignore boolean" code.] Signed-off-by: Paolo Bonzini Signed-off-by: Junio C Hamano --- Documentation/config.txt | 4 ++++ Documentation/git-push.txt | 4 +++- Documentation/git-remote.txt | 6 ++++-- 3 files changed, 11 insertions(+), 3 deletions(-) (limited to 'Documentation') diff --git a/Documentation/config.txt b/Documentation/config.txt index fe43b1257..03f1c3f21 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -910,6 +910,10 @@ remote..push:: The default set of "refspec" for linkgit:git-push[1]. See linkgit:git-push[1]. +remote..mirror:: + If true, pushing to this remote will automatically behave + as if the `\--mirror` option was given on the command line. + remote..skipDefaultUpdate:: If true, this remote will be skipped by default when updating using the update subcommand of linkgit:git-remote[1]. diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt index 3128170bc..dc1d4b0b6 100644 --- a/Documentation/git-push.txt +++ b/Documentation/git-push.txt @@ -69,7 +69,9 @@ the remote repository. be mirrored to the remote repository. Newly created local refs will be pushed to the remote end, locally updated refs will be force updated on the remote end, and deleted refs - will be removed from the remote end. + will be removed from the remote end. This is the default + if the configuration option `remote..mirror` is + set. \--dry-run:: Do everything except actually send the updates. diff --git a/Documentation/git-remote.txt b/Documentation/git-remote.txt index 2cbd1f764..b20e85197 100644 --- a/Documentation/git-remote.txt +++ b/Documentation/git-remote.txt @@ -47,9 +47,11 @@ With `-m ` option, `$GIT_DIR/remotes//HEAD` is set up to point at remote's `` branch instead of whatever branch the `HEAD` at the remote repository actually points at. + -In mirror mode, enabled with `--mirror`, the refs will not be stored +In mirror mode, enabled with `\--mirror`, the refs will not be stored in the 'refs/remotes/' namespace, but in 'refs/heads/'. This option -only makes sense in bare repositories. +only makes sense in bare repositories. If a remote uses mirror +mode, furthermore, `git push` will always behave as if `\--mirror` +was passed. 'rm':: -- cgit v1.2.1