#623334 mr: git checkout checks out into wrong directory

#623334#5
Date:
2011-04-19 13:02:10 UTC
From:
To:
When I use a config like this:

richih@titanium ~/.config/mr/config.d % cat ikiwiki
[work/git/ikiwiki]
checkout = git clone git://git.ikiwiki.info/
richih@titanium ~/.config/mr/config.d %

the checkout ends up in ~/work/git/ikiwiki/git.ikiwiki.info .

Given that I am forced to specify a path anyway, the checkout should
obviously end up in work/git/ikiwiki . While shooting myself in the foot
by providing a different checkout path is of course my privilege, but mr
should default to doing the correct thing.

Another weird side issue is that if I use

richih@titanium ~/.config/mr/config.d % cat ikiwiki
[work/git/ikiwiki]
checkout = git clone git://git.ikiwiki.info/ foobar
richih@titanium ~/.config/mr/config.d %

I end up with work/git/foobar so mr is obviously trying to put
everything into the correct parent directory.


Thanks,
Richard

#623334#10
Date:
2011-04-19 16:59:03 UTC
From:
To:
Richard Hartmann wrote:

This tradeoff was made to allow mr checkout to run entirely arbitrary
commands. One common example is to check out a git repository and then
run git config in it, or switch to a branch other than master; another
is to use an if statement to vary between anonymous and authed checkouts
depending on locally available credentials. The downside of allowing
arbitrary commands is that they cannot be tweaked to avoid
foot-shooting.

It runs the checkout command in the appropriate parent directory.

#623334#15
Date:
2011-04-19 18:42:57 UTC
From:
To:
Would it be acceptable to introduce a new config option like

  source = git+ssh://repo.or.cz/srv/git/foo

that way, mr could Dot The Right Thing by default while still allowing
'checkout' to do whatever the user wants it to.

Maybe git_source or similar would be needed to enable mr to be certain
what kind of remote to use.


Richard

#623334#26
Date:
2019-11-12 05:19:33 UTC
From:
To:
I think that since `mr register` outputs the correct command but that
the command you have written is broken, there is not much to do here.

I'm leaning towards not having this, it feels like extra complexity and
reduced flexibility.

Perhaps mr could instead have a mode that checks the current value of
checkout for the repo with the one `mr register` would output for the
repo as it is now.

#623334#31
Date:
2019-11-12 05:19:33 UTC
From:
To:
I think that since `mr register` outputs the correct command but that
the command you have written is broken, there is not much to do here.

I'm leaning towards not having this, it feels like extra complexity and
reduced flexibility.

Perhaps mr could instead have a mode that checks the current value of
checkout for the repo with the one `mr register` would output for the
repo as it is now.