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

Re: [PATCH] fetch: add new config option fetch.all

From
Tamino Bauknecht <dev@tb6.eu>
Date
Jan 4, 2024, 20:18 UTC
Message-ID
<70f17f0c-2226-41eb-ae08-348c794a3411@tb6.eu>
In-Reply-To
<xmqqv8896jqo.fsf@gitster.g>

On 1/4/24 19:23, Junio C Hamano wrote:> This sounds like a usability annoyance for forks that use --all some

Show 8 quoted lines
> of the time and not always, as they now have to remember not just to
> pass something to countermand the configured fetch.all but what that
> something exactly is (i.e., the name of the remote they fetch from
> by default), which makes fetch.all less appealing.  I wonder if we
> can instead take "--no-all" from the command line to make configured
> fetch.all ignored (hence, giving an explicit remote will fetch from
> there, and not giving any remote will fetch from whereever the
> command will fetch from with "git -c fetch.all=false fetch")?

I don't think I fully understand the scenario you describe here. But I see that the change would disallow users to fetch only the default remote without its name in a straight-forward way - either your proposed solution to overrule the config value or using something like `git config "branch.$(git branch --show-current).remote"` in combination with `git fetch` would be workarounds. Do you think it is worth adding a flag for it? I can't really think of a real-world use case for it. E.g. the config option "fetch.prune" also doesn't have anything to counteract it (as far as I see).

If a flag is necessary, I think something like "--default-only" (or similar) might be more descriptive than "--no-all".

> Missing sign-off.
Sorry, thanks for pointing it out.
> And we should say that this configuration variable defaults to false.
Will do so.
Show 5 quoted lines
> This conditional cascade will probably need to change when we allow
> "--no-all" to countermand the configured fetch.all anyway, so I
> won't worry about it now, but it looks somewhat convoluted that we
> have to re-check "all" many times, which was the point of the
> original that implemented this as a nested conditional.

It's probably because of the tab width of 8 that I feel like three indentation levels are already too much. I'll use Taylor's suggestion to keep the `argc` check as-is (although two checks will still be necessary). As an alternative I thought about modifying the current behavior of "--all" in combination with an explicit remote as well, but discarded that idea because it might be less intuitive than the error.

Previous: Junio C HamanoNext: Junio C Hamano
Message 9 of 23 in “new config option "fetch.all"”
  1. Tamino BauknechtDec 18, 2023
  2. fetch: add new config option fetch.allTamino Bauknecht, Jan 4, 2024
  3. Taylor BlauJan 4, 2024
  4. Eric SunshineJan 4, 2024
  5. Junio C HamanoJan 4, 2024
  6. Tamino BauknechtJan 4, 2024
  7. Taylor BlauJan 4, 2024
  8. Junio C HamanoJan 4, 2024
  9. Tamino BauknechtJan 4, 2024
  10. Junio C HamanoJan 4, 2024
  11. fetch: add new config option fetch.allTamino Bauknecht, Jan 4, 2024
  12. Eric SunshineJan 4, 2024
  13. Eric SunshineJan 4, 2024
  14. 1/2 fetch: add new config option fetch.allTamino Bauknecht, Jan 4, 2024
  15. 2/2 fetch: add cli option --default-onlyTamino Bauknecht, Jan 4, 2024
  16. Eric SunshineJan 5, 2024
  17. Junio C HamanoJan 5, 2024
  18. fetch: add new config option fetch.allTamino Bauknecht, Jan 6, 2024
  19. Eric SunshineJan 6, 2024
  20. Eric SunshineJan 6, 2024
  21. Junio C HamanoJan 8, 2024
  22. fetch: add new config option fetch.allTamino Bauknecht, Jan 8, 2024
  23. Eric SunshineJan 5, 2024

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.