Xfce Wiki

Sub domains
 

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
dev:howto:git [2009/08/13 23:20] – add git-svn branch merging instructions kelnosdev:howto:git [2010/10/02 17:26] – external edit 127.0.0.1
Line 19: Line 19:
 **If you are uncertain of the clone URL to use for a particular module, please find and click on the module in the listing in [[http://git.xfce.org/|CGit]].  Clone URLs are listed at the bottom of the page for each module.** **If you are uncertain of the clone URL to use for a particular module, please find and click on the module in the listing in [[http://git.xfce.org/|CGit]].  Clone URLs are listed at the bottom of the page for each module.**
  
-To pull from $MODULE in $TYPE you'd use this command (where TYPE is 'apps', 'bindings', 'xfce', etc):+In short:  If you don't have a ssh account and just want a read-only copy of the sourceyou'll want to do:
  
-<code>git clone ssh://$USERNAME@git.xfce.org/git/$TYPE/$MODULE</code>+<code>git clone git://git.xfce.org/$TYPE/$MODULE</code>
  
-This will automatically set up the 'origin' remote in the cloned repository to point to that location, so a "git push" will do the right thing.  If your local username is the same as your git.xfce.org ssh username, you can omit the ''$USERNAME@'' portion of the URL.+or
  
-Unfortunately, we cannot support https pushes at this time due to limitations in the Git http protocol support.+<code>git clone http://git.xfce.org/git/$TYPE/$MODULE</code>
  
-Read-only clones can be obtained via:+''$TYPE'' is one of 'apps', 'bindings', 'xfce', etc.  See the italicized group names in the [[http://git.xfce.org/|CGit index]].
  
-<code>git clone git://git.xfce.org/$TYPE/$MODULE</code>+Committers, see below.
  
-or+===== Committers =====
  
-<code>git clone http://git.xfce.org/git/$TYPE/$MODULE</code>+Before you even think about pushing changes, you must set your name and email address to something valid in your **local** Git config: 
 + 
 +<code>git config --global user.name "J. Random Hacker" 
 +git config --global user.email jrandom@example.com</code> 
 + 
 +**Also**, you must subscribe this address to the [[http://foo-projects.org/mailman/listinfo/xfce4-commits|xfce4-commits]] mailing list.  If you don't wish to receive mail from this list, you can disable mail delivery.  If you do not subscribe, commit notifications will not go to the list.  We're working on a way to remove this requirement, but for now you will need to be subscribed. At the moment, committing with an @xfce.org email doesn't put that requirement thus you can run the command above without the ''%%--global%%'' option in your individual Xfce projects. 
 + 
 +If you have a ssh account, you can clone a repository with: 
 + 
 +<code>git clone ssh://$USERNAME@git.xfce.org/git/$TYPE/$MODULE</code> 
 + 
 +This will automatically set up the 'origin' remote in the cloned repository to point to that location, so a "git push" will do the right thing.  If your local username is the same as your git.xfce.org ssh username, you can omit the ''$USERNAME@'' portion of the URL.
  
-Viewing of the repository in a web browser is provided by a CGit instance at http://git.xfce.org/.+Unfortunately, we cannot support https pushes at this time due to limitations in the Git http protocol support.  If you are unable to communicate with git.xfce.org on port 22, ''git push'' will not work for you.
  
 ===== Translator Access ===== ===== Translator Access =====
  
-Translators will be using [[https://translations.xfce.org/|our Transifex install]] to submit translation updates.  Direct access to the git repository will no longer be provided.  **NOTE: This is not set up yet.  Existing translators will receive an email when their Transifex account is ready.**+Translators should use [[https://translations.xfce.org/|our Transifex install]] to submit translation updates.  Direct access to the git repository is no longer provided. 
 + 
 +If you do not have an account, register for one at our Transifex site and inquire on [[xfce-i18n@xfce.org]] about commit access.  See our [[:translations]] page for more information.
  
 ===== Account Maintenance ===== ===== Account Maintenance =====
Line 67: Line 80:
 ===== New Repositories ===== ===== New Repositories =====
  
-For 'Goodies' developers, we used to have an "open repository creation" policy in our Subversion repo in which any user with write access could create a new module for a new project.  With the move to Git, this is no longer possible.  You will need to request the creation of a new Git repo by emailing [[xfce-repo-admin@xfce.org]] to request a new module.  Please include the module name, which category it should be under (apps, art, bindings, libs, panel-plugins, or thunar-plugins), a description of the module, and a rationale as to why it should be hosted on git.xfce.org (instead of github, gitorious, etc.).  Note that requests to be added to the 'admin,' 'archive,' or 'xfce' categories will be denied.+For 'Goodies' developers, we used to have an "open repository creation" policy in our Subversion repo in which any user with write access could create a new module for a new project.  With the move to Git, this is no longer possible.  You will need to request the creation of a new Git repo by emailing [[xfce-repo-admin@xfce.org]] to request a new module.  Please include your git.xfce.org ssh username, the module name, which category it should be under (apps, art, bindings, libs, panel-plugins, or thunar-plugins), a description of the module, and a rationale as to why it should be hosted on git.xfce.org (instead of github, gitorious, etc.).  Note that requests to be added to the 'admin,' 'archive,' or 'xfce' categories will be denied.
  
 ===== Policies ===== ===== Policies =====
Line 77: Line 90:
 ===== Repository Identification ===== ===== Repository Identification =====
  
-In order to display repository metadata on the [[http://git.xfce.org|CGit]] listings and other places, modules will need a file called "''module.xml''" in the root of their tree (on their master branch).  This file should be a DOAP file describing the project.  You can work off [[http://mocha.xfce.org/~kelnos/module-template.xml|this template]].+In order to display repository metadata on the [[http://git.xfce.org|CGit]] listings and other places, modules will need a file called "''module.xml''" in the root of their tree (on their master branch).  This file should be a [[http://trac.usefulinc.com/doap|DOAP]] file describing the project.  You can work off [[http://mocha.xfce.org/~kelnos/module-template.xml|this template]].
  
 Please at least provide ''<foaf:name>'', ''<foaf:mbox>'', and ''<gnome:userid>'' elements (the latter of which should be your Xfce ssh account username).  You can of course provide more information about yourself if you'd like; see [[http://xmlns.com/foaf/spec/20071002.html#term_Person|foaf:Person]] and [[http://xmlns.com/foaf/spec/20071002.html#term_Agent|foaf:Agent]]. Please at least provide ''<foaf:name>'', ''<foaf:mbox>'', and ''<gnome:userid>'' elements (the latter of which should be your Xfce ssh account username).  You can of course provide more information about yourself if you'd like; see [[http://xmlns.com/foaf/spec/20071002.html#term_Person|foaf:Person]] and [[http://xmlns.com/foaf/spec/20071002.html#term_Agent|foaf:Agent]].
Line 93: Line 106:
 ===== Tips and Tricks ===== ===== Tips and Tricks =====
  
-  * If you clone a lot of Xfce repositories, you can set a shortcut so you don't have to type out the full URL all the time.  Simply run: +See [[dev:howto:git-tips-and-tricks]].
- +
-<code>git config --global 'url.ssh://git.xfce.org/git/.insteadOf' xfce:</code> +
- +
-After this, you'll be able to do, for example: +
- +
-<code>git clone xfce:xfce/xfdesktop</code> +
- +
-and Git will automatically rewrite it to the correct URL.  You can of course do this with git: and http: URLs as well. +
- +
-  * If your ssh username is not the same as your local username, you can make an entry in ''$HOME/.ssh/config'' (create it if it doesn't exist) so you don't have to type it each time: +
- +
-<code>Host git.xfce.org +
-    User $USERNAME</code> +
- +
-Of course, replace ''$USERNAME'' with your actual username.+
  
 ===== Migrating From git-svn Clones ===== ===== Migrating From git-svn Clones =====
Line 123: Line 121:
 $ git checkout master $ git checkout master
 $ git checkout -b new-drawing $ git checkout -b new-drawing
-$ git pull ../xfdesktop.git-svn new-drawing:refs/heads/tmpbranch +$ git fetch ../xfdesktop.git-svn new-drawing:refs/heads/tmpbranch
-$ git reset --hard new-drawing+
 $ git log tmpbranch</code> $ git log tmpbranch</code>
  
Line 138: Line 135:
 <code>$ git cherry-pick d1e0179e8b6f00e4f452513c100f674f7d35dc11 <code>$ git cherry-pick d1e0179e8b6f00e4f452513c100f674f7d35dc11
 $ git cherry-pick e3633d52774bd9a2a20ef9af37d3f72f964a2f54</code> $ git cherry-pick e3633d52774bd9a2a20ef9af37d3f72f964a2f54</code>
 +
 +(Note: if there's only one commit to merge, you can skip the above and just do ''git cherry-pick tmpbranch'', which will just cherry pick the ''HEAD'' commit of ''tmpbranch''.)
  
 Now, if I got any merge errors after one of the cherry pick commands, I'd have to stop there and fix it up first: Now, if I got any merge errors after one of the cherry pick commands, I'd have to stop there and fix it up first:
Line 156: Line 155:
  
 You'll have to repeat this process for any other local branch you have in the old git-svn clone.  As I said, yes, it's annoying, repetitive, manual, and time-consuming (if you have a lot of branches/clones to convert).  If anyone knows a better way, feel free to detail it here. You'll have to repeat this process for any other local branch you have in the old git-svn clone.  As I said, yes, it's annoying, repetitive, manual, and time-consuming (if you have a lot of branches/clones to convert).  If anyone knows a better way, feel free to detail it here.
 +
 +After you finish with all branches in a particular module, you may want to run:
 +
 +<code>$ git gc --prune=now</code>
 +
 +This will remove all the dangling commits, trees, and blobs left over from the probably-large number of mismatched objects discarded when you deleted tmpbranch.