git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Paolo Bonzini <bonzini@gnu.org>
Date
Jul 20, 2009, 17:49 UTC
Message-ID
<1248112195-3761-1-git-send-email-bonzini@gnu.org>

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(-)
Next: Paolo Bonzini
Message 1 of 16 in “introduce 'git remote add --push' and 'git clone --push'”
  1. 0/8 introduce 'git remote add --push' and 'git clone --push'Paolo Bonzini, Jul 20, 2009
  2. 1/8 reintroduce PUSH_DEFAULT_UNSPECIFIEDPaolo Bonzini, Jul 20, 2009
  3. 2/8 push: add push.default = mirrorPaolo Bonzini, Jul 20, 2009
  4. Junio C HamanoJul 20, 2009
  5. Paolo BonziniJul 20, 2009
  6. Junio C HamanoJul 20, 2009
  7. Paolo BonziniJul 20, 2009
  8. 3/8 git remote add: refactor configurationPaolo Bonzini, Jul 20, 2009
  9. 4/8 git remote add: add --push optionPaolo Bonzini, Jul 20, 2009
  10. 5/8 clone: refactoring of building the fetch refspecPaolo Bonzini, Jul 20, 2009
  11. 6/8 clone: use setup_remote_configPaolo Bonzini, Jul 20, 2009
  12. 7/8 config: add git_config_norepoPaolo Bonzini, Jul 20, 2009
  13. 8/8 clone: add --push optionPaolo Bonzini, Jul 20, 2009
  14. Junio C HamanoJul 20, 2009
  15. Paolo BonziniJul 21, 2009
  16. Junio C HamanoJul 21, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.