]> git.madduck.net Git - code/myrepos.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Add git-remote file to lib. This adds a special type of git repository, where the...
authorJoey Hess <joey@gnu.kitenet.net>
Fri, 16 Jan 2009 03:48:46 +0000 (22:48 -0500)
committerJoey Hess <joey@gnu.kitenet.net>
Fri, 16 Jan 2009 03:48:46 +0000 (22:48 -0500)
debian/changelog
lib/git-remote [new file with mode: 0644]
mr

index a90ccdc009f8db9b53d06144af035180b3d9144b..1e807b01e69de0138622c952d915718d96863657 100644 (file)
@@ -1,3 +1,11 @@
+mr (0.37) UNRELEASED; urgency=low
+
+  * Add git-remote file to lib. 
+    This adds a special type of git repository, where the .git directory
+    is stored on a file server, to avoid wasting space with it on the client.
+
+ -- Joey Hess <joeyh@debian.org>  Thu, 15 Jan 2009 22:47:48 -0500
+
 mr (0.36) unstable; urgency=low
 
   * Add webcheckout command. See <http://kitenet.net/~joey/rfc/rel-vcs/>
diff --git a/lib/git-remote b/lib/git-remote
new file mode 100644 (file)
index 0000000..e671dde
--- /dev/null
@@ -0,0 +1,41 @@
+# This adds a special type of git repository, where the .git directory
+# is stored on a file server, to avoid wasting space with it on the client.
+# One example use is storing a music collection in git, where you can spare
+# the extra space needed for .git on your file server, but not on your
+# laptop. This fills basically the same niche as unison.
+# 
+# To make mr use this file, add a line like this inside the [DEFAULT]
+# section of your ~/.mrconfig
+#include = cat /usr/share/mr/git-remote
+#
+# And an example repo using it would look something like:
+#[lib/sound]
+#checkout = git_remote_checkout turtle /media/turtle/home/joey/lib sound
+# 
+# In this example, the file server's hostname is "turtle", 
+# and it's mounted on /media/turtle. The file server contains a sound.git
+# repository in the specified directory under that mount point.
+# When mr checks out that repository, it will create a sound.hostname
+# directory on the server, containing just the .git directory, and symlink
+# the client's .git directory to it. After checkout, normal git and mr
+# commands can be used, as long as the file server is available.
+
+lib =
+
+       git_remote_checkout() {
+               server="$1"
+               remotebase="$2"
+               dir="$3"
+               hostname="$(hostname)"
+               if [ "$hostname" = "$server" ]; then
+                       git clone "$dir.git" "$dir" 
+               else
+                       if [ ! -d "$remotebase/$dir.$hostname" ]; then
+                               git clone --no-checkout "$remotebase/$dir.git" "$remotebase/$dir.$hostname"
+                       fi
+                       mkdir -p $dir
+                       cd $dir
+                       ln -sf $remotebase/$dir/.git
+                       git checkout .
+               fi
+       }
diff --git a/mr b/mr
index 089530556b6b12acab6f67b8e9a6869b3387328c..7d35892f7bb06d56ee8f093456d387716a848e8f 100755 (executable)
--- a/mr
+++ b/mr
@@ -341,6 +341,13 @@ the action that is performed for a given revision control system, you can
 override these rcs specific actions. To add a new revision control system,
 you can just add rcs specific actions for it.
 
+=head1 EXTENSIONS
+
+mr can be extended to support things such as unison and remote git
+checkout. Some files providing such extensions are available in
+/usr/share/mr/. See the documentation in the files for details about using
+them.
+
 =head1 AUTHOR
 
 Copyright 2007 Joey Hess <joey@kitenet.net>