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

Re: [PATCH 2/6] remote.c: drop "remote" pointer from "struct branch"

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 31, 2015, 22:29 UTC
Message-ID
<xmqq384kpzqb.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20150331222431.GB31948@peff.net>
Jeff King <peff@peff.net> writes:
Show 9 quoted lines
> On Tue, Mar 31, 2015 at 01:50:05PM -0700, Junio C Hamano wrote:
>
>> it first looked somewhat unnatural that you kept the name with which
>> you need to trigger a search for the structure, instead of keeping
>> the structure, one of whose field is its name already.
> ...
> That is the reason I was trying to explain above. Though I suppose you
> could argue that remote_name suffers the same question (i.e., would we
> ever set it to "origin"?)

Well, another would be that by keeping remote_name and making remote on-demand, we may still have to keep all the defined branches in core but we do not have to instanciate all the remotes, if each branch only knows the remote_name. A single look-up may be cheap but that is not a good reason to do one-per-each-branch if we do not need to.

> It is much worse for pushremotes, which can come from
> branch.*.pushremote, remote.pushdefault, branch.*.remote, or "origin".
>
> I'll try to re-word the commit message.
Thanks.
Previous: Jeff KingNext: Jeff King
Message 8 of 18 in “implement @{push} shorthand”
  1. 0/6 implement @{push} shorthandJeff King, Mar 31, 2015
  2. 1/6 remote.c: drop default_remote_name variableJeff King, Mar 31, 2015
  3. Junio C HamanoMar 31, 2015
  4. Jeff KingMar 31, 2015
  5. 2/6 remote.c: drop "remote" pointer from "struct branch"Jeff King, Mar 31, 2015
  6. Junio C HamanoMar 31, 2015
  7. Jeff KingMar 31, 2015
  8. Junio C HamanoMar 31, 2015
  9. 3/6 remote.c: hoist branch.*.remote lookup out of remote_get_1Jeff King, Mar 31, 2015
  10. 4/6 remote.c: provide per-branch pushremote nameJeff King, Mar 31, 2015
  11. Junio C HamanoMar 31, 2015
  12. 5/6 sha1_name: refactor upstream_markJeff King, Mar 31, 2015
  13. 6/6 sha1_name: implement @{push} shorthandJeff King, Mar 31, 2015
  14. Junio C HamanoMar 31, 2015
  15. Jeff KingMar 31, 2015
  16. Junio C HamanoMar 31, 2015
  17. Eric SunshineMar 31, 2015
  18. Jeff KingMar 31, 2015

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.