git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hallvard Breien Furuseth <h.b.furuseth@usit.uio.no>
To: Brian Foster <brian.foster@maxim-ic.com>
Cc: git mailing list <git@vger.kernel.org>
Subject: Re: [Q] Branch aliases (synonyms)?
Date: Tue, 03 Jul 2012 14:23:29 +0200	[thread overview]
Message-ID: <93cfd6eb9045585728dfe649359a103c@ulrik.uio.no> (raw)
In-Reply-To: <1919214.YKUdgul2iY@laclwks004>

 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.

 People may have private scripts which will
 be surprised when they encounter B.  E.g. when
 parsing the output from 'git branch'.
 Check out B, then you expect B rather than A
 to be reported as the current branch:
   git checkout B
   git branch
   * A
     B -> A

>   ▶ Are there other solutions?

 You haven't explained the problem which led you to want "equal"
 branches.  E.g. if it's hard to teach developers to switch
 from B to A, a hook which rejects pushes to B might help.
 Possibly in addition to them using a private symref.  In this
 case, 'git symbolic-ref B refs/heads/A' might work better.

 Hallvard

  reply	other threads:[~2012-07-03 12:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-03 10:39 [Q] Branch aliases (synonyms)? Brian Foster
2012-07-03 12:23 ` Hallvard Breien Furuseth [this message]
2012-07-03 12:36   ` Hallvard Breien Furuseth
2012-07-03 13:40   ` Brian Foster
2012-07-03 15:29     ` Michael Haggerty
2012-07-04  7:31       ` Brian Foster
2012-07-05  7:06         ` Brian Foster
2012-07-03 16:22     ` Johan Herland
2012-07-03 17:49       ` Hallvard Breien Furuseth
2012-07-04  7:24         ` Brian Foster
2012-07-04  9:55           ` Hallvard Breien Furuseth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=93cfd6eb9045585728dfe649359a103c@ulrik.uio.no \
    --to=h.b.furuseth@usit.uio.no \
    --cc=brian.foster@maxim-ic.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).