Is there any interest in a patchset for mr to manage which repos are being handled?

Joey Hess joey at kitenet.net
Mon Dec 12 17:22:04 CET 2011


Adam Spiers wrote:
> Firstly, I built a library of skip functions:
> 
>     https://github.com/aspiers/mr-config/blob/master/lib/skippers
> 
> which lets me write things like:
> 
>     [$HOME/.GIT/adamspiers.org/gnupg.sec]
>     skip = default_skipper || missing_exe gpg

I'm with you so far; this is how I use mr, so in a way it's how mr is
designed to be used.

> However, in the upstream mr, this is not fully implemented yet because
> it does not prevent checkouts of lazy repositories:
> 
>     http://thread.gmane.org/gmane.comp.version-control.home-dir/396/focus=398
> 
> To solve this, I knew mr would need a mechanism for referring to a
> single repository, which in turn would require a new namespace for
> repositories.

This still seems a roundabout way to solve that problem.

Why not just:

        lazy() {
		if [ "$MR_ACTION" = checkout ]; then
			if [ "$MR_FORCE" ]; then
				return 1
			else
				echo "skipping checkout of lazy repo (set MR_FORCE=1 to enable)"
				return 0
			fi
		elif [ -d "$MR_REPO" ]; then
                        return 1
                else
                        return 0
                fi
        }

Then maybe make --force set MR_FORCE, and to enable one you just:

	mr --directory somerepo --force checkout

> except that it's more direct, since if you enable 'foo', surely you
> would checkout 'foo' immediately after.  Then the only missing piece
> is 'disable'.  Personally I don't need this (yet, at least).  But if
> you really needed it, the lazy() skipper could easily be extended (or
> a new skipper written) to perform an extra check:
> 
>     test -d .mrdisabled

rm -rf seems a good way to disable a lazy repo.

-- 
see shy jo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 828 bytes
Desc: Digital signature
URL: <http://lists.madduck.net/pipermail/vcs-home/attachments/20111212/fe7f0590/attachment.pgp>


More information about the vcs-home mailing list