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

Re: [Q] Branch aliases (synonyms)?

From
BFBrian Foster <brian.foster@maxim-ic.com>
Date
Jul 3, 2012, 13:40 UTC
Message-ID
<4261222.bYBuBBxnOa@laclwks004>
In-Reply-To
<93cfd6eb9045585728dfe649359a103c@ulrik.uio.no>
On Tuesday 03-July-2012 05:23:29 Hallvard Breien Furuseth wrote:
Show 20 quoted lines
> Brian Foster wrote:
> > (...)
> >  The catch is a desire(? requirement?) that, when the
> >  transition ends, people used to using B can continue
> >  to use B, people used to using A can continue to use A,
> >  and there is no difference.  That is, after the end of
> >  transition, branch names A and B are the same thing.
> >  Always.  Automatically.
> >
> >  Using a symref seems a working answer.  That is,
> >  after the merge, change B from a true branch head
> >  into a symref pointing to A:
> >
> >       git merge ...
> >       git symbolic-ref refs/heads/B refs/heads/A
> >
> >   ▶ What are the gotchas?
> 
>  Git clone will turn symref B into a regular branch,
>  which will not move in parallel with A.
 Yes, I realize that (and my test script shows it).
 But I'm not concerned about it  — albeit I've yet
 to check with my colleagues —  because it matters
 only if you _expect_ the two to be identical in
 clones at all times.  That wasn't the requirement.
 The (and I must say I _do_ think this is silly!)
 requirement is “People used to using A can still
 use A.  People used to using B can still use B.”
 ( Having said that, I now realize my comment
  that “... and there is no difference” could be
  misconstrued.  My apologies.  Sorry!  What I _meant_
  was the two classes of user (A users and B users)
  could work in an identical fashion except for
  the name difference. )
>  People may have private scripts which will
>  be surprised when they encounter B.  E.g. when
>  parsing the output from 'git branch'.
 YES.  This is a good point, but in this case
 should not apply:  The only repository with
 the symref is not directly accessible, so,
 with a few expert exceptions, everyone is
 using clones (often cloned from a mirror,
 which doesn't have the symref being a clone).
Show 5 quoted lines
>[ ... ]
> >   ▶ Are there other solutions?
> 
>  You haven't explained the problem which led you to want "equal"
>  branches.
 People who don't know what they are doing
 making detailed technical requirements and
 not listening-to advice from the experts.
 I myself want to avoid the whole two-branch
 merge business, or, if not possible, then
 do the obvious thing and delete one of the
 branch names (B) after the merge, yadda-yadda.
 ( I do have a vague hope of removing this
  branch alias “requirement”, but not of
  removing the two-branches-then-merge plan. )
>             E.g. if it's hard to teach developers to switch
>  from B to A, a hook which rejects pushes to B might help.
 Whilst we _may_ have problems with some of the
 internal developers (this can be managed so I'm
 not worried about it), the concern is about the
 external users (clients who clone but never push)
 becoming confused.  Hence the requirement about
 continuing to use the same branch name as you are
 used to using.  That's it!  It's that simple.
Thanks,
	-blf-
>  Possibly in addition to them using a private symref.  In this
>  case, [ suggestion deleted as the author confirms it is in error ].
> 
>  Hallvard
-- 
Brian Foster
Principal MTS, Software        |  La Ciotat, France
Maxim Integrated Products      |  Web:  http://www.maxim-ic.com/
Previous: Hallvard Breien FurusethNext: Michael Haggerty
Message 4 of 11 in “[Q] Branch aliases (synonyms)?”
  1. Brian FosterJul 3, 2012
  2. Hallvard Breien FurusethJul 3, 2012
  3. Hallvard Breien FurusethJul 3, 2012
  4. Brian FosterJul 3, 2012
  5. Michael HaggertyJul 3, 2012
  6. Brian FosterJul 4, 2012
  7. Brian FosterJul 5, 2012
  8. Johan HerlandJul 3, 2012
  9. Hallvard Breien FurusethJul 3, 2012
  10. Brian FosterJul 4, 2012
  11. Hallvard Breien FurusethJul 4, 2012

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.