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

Re: [PATCH 2/2] Make local branches behave like remote branches when --tracked

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Mar 27, 2009, 16:52 UTC
Message-ID
<49CD0440.6010304@drmicha.warpmail.net>
In-Reply-To
<7v1vsjey3s.fsf@gitster.siamese.dyndns.org>
Junio C Hamano venit, vidit, dixit 27.03.2009 17:20:
Show 22 quoted lines
> Michael J Gruber <git@drmicha.warpmail.net> writes:
> 
>> Junio C Hamano venit, vidit, dixit 27.03.2009 09:08:
>> ...
>>> After calling r-f-t, because this new code assumes that for the "." remote
>>> (aka "local repository"), r-f-t lies and does not give back what it
>>> expects, fixes what it got back from r-f-t.  Shouldn't we be fixing this
>>> inside r-f-t?
>>
>> The technical reason is that there is no local remote, i.e. no remote
>> struct for '.', and I don't think we want it, because it would show up
>> in all places where the list of remotes is searched/displayed/...
>>
>> With ret being the branch we talk about, r-f-t is passed ret->remote and
>> ret->merge[i] only. In the local case, r-f-t cannot use the remote
>> struct for '.' (there is none) to find what it needs, and it has no easy
>> access to ret->merge_names[i] which is that info.
>>
>> branch_get(), on the other hand, has all needed info in place.
> 
> Thanks for a detailed explanation.  Would it deserve to be in the commit
> log justification in a summarized form?

You tell me :) I'm still unsure at times how detailed commit messages should be, but I take it I should put a shortened version of the above in there.

Show 8 quoted lines
> 
>> ..., even worse: if foo is
>> ambiguous because refs/heads/foo and refs/remotes/foo exist then
>> refs/heads/foo would win, i.e. we used to output the *wrong* ref. The
>> above disambiguates. But I'll see if I can simplify the output based on
>> the necessity of disambiguation.
> 
> Thanks.
I thought about doing the following:
- remove occurences of refs/remotes (like before the patch) and of
refs/heads. That way the output format stays the same, the amiguity
problem is not worsened
- think later/harder about doing this more cleverly. I guess I need to
check the output of dwim_ref, but have to figure out all the input
parameters first...
Michael
Previous: Junio C HamanoNext: Michael J Gruber
Message 11 of 15 in “Tracking of local branches”
  1. Michael J GruberMar 20, 2009
  2. Michael J GruberMar 20, 2009
  3. Junio C HamanoMar 20, 2009
  4. Daniel BarkalowMar 20, 2009
  5. 0/2 Make local branches behave like remote branches when --trackedMichael J Gruber, Mar 26, 2009
  6. 1/2 Test for local branches being followed with --trackMichael J Gruber, Mar 26, 2009
  7. 2/2 Make local branches behave like remote branches when --trackedMichael J Gruber, Mar 26, 2009
  8. Junio C HamanoMar 27, 2009
  9. Michael J GruberMar 27, 2009
  10. Junio C HamanoMar 27, 2009
  11. Michael J GruberMar 27, 2009
  12. 0/2 Make local branches behave like remote branches when --trackedMichael J Gruber, Apr 1, 2009
  13. 1/2 Test for local branches being followed with --trackMichael J Gruber, Apr 1, 2009
  14. 2/2 Make local branches behave like remote branches when --trackedMichael J Gruber, Apr 1, 2009
  15. Michael J GruberMar 26, 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.