[Q] Branch aliases (synonyms)?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 Having fought and lost a battle not to do this,
 we are currently planning on transitioning from
 the old version (called ‘A’ below) to the new
 (called ‘B’) by creating a TEMPORARY branch for
 the new work, and at the end of the transition,
 merging it into the old, which is then the only
 branch.  That is, at the end we have something
 like the following:

            /--a---a----------\
  ...--o---o                   n---n---A (HEAD)
            \--b---b---b---b--/

 with a starting-point of:

  ...--o---A (HEAD)

 and with during-transition intermediate points
 similar to:

            /--a---A
  ...--*---*
            \--b---b---B (HEAD)

 None of which isn't a problem per se.

 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?
  ▶ Are there other solutions?

 I have written a test script to explore the idea,
 and it seems to be working.  The script is a bit
 on the long side (c.500 lines) since it is trying
 to exercise a number of different cases, so I
 won't post it unless asked.

cheers!
	-blf-

-- 
Brian Foster
Principal MTS, Software        |  La Ciotat, France
Maxim Integrated Products      |  Web:  http://www.maxim-ic.com/

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]