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

[PATCH 0/2] Move push logic to transport.c

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Mar 9, 2009, 01:06 UTC
Message-ID
<alpine.LNX.1.00.0903082046280.19665@iabervon.org>

Currently, send_pack() does the work of figuring out what the refspecs mean before pushing (with the help of functions from remote.c), updating local state afterwards, and reporting what it did.

Transports other than the native protocol use the same logic for the first of these, and don't do the other two at all. In order to be able to share more code and make it easier to be consist, move the logic to transport_push. This is also more similar to how fetch is organized, although fetch puts most of the logic in builtin-fetch, which isn't really feasible until all of the transports are converted to the new functions, and may be less convenient anyway.

This series only goes as far as adding a new "push_refs" method to struct transport and using it for the git native transport. It doesn't convert http-push or the rsync transports, largely because I don't have test setups for rsync or webdav to make sure that they're still working.

It also leaves copies of matching, updating, and reporting code in builtin-send-pack, but these are only used for "git send-pack", and are not used in the code paths for "git push". Hopefully, we can deprecate the protocol-specific command at some point in favor of just using "git push".

This is on top of next for Jay's patch to make get_local_heads() common.
Daniel Barkalow (2):
  Use a common function to get the pretty name of refs
  Move push matching and reporting logic into transport.c
 builtin-fetch.c     |    6 +-
 builtin-send-pack.c |  153 +++++++++++++--------------
 refs.c              |   10 ++
 refs.h              |    2 +
 send-pack.h         |    6 +-
 transport.c         |  283 +++++++++++++++++++++++++++++++++++++++++++++++----
 transport.h         |    3 +-
 7 files changed, 356 insertions(+), 107 deletions(-)
Next: Johannes Schindelin
Message 1 of 11 in “Move push logic to transport.c”
  1. 0/2 Move push logic to transport.cDaniel Barkalow, Mar 9, 2009
  2. Johannes SchindelinMar 9, 2009
  3. Jeff KingMar 9, 2009
  4. Daniel BarkalowMar 9, 2009
  5. Johannes SchindelinMar 9, 2009
  6. Daniel BarkalowMar 9, 2009
  7. Johannes SchindelinMar 9, 2009
  8. Daniel BarkalowMar 9, 2009
  9. Johannes SchindelinMar 9, 2009
  10. Daniel BarkalowMar 9, 2009
  11. rsync transport: allow local paths, and fix testsJohannes Schindelin, Mar 9, 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.