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

Re: [PATCHv4] Documentation: triangular workflow

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 13, 2016, 18:35 UTC
Message-ID
<xmqqa8ipc4y8.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<5B90624A6DC7442C94B933A07F0CD08D@PhilipOakley>
"Philip Oakley" <philipoakley@iee.org> writes:
Show 10 quoted lines
> From: "Junio C Hamano" <gitster@pobox.com>
>> I do not think I agree.
>>
>> If you apriori know that you do want to hack on a project's code, then
>> forking at GitHub first and then cloning the copy would be OK.
>
> You've clipped my other point:
>
> -        One issue may be the different expectations of how the fork is
> -        created (it's only one click on the GitHub..)
Not really.  I said the same thing paraphrased:
    And at that point, you would create a publishing place, push into
    it, and tell others "Hey I did this interesting thing!".  That
    "create a publishing place" step could be just a one click at GitHub.

Anyway, let's step back a bit and agree that your local clone needs to be told 4 pieces of information to help you in a triangular workflow. They are:

 * The URL of the "upstream";
 * The URL of the "publish" (aka "mine");
 * Your push should go to "publish" by default; and
 * Your pull should come from "upstream" by default.
Are we still on the same page, or have we already diverged?

If you start from a clone of "upstream", then the local clone already knows two out of these four, namely, "The URL of the 'upstream' aka origin" and "Your pull should come from upstream by default". In order to go triangular, you still need to tell the other two to your local clone, namely "There is another remote called 'publish'" and "Your push should go to 'publish' not to 'origin'".

When you start by forking at GitHub and then cloning that fork, would it make it easier to go triangular? I do not think so. The local clone gives you (different) two out of these four, namely "The URL of the 'publish' aka origin, which is your own fork" and "Your push should go to 'publish'". You still need to tell the other two, "The URL of the 'upstream'" and "Your pull should come from 'upstream', not from 'origin'" to your local repository.

So I really do not see a point in arguing that "forking at GitHub is easy with one click" favors "your local clone should start by cloning your own fork". Between starting from a clone of upstream and starting from a clone of your own fork, it is the same amount of work to go triangular even for people who fork before having any clone locally, like you.

And I do not have to repeat myself that it is far more helpful to give a recipe to go triangular starting from a clone of upstream for people who first clone three similar projects to evaluate them, discard two that do not suit their needs, and fork the best one, by adding that fork as "publish" aka "mine", than giving a recipe to start from a clone of one's own fork.

Having said that, there are indeed two interesting numbers we may want to ask GitHub folks to help coming up with. Take any popular project with many public forks at GitHub, say rails with 13k forks.

 * How many "clone" from the upstream (i.e. rails/rails in this
   example) compared to 13k forks it has were made by the users?
   Many of them might be just following along (e.g. they want to
   build the tip of the tree that is ahead of any tagged released
   version), but there may be some among these local repositories
   cloned from upstream without forking that record their own
   commits.  These are the people who will benefit a version of the
   documentation under discussion if it describes how to start from
   a clone of upstream, then add your own fork as the publishing
   repository so that the user can use a triangular workflow.  I
   somehow suspect that there are a lot more than 13k (i.e. the
   number of public forks) of these people, but I do not think
   https://github.com/rails/rails page gives us the number.
 * What percentage of these 13k public forks are "empty forks",
   i.e. forked from the main project but has never been pushed into?
   It matters if the answer to this question is a non-trivial
   percentage.  It indicates that the owners of these forks did the
   "fork first and then clone from there", and had to do an extra
   work of adding the real upstream as another remote and set up to
   pull from there, if they wanted to just keep up to date; they
   would have been better off if they started by cloning the
   upstream first.
Previous: Philip OakleyNext: Jordan DE GEA
Message 40 of 41 in “[RFC] Triangular Workflow: user friendly full implementation”
  1. Jordan DE GEAMay 26, 2016
  2. Matthieu MoyMay 26, 2016
  3. Junio C HamanoMay 26, 2016
  4. [RFC] Triangular Workflow UI improvementJordan DE GEA, May 30, 2016
  5. Philip OakleyMay 27, 2016
  6. [RFC] Triangular Workflow UI improvmentsJordan DE GEA, May 30, 2016
  7. Triangular Workflow UI improvement: DocumentationJordan DE GEA, May 31, 2016
  8. Matthieu MoyMay 31, 2016
  9. Jordan DE GEAJun 1, 2016
  10. Michael HaggertyJun 2, 2016
  11. Philip OakleyJun 3, 2016
  12. Jordan DE GEAJun 3, 2016
  13. Matthieu MoyJun 3, 2016
  14. Jordan DE GEAJun 3, 2016
  15. Jordan DE GEAJun 5, 2016
  16. Matthieu MoyJun 6, 2016
  17. Philip OakleyJun 6, 2016
  18. Matthieu MoyJun 6, 2016
  19. Philip OakleyJun 6, 2016
  20. Matthieu MoyJun 7, 2016
  21. Philip OakleyJun 7, 2016
  22. Junio C HamanoJun 3, 2016
  23. Philip OakleyJun 3, 2016
  24. [RFC/PATCHv2] Documentation: triangular workflowJordan DE GEA, Jun 6, 2016
  25. Junio C HamanoJun 6, 2016
  26. Philip OakleyJun 6, 2016
  27. Matthieu MoyJun 7, 2016
  28. Jordan DE GEAJun 7, 2016
  29. [PATCHv3] Documentation: triangular workflowJordan DE GEA, Jun 7, 2016
  30. Junio C HamanoJun 7, 2016
  31. Jordan DE GEAJun 8, 2016
  32. Matthieu MoyJun 8, 2016
  33. [PATCHv4] Documentation: triangular workflowJordan DE GEA, Jun 9, 2016
  34. Junio C HamanoJun 9, 2016
  35. Ramkumar RamachandraJun 11, 2016
  36. Philip OakleyJun 11, 2016
  37. Philip OakleyJun 9, 2016
  38. Junio C HamanoJun 10, 2016
  39. Philip OakleyJun 11, 2016
  40. Junio C HamanoJun 13, 2016
  41. [RFC] Triangular Workflow UI improvementJordan DE GEA, May 30, 2016

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.