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

[RFC/PATCH] git push usability improvements and default change

From
Finn Arne Gangstad <finnag@pvv.org>
Date
Mar 9, 2009, 22:35 UTC
Message-ID
<1236638151-6465-1-git-send-email-finnag@pvv.org>
Usability improvements:

"-" is now an alias for the current remote (the remote of the current branch or "origin" as a fallback). This works both for push, fetch, pull, remote (and possibly some others), creating a lot of nice shortcuts I think: git remote prune - : prune the current remote git push - HEAD : push the current branch to a branch of the same name git fetch - next : fetch the next branch from the current remote

git push has learned two new command line options --matching and --current, which override any configuration. 'matching' pushes all branches that already exist at the remote, while 'current' pushes the current branch to whatever it is tracking

I chose this behaviour for 'current', since it is the one that I find most useful, and there seems to be no good way of expressing it from the command line. Pushing a branch to an identically named branch on a remote can now easily be done by "git push - HEAD".

Also added a new configuration option push.default, which can have values "nothing", "matching" and "current". This variable will only be used if you have not specificed any refspecs at all, no command line options imply any refspecs, and the current branch has no push configuration.

This is implemented in 1-3
git push default change:
git push will by default push "nothing" instead of "matching".

This is implemented in 4-7. 4-5 are for immediate consumption, 6 is for next major release (or later), and 7 is even later.

4 Adds a warning if you have not configured push.default
5 Changes the wording to say that the default will change. 4 and 5 can
  be applied immediately.
6 changes the deault to "nothing", but keeps the warning.
7 removes the warning entirely
Finn Arne Gangstad (7):
      remote: Make "-" an alias for the current remote
      New config option push.default
      git push: New options --matching and --current
      git push: Display warning on unconfigured default push
      git push: Document that "nothing" is the future push default
      git push: Change default for "git push" to nothing.
      git push: Remove warning for "git push" default change
 Documentation/RelNotes-1.6.3.txt |    7 +++
 Documentation/config.txt         |   18 ++++++++
 Documentation/git-push.txt       |   14 +++++--
 builtin-push.c                   |   84 +++++++++++++++++++++++++++++--------
 cache.h                          |    7 +++
 config.c                         |   23 ++++++++++
 environment.c                    |    1 +
 remote.c                         |    2 +-
 transport.h                      |    9 ++++
 9 files changed, 142 insertions(+), 23 deletions(-)
- Finn Arne
Next: Finn Arne Gangstad
Message 1 of 31 in “git push usability improvements and default change”
  1. git push usability improvements and default changeFinn Arne Gangstad, Mar 9, 2009
  2. 1/7 remote: Make "-" an alias for the current remoteFinn Arne Gangstad, Mar 9, 2009
  3. 2/7 New config option push.defaultFinn Arne Gangstad, Mar 9, 2009
  4. 3/7 git push: New options --matching and --currentFinn Arne Gangstad, Mar 9, 2009
  5. Daniel BarkalowMar 9, 2009
  6. Finn Arne GangstadMar 10, 2009
  7. 4/7 git push: Display warning on unconfigured default pushFinn Arne Gangstad, Mar 9, 2009
  8. Jay SoffianMar 10, 2009
  9. 5/7 git push: Document that "nothing" is the future push defaultFinn Arne Gangstad, Mar 9, 2009
  10. 6/7 git push: Change default for "git push" to nothing.Finn Arne Gangstad, Mar 9, 2009
  11. 7/7 git push: Remove warning for "git push" default changeFinn Arne Gangstad, Mar 9, 2009
  12. Johannes SchindelinMar 9, 2009
  13. Junio C HamanoMar 10, 2009
  14. Finn Arne GangstadMar 10, 2009
  15. Johannes SchindelinMar 10, 2009
  16. Finn Arne GangstadMar 10, 2009
  17. Junio C HamanoMar 10, 2009
  18. Junio C HamanoMar 10, 2009
  19. Finn Arne GangstadMar 10, 2009
  20. Jay SoffianMar 10, 2009
  21. Junio C HamanoMar 11, 2009
  22. Nanako ShiraishiMar 12, 2009
  23. Finn Arne GangstadMar 12, 2009
  24. Miles BaderMar 12, 2009
  25. Finn Arne GangstadMar 12, 2009
  26. Miles BaderMar 13, 2009
  27. John TapsellMar 13, 2009
  28. Jeff KingMar 10, 2009
  29. Finn Arne GangstadMar 10, 2009
  30. Jeff KingMar 10, 2009
  31. Jay SoffianMar 11, 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.