git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hallvard Breien Furuseth <h.b.furuseth@usit.uio.no>
To: Johan Herland <johan@herland.net>
Cc: Brian Foster <brian.foster@maxim-ic.com>,
	git mailing list <git@vger.kernel.org>
Subject: Re: [Q] Branch aliases (synonyms)?
Date: Tue, 03 Jul 2012 19:49:39 +0200	[thread overview]
Message-ID: <93495bc04d9f7426bef1b1de1b202280@ulrik.uio.no> (raw)
In-Reply-To: <CALKQrgeAXLSwsqwTe_FZN0aNHwnoSBHBt+PO9jpCtzRM1Aeyrw@mail.gmail.com>

 On Tue, 3 Jul 2012 18:22:43 +0200, Johan Herland <johan@herland.net> 
 wrote:
> FWIW, we have done a similar thing at $dayjob: A git repo (originally
> converted form Subversion) still used "trunk" as the main development
> branch. We wanted to start following Git conventions, so we renamed 
> it
> to "master", and set up "trunk" as a symref to "master". We then told
> all the other developers that "trunk" is now "master", and that they
> should switch at their own leisure. After a grace period, we will
> remove the "trunk" symref.
> (...)

 Yes, a symref in the master repo only seems tidy enough.
 I should have realized that's what he meant.

 I can think of one irritant to warn developers of:

 git fetch           # Fetches both A and B
 git checkout A      # Lemme see how this looks for A users...
 ...
 git checkout B      # My scripts are still using B though...
 ...commit something...
 git push            # Pushes B, doesn't know remote A is forwarded
 git push            # Rejected, non-fast-forward of your old A

 "WTF, why does that keep happening all the time?"

 git branch -d A     # Fixes the above (if A is not checked out:)


 And if you haven't already, it may be best to do

 git config --bool receive.denyNonFastForwards  true
 git config --bool receive.denyDeletes          true

 just in case someone gets too clever and does something like:
 "Now how do I get rid of the remote A?  Google... Aha"
 git push origin :refs/heads/A  # whoops, wrong A deleted:-)

 Hallvard

  reply	other threads:[~2012-07-03 17:49 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
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 [this message]
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=93495bc04d9f7426bef1b1de1b202280@ulrik.uio.no \
    --to=h.b.furuseth@usit.uio.no \
    --cc=brian.foster@maxim-ic.com \
    --cc=git@vger.kernel.org \
    --cc=johan@herland.net \
    /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).