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

Re: [PATCH v6] add --summary option to git-push and git-fetch

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 4, 2010, 17:55 UTC
Message-ID
<7v3a1gdgxq.fsf@alter.siamese.dyndns.org>
In-Reply-To
<7vwrysdiaq.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> I dunno.  If it delegated to a subprocess it would certainly be easier to
> review and get convinced that the change won't affect object flags for
> other parts of the system in bad ways, but there obviously is a
> performance downside.

You fundamentally cannot use the same "summary" logic for push and fetch, and it is especially true if you are doing it inside the same process, I think.

When you force a fetch, you will have the complete histories for both old and new, as you started from old (and I am assuming that you are fsck clean) and you successfully fetched new. When you force a push, however, you may already have the old in your object store, but there is no guarantee that you have the complete history leading to it (i.e. you may have got the tip commit left by an earlier fetch done with a commit walker that you interrupted in the middle).

So at the very least, your "summary_impossible" logic should work a lot harder than a single lookup-commit-reference-gently; it needs to walk the ancestry until you hit some ref to prove that you have a complete history for that commit, without dying. Otherwise get_revision() loop inside print_summary_for_push_or_fetch() would say "oops -- I don't have the parent commit" when it tries to call add_parents_to_list() and die.

Doing the summary traversal inside a subprocess would simplify the handling of the error for such a case, I guess.

My gut feeling from the beginning has been that a patch that touches revision.c for this topic would add unacceptable cruft to the already complex logic in that library for no real gain. Doing the traversal inside a subprocess would allay that worry as well ;-)

Previous: Junio C Hamano
Message 23 of 23 in “add --summary option to git-push and git-fetch”
  1. add --summary option to git-push and git-fetchLarry D'Anna, Jul 3, 2009
  2. Junio C HamanoJul 3, 2009
  3. add --summary option to git-push and git-fetchLarry D'Anna, Jul 7, 2009
  4. Larry D'AnnaJul 9, 2009
  5. add --summary option to git-push and git-fetchLarry D'Anna, Jul 10, 2009
  6. Stephen BoydJul 10, 2009
  7. add --summary option to git-push and git-fetchLarry D'Anna, Jul 11, 2009
  8. Junio C HamanoJul 11, 2009
  9. Larry D'AnnaJan 30, 2010
  10. Junio C HamanoJan 30, 2010
  11. Junio C HamanoJan 30, 2010
  12. Junio C HamanoJan 30, 2010
  13. add --summary option to git-push and git-fetchLarry D'Anna, Jan 30, 2010
  14. add --summary option to git-push and git-fetchLarry D'Anna, Jan 30, 2010
  15. Tay Ray ChuanJan 31, 2010
  16. Ilari LiusvaaraJan 30, 2010
  17. Junio C HamanoJan 30, 2010
  18. Ilari LiusvaaraJan 30, 2010
  19. Daniel BarkalowFeb 1, 2010
  20. Larry D'AnnaFeb 1, 2010
  21. Larry D'AnnaFeb 4, 2010
  22. Junio C HamanoFeb 4, 2010
  23. Junio C HamanoFeb 4, 2010

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.