public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [wwwdocs] Git transition - how to access private user and vendor branches
@ 2020-01-09 16:55 Richard Earnshaw (lists)
  2020-01-10 11:08 ` Richard Earnshaw (lists)
  2020-01-11 15:54 ` Segher Boessenkool
  0 siblings, 2 replies; 8+ messages in thread
From: Richard Earnshaw (lists) @ 2020-01-09 16:55 UTC (permalink / raw)
  To: gcc-patches; +Cc: Joseph Myers

[-- Attachment #1: Type: text/plain, Size: 316 bytes --]

Given the proposed intention to use non-standard refspecs for private 
and vendor branches I've written some notes on how to use these.

It would be helpful if someone could do some experiments to ensure that 
what I've written works properly for all versions of git, not just the 
one I have installed locally.

R.

[-- Attachment #2: www-vendor.patch --]
[-- Type: text/x-patch, Size: 3583 bytes --]

diff --git a/htdocs/svnwrite.html b/htdocs/svnwrite.html
index a1346be1..4873991a 100644
--- a/htdocs/svnwrite.html
+++ b/htdocs/svnwrite.html
@@ -25,6 +25,7 @@ maintainers and significant developers.</p>
   <li><a href="#checkin">Checking in a change</a></li>
   <li><a href="#example">Example check-in session</a></li>
   <li><a href="#branches">Creating and using branches</a></li>
+  <li><a href="#vendor">Private user and Vendor branches</a></li>
   <li><a href="#account">Tips&amp;Tricks around your account</a></li>
 </ol>
 
@@ -407,6 +408,72 @@ svn cp svn+ssh://<i>username</i>@gcc.gnu.org/svn/gcc/trunk \
 do not copy the entire set of ChangeLog entries.  Just use something
 like "Merge from mainline" or similar.</p>
 
+<hr />
+<h2 id="vendor">Private user and vendor branches"</h2>
+
+The GCC git repository is used by many people and the branch and tag
+namespace would become very polluted if all branches lived at the
+top-level naming space.  To help minimise the amount of data that
+needs to be fetched the git repository on gcc.gnu.org contains a
+number of private user and vendor branches that developers use to
+share their work.  These are not pulled by default, but simple
+configuration steps can give access to them.
+
+<ul>
+  <li>Private user branches live
+    in <code>refs/users/<i>username</i>/heads</code> with tags
+    in <code>refs/users/<i>username</i>/tags</code>.</li>
+  <li>Vendor branches live
+    in <code>refs/vendors/<i>vendor-name</i>/heads</code> with tags
+    in <code>refs/vendors/<i>vendor-name</i>/tags</code>.</li>
+</ul>
+
+To fetch any of these you will need to add a fetch refspec to your
+configuration.  For example, to fetch all the IBM vendor branches add to
+your default upstream pull
+
+<blockquote><pre>
+git config --add remote.origin.fetch "+refs/vendors/IBM/heads/*:refs/remotes/origin/IBM/*"
+git config --add remote.origin.fetch "+refs/vendors/IBM/tags/*:refs/tags/IBM/*"
+</pre></blockquote>
+
+this will cause <code>git pull</code> to fetch all the additional
+branches and make them available locally
+under <code>remotes/origin/IBM</code> and will also add any tags under
+the sub-namespace <code>IBM</code>.
+
+Setting up a tracking branch for one of the upstream vendor branches
+is slightly more complicated as <code>git branch
+--set-upstream-to</code> does not work properly.  However, it is
+possible to configure the branch information directly.  First, check
+out the branch you want to track, for example, to check out the
+<code>arm-9-branch</code> use something like:
+
+<blockquote><pre>
+git checkout -b ARM/arm-9-branch origin/ARM/arm-9-branch
+</pre></blockquote>
+
+then change the merge property for the branch to corectly identify the
+upstream source
+
+<blockquote><pre>
+git config branch.ARM/arm-9-branch.merge refs/vendors/ARM/heads/arm-9-branch
+</pre></blockquote>
+
+Pull operations will now correctly track the upstream branch.
+
+It is also possible to set up push operations so that local changes will be pushed to the private namespace.  For example, if you mirror your own private git information with
+
+<blockquote><pre>
+git config --add remote.origin.fetch "+refs/users/<i>my-userid</i>/heads/*:refs/remotes/origin/me/*"
+</pre></blockquote>
+
+then you can also add 
+<blockquote><pre>
+git config --add remote.origin.push "+refs/heads/me/*:refs/users/<i>my-userid</i>/heads/*"
+</pre></blockquote>
+and then any push from a branch that begins with <code>me/</code> will be pushed to the private area.
+
 <hr />
 <h2 id="account">Tips&amp;Tricks around your account</h2>
 

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-01-13  8:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-09 16:55 [wwwdocs] Git transition - how to access private user and vendor branches Richard Earnshaw (lists)
2020-01-10 11:08 ` Richard Earnshaw (lists)
2020-01-11 15:54 ` Segher Boessenkool
2020-01-11 16:35   ` Richard Earnshaw (lists)
2020-01-13  0:38     ` Jason Merrill
2020-01-12 19:02   ` Iain Sandoe
2020-01-13  2:15     ` Segher Boessenkool
2020-01-13  9:04       ` Iain Sandoe

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 read-only IMAP folder(s) and NNTP newsgroup(s).