ref parameter for install_git?

36 views
Skip to first unread message

Rainer M Krug

unread,
Feb 15, 2013, 7:25:11 AM2/15/13
to rdev...@googlegroups.com
Hi

on install_github() I have the ref= argument to specify the commit, tag, branchname to install, but I could not find a simmilar argument in install_git. Did I just miss it, or is there a reason why it is not added yet?
I think it would be quite handy to have this argument for install_git as well - In my case, I am putting a simulation model in a package. Wit the ref argument, I could easily go back to a simulation which I have used previously.

Thanks,

Rainer

Hadley Wickham

unread,
Feb 15, 2013, 10:53:26 AM2/15/13
to Rainer M Krug, rdev...@googlegroups.com
Hi Rainer,

install_git was a contributed function, so I guess a ref argument just
slipped through the gaps. I don't have any objections to including it,
but it looks like a non-trivial change
(http://stackoverflow.com/questions/3489173) so it will need some
testing. Feel free to file as an issue on github.

Hadley
> --
> You received this message because you are subscribed to the Google Groups
> "devtools" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rdevtools+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



--
Chief Scientist, RStudio
http://had.co.nz/

Rainer M Krug

unread,
Feb 15, 2013, 10:57:07 AM2/15/13
to Hadley Wickham, rdev...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 15/02/13 16:53, Hadley Wickham wrote:
> Hi Rainer,
>
> install_git was a contributed function, so I guess a ref argument just slipped through the
> gaps. I don't have any objections to including it, but it looks like a non-trivial change
> (http://stackoverflow.com/questions/3489173) so it will need some testing. Feel free to file
> as an issue on github.

OK - I'll do so (on Monday),

Cheers,

Rainer

>
> Hadley
>
> On Fri, Feb 15, 2013 at 6:25 AM, Rainer M Krug <r.m....@gmail.com> wrote:
>> Hi
>>
>> on install_github() I have the ref= argument to specify the commit, tag, branchname to
>> install, but I could not find a simmilar argument in install_git. Did I just miss it, or is
>> there a reason why it is not added yet? I think it would be quite handy to have this argument
>> for install_git as well - In my case, I am putting a simulation model in a package. Wit the
>> ref argument, I could easily go back to a simulation which I have used previously.
>>
>> Thanks,
>>
>> Rainer
>>
>> -- You received this message because you are subscribed to the Google Groups "devtools"
>> group. To unsubscribe from this group and stop receiving emails from it, send an email to
>> rdevtools+...@googlegroups.com. For more options, visit
>> https://groups.google.com/groups/opt_out.
>>
>>
>
>
>


- --
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys.
(Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel : +33 - (0)9 53 10 27 44
Cell: +33 - (0)6 85 62 59 98
Fax : +33 - (0)9 58 10 27 44

Fax (D): +49 - (0)3 21 21 25 22 44

email: Rai...@krugs.de

Skype: RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJRHlrSAAoJENvXNx4PUvmChTsH/RWYSe3uul8lWJSNkbDnjhAC
ccvJZfjZ5XmTY7AZsC8Ugj8xMkNEmHhm/uXJyzYWwRXQALJiVF58XDdFrwbh4jQX
XX3eNAbziiGSQmh4Q8JxMOWAYavFg89zJkDoKbEC+IczwKYMu2d8zxQrC8fHwzzX
dNGJ6+hbD2YvS29KmI188sTdrHHSg2Iy7UleOXTHYBPVLUkW7EgrJSxfyG5rP1bQ
VHgL/7SgEMD5iVQAxM3EJVPGRhGHEadGQK7IHy5V7a9Ryp0L2JTSQSa8tcV/9LVb
kQ8WwujB6bezmVdtt6Dms/Lc7PirFNr/BQOdtYBkY+ZQvd4OKKDoFefpdD7Kzq0=
=Ckgh
-----END PGP SIGNATURE-----

Winston Chang

unread,
Feb 15, 2013, 1:08:16 PM2/15/13
to Rai...@krugs.de, Hadley Wickham, rdev...@googlegroups.com
It's possible to do a shallow clone of a branch, with something like this:
  git clone -b mybranch git://github.com/hadley/devtools.git --depth 1

But this seems to work only with branches; it doesn't seem to work with other refs (SHAs and tags).

-Winston

Winston Chang

unread,
Feb 15, 2013, 2:51:13 PM2/15/13
to rainer, Hadley Wickham, rdev...@googlegroups.com
Tags seem important as well, since it's common practice with git to tag releases. (Branches and tags are similar in that they're pointers to specific commits; the main difference is that branch pointers move when more commits are made, while tags don't.)

If there's no way to shallow-clone at a particular tag in git, then another possibility is to clone the entire git repository and then check out the tag. This could be very inefficient for repos with a long history, however.

-Winston



On Fri, Feb 15, 2013 at 12:59 PM, Rainer M Krug <Rai...@krugs.de> wrote:


On Friday, February 15, 2013, Winston Chang wrote:
It's possible to do a shallow clone of a branch, with something like this:
  git clone -b mybranch git://github.com/hadley/devtools.git --depth 1

But this seems to work only with branches; it doesn't seem to work with other refs (SHAs and tags).


I would say that branch is the most important one, as it makes sense to branch for each release / version. This would be a good start, although then the argument should not be called ref but rather branch.

Cheers,

Rainer
--
NEW GERMAN FAX NUMBER!!!


Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Natural Sciences Building
Office Suite 2039
Stellenbosch University
Main Campus, Merriman Avenue
Stellenbosch
South Africa

Cell:           +27 - (0)83 9479 042
Fax:            +27 - (0)86 516 2782
Fax:            +49 - (0)321 2125 2244
email:          Rai...@krugs.de

Skype:          RMkrug
Google:         R.M....@gmail.com


Winston Chang

unread,
Feb 15, 2013, 3:12:54 PM2/15/13
to rainer, Hadley Wickham, rdev...@googlegroups.com
Actually, it looks like I was wrong -- it does appear possible to clone a specific tag with git:
  git clone -b "devtools-1.1" git://github.com/hadley/devtools.git --depth 1

So even if it's not possible to clone arbitrary commits, tags and branches are good enough for most uses.

-Winston

Rainer M Krug

unread,
Feb 18, 2013, 5:01:22 AM2/18/13
to Hadley Wickham, rdev...@googlegroups.com, Winston Chang
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 15/02/13 16:53, Hadley Wickham wrote:
> Hi Rainer,
>
> install_git was a contributed function, so I guess a ref argument just slipped through the
> gaps. I don't have any objections to including it, but it looks like a non-trivial change
> (http://stackoverflow.com/questions/3489173) so it will need some testing. Feel free to file
> as an issue on github.

Did so - thanks:

https://github.com/hadley/devtools/issues/255

Rainer

>
> Hadley
>
> On Fri, Feb 15, 2013 at 6:25 AM, Rainer M Krug <r.m....@gmail.com> wrote:
>> Hi
>>
>> on install_github() I have the ref= argument to specify the commit, tag, branchname to
>> install, but I could not find a simmilar argument in install_git. Did I just miss it, or is
>> there a reason why it is not added yet? I think it would be quite handy to have this argument
>> for install_git as well - In my case, I am putting a simulation model in a package. Wit the
>> ref argument, I could easily go back to a simulation which I have used previously.
>>
>> Thanks,
>>
>> Rainer
>>
>> -- You received this message because you are subscribed to the Google Groups "devtools"
>> group. To unsubscribe from this group and stop receiving emails from it, send an email to
>> rdevtools+...@googlegroups.com. For more options, visit
>> https://groups.google.com/groups/opt_out.
>>
>>
>
>
>


- --
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys.
(Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel : +33 - (0)9 53 10 27 44
Cell: +33 - (0)6 85 62 59 98
Fax : +33 - (0)9 58 10 27 44

Fax (D): +49 - (0)3 21 21 25 22 44

email: Rai...@krugs.de

Skype: RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJRIfvyAAoJENvXNx4PUvmCOSIH/i39d6KYj15cCtLG7cSTUYq1
Yn8XrIQv9/tKDlT3iGXzGvu8cPoBHQPGZ76TsECDU9cr1JXS8PP9Wr2plETYVske
TiegE7qbrdNNnzE3daEHBPdNmXymCyaSDzJoZC7WqvgrFmxToRrqif2vSjnmEtRV
Kha2CYkpmkCVjZAuH4HtTGDBchJVYRAYX7rYBcpJzIDPUm7azqqgZRR+30jN/J7k
XV/Ctok2Yr92tXZHbPd9GhQruyzVPFZyA7J/htSj5k2DSIi8tYVU46EmucLjgxXK
ql7gJNsGgsF4eb78RTw6k3naGZqTsKfDjCyPornxIbPM5Odt4YRNLhN/ktjq0OM=
=Up3d
-----END PGP SIGNATURE-----

Rainer M Krug

unread,
Feb 18, 2013, 5:03:27 AM2/18/13
to Winston Chang, Hadley Wickham, rdev...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 15/02/13 21:12, Winston Chang wrote:
> Actually, it looks like I was wrong -- it does appear possible to clone a specific tag with
> git: git clone -b "devtools-1.1" git://github.com/hadley/devtools.git
> <http://github.com/hadley/devtools.git> --depth 1
>
> So even if it's not possible to clone arbitrary commits, tags and branches are good enough for
> most uses.

Perfect - that would be exactly the main purpose of this function.

Added to Issue tracker on github.

Thanks,

Rainer




>
> -Winston
>
>
> On Fri, Feb 15, 2013 at 1:51 PM, Winston Chang <winsto...@gmail.com
> <mailto:winsto...@gmail.com>> wrote:
>
> Tags seem important as well, since it's common practice with git to tag releases. (Branches
> and tags are similar in that they're pointers to specific commits; the main difference is that
> branch pointers move when more commits are made, while tags don't.)
>
> If there's no way to shallow-clone at a particular tag in git, then another possibility is to
> clone the entire git repository and then check out the tag. This could be very inefficient for
> repos with a long history, however.
>
> -Winston
>
>
>
> On Fri, Feb 15, 2013 at 12:59 PM, Rainer M Krug <Rai...@krugs.de <mailto:Rai...@krugs.de>>
> wrote:
>
>
>
> On Friday, February 15, 2013, Winston Chang wrote:
>
> It's possible to do a shallow clone of a branch, with something like this: git clone -b
> mybranch git://github.com/hadley/devtools.git <http://github.com/hadley/devtools.git> --depth
> -- You received this message because you are subscribed to the Google Groups "devtools" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> rdevtools+...@googlegroups.com. For more options, visit
> https://groups.google.com/groups/opt_out.
>
>
>
>
>
> -- NEW GERMAN FAX NUMBER!!!
>
>
> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys.
> (Germany)
>
> Centre of Excellence for Invasion Biology Natural Sciences Building Office Suite 2039
> Stellenbosch University Main Campus, Merriman Avenue Stellenbosch South Africa
>
> Cell: +27 - (0)83 9479 042 <tel:%2B27%20-%20%280%2983%209479%20042> Fax:
> +27 - (0)86 516 2782 <tel:%2B27%20-%20%280%2986%20516%202782> Fax: +49 - (0)321 2125
> 2244 <tel:%2B49%20-%20%280%29321%202125%202244> email: Rai...@krugs.de
> <mailto:Rai...@krugs.de>
>
> Skype: RMkrug Google: R.M....@gmail.com <mailto:R.M....@gmail.com>
>
>
>
> -- You received this message because you are subscribed to the Google Groups "devtools" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> rdevtools+...@googlegroups.com. For more options, visit
> https://groups.google.com/groups/opt_out.
>
>

- --
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys.
(Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel : +33 - (0)9 53 10 27 44
Cell: +33 - (0)6 85 62 59 98
Fax : +33 - (0)9 58 10 27 44

Fax (D): +49 - (0)3 21 21 25 22 44

email: Rai...@krugs.de

Skype: RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJRIfxvAAoJENvXNx4PUvmCckAH/0KIaTmYZhzO8Y31Mm2mOd+I
VXeT6hrNRww9pNMqAeX82d/BlqXUNz/t6CcVpUCasbLiiNEIhYUqh/awBPJR8bXp
xgVe7U2Xxlztsg2HnMCGlVTyyGZwwPm3cfQ/bitiypeQm3ZrTmkSA6K9ITTjr9qD
1iatkB4oe4a8idQxmgvA/VKuveRaXCn2k8NMu0QkcgLGF+0ONnjBndjVsLqSMvui
mCgLpy9jHtIfPEHfCXtMyX2tsfcFd5mMZ4KMR7lJiSmUBeThK1HgfR3vz9W+iKjL
mIYs67DeOtnASlnXHqqqc52/z0WSCjLEG7M//gHDGPC6vPBCV0qmSWiPUgZVk1c=
=wTPS
-----END PGP SIGNATURE-----
Reply all
Reply to author
Forward
0 new messages