[PATCH RFC 0/8] introduce 'git remote add --push' and 'git clone --push'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I post as an initial RFC the third series in the push.default saga.
This is on top of origin/next and even then it requires the
"push --current" patches to be fully functional.  Even without it,
however, it will create correct configuration.

The series adds --push options to "git remote add" and "git clone".
These accept a push strategy of the same kind as "push.default",
and will use it to create push configuration and refspecs.  These
will then override push.default.

The argument is optional, in which case it will be taken from the
"push.default" config key itself.  In this case, since the user explicitly
requested something they did not configure, a warning is emitted similar
to the one of 1.6.3.  If --push is used appropriately, in a non-specified
future "git push" might not use push.default anymore and thus require
a push refspec.  (Or more realistically, it would look at push.default,
but only to suggest the user commands that do the transition).

This patch is a bit harder to justify than the others so far, since
it may as well look like a feature in search of a use case.  To this,
my reply is that this is just a step towards a more polished (IMO)
implementation of the existing "push.default" feature.  Actually, the
patch is big but it is mostly builtin-remote.c and tests.  And you
will have to put up with this for only another series or two.

Patch 1 is just taken from the push --current series.  Patch 2 adds
a new value for `push.default', so that it's easier to map --mirror
to a --push suboption.

Patches 3 and 4 add the option to "git remote add" (refactoring
first, adding the feature later).

Patches 5 to 8 add the option to "git clone".  The first two share
the code for the config setup between "git remote add" and "git clone".
The third adds a new function to get just the global configuration
(not the repository one), for usage in "git clone" before the repository
is actually created.  The final one finally adds the new option,
which is little more than tweaking the call into "git remote add".

That's it for now.  I'll post the final version of this series when I
get comments *and* once both autosetuppush and push --current have been
committed to next.  In the meanwhile, opinions, reviews and flames are
welcome as usual.


Paolo Bonzini (8):
      reintroduce PUSH_DEFAULT_UNSPECIFIED
      push: add push.default = mirror
      git remote add: refactor configuration
      git remote add: add --push option
      clone: refactoring of building the fetch refspec
      clone: use setup_remote_config
      config: add git_config_norepo
      clone: add --push option

 Documentation/config.txt     |    2 +
 Documentation/git-clone.txt  |   13 +++-
 Documentation/git-remote.txt |   13 ++--
 builtin-clone.c              |  133 +++++++++++++++---------------
 builtin-push.c               |   13 +++-
 builtin-remote.c             |  188 ++++++++++++++++++++++++++++++++++--------
 cache.h                      |    5 +
 config.c                     |   74 +++++++++++-----
 environment.c                |    2 +-
 remote.h                     |    3 +
 t/t5505-remote.sh            |   73 ++++++++++++++++
 t/t5517-push-mirror.sh       |   22 +++++-
 t/t5601-clone.sh             |   78 +++++++++++++++++
 13 files changed, 486 insertions(+), 133 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]