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

[PATCH 0/3] add push --current and remote.*.pushHeadOnly

From
Paolo Bonzini <bonzini@gnu.org>
Date
Jul 20, 2009, 06:36 UTC
Message-ID
<1248071820-18289-1-git-send-email-bonzini@gnu.org>

This second series is gets rid of the most annoying part (IMHO) of push.default = tracking, i.e. the fact that its behavior cannot be achieved using git's ordinary tools. While autosetuppush is enough to set the refspecs correctly, push.tracking does not push _all_ tracked branches, but only the current one (because it implicitly adds only one refspec, while autosetuppush places them all in the configuration).

What I introduce here is "git push --current" and a companion remote.*.pushHeadOnly option to make it the default. The difference between "git push HEAD" and "git push --current" is that the latter will still walk the remote.*.push refspecs, but honor only the one matching HEAD.

Together with autosetuppush, this more or less achieves the same result as push.tracking, at least for newly created remotes. A subsequent series will handle the transition.

v2 integrates changes from Nanako's review. Patch 1 is new and partially reverts bba0fd2 (push: do not give big warning when no preference is configured, 2009-07-18). Patch 2 is the meat of the implementation. Most of it actually touches the transport mechanism, not builtin-push.c (which covers only one detail about how to handle "git push --current" when the remote does not have a corresponding push refspec). Patch 3 adds remote.*.pushHeadOnly.

Paolo Bonzini (3):
      reintroduce PUSH_DEFAULT_UNSPECIFIED
      push: add --current
      push: add remote.*.pushHeadOnly configuration
 Documentation/config.txt   |    6 ++++
 Documentation/git-push.txt |   18 +++++++++++-
 builtin-push.c             |   17 +++++++++--
 cache.h                    |    1 +
 environment.c              |    2 +-
 http-push.c                |   27 ++++++++++++++----
 remote.c                   |   42 ++++++++++++++++++++++++-----
 remote.h                   |    3 ++
 t/t5516-fetch-push.sh      |   64 ++++++++++++++++++++++++++++++++++++++++++++
 transport.c                |   22 ++++++++++++++-
 transport.h                |    1 +
 11 files changed, 183 insertions(+), 20 deletions(-)
Next: Paolo Bonzini
Message 1 of 9 in “add push --current and remote.*.pushHeadOnly”
  1. 0/3 add push --current and remote.*.pushHeadOnlyPaolo Bonzini, Jul 20, 2009
  2. 1/3 reintroduce PUSH_DEFAULT_UNSPECIFIEDPaolo Bonzini, Jul 20, 2009
  3. 2/3 push: add --currentPaolo Bonzini, Jul 20, 2009
  4. Björn SteinbrinkJul 20, 2009
  5. Paolo BonziniJul 20, 2009
  6. Tay Ray ChuanJul 20, 2009
  7. Paolo BonziniJul 20, 2009
  8. demerphqJul 20, 2009
  9. 3/3 push: add remote.*.pushHeadOnly configurationPaolo Bonzini, Jul 20, 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.