Re: [PATCH 0 of 7] [resend] - Improve handling remotes, origin, submodules

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH 0 of 7] [resend] - Improve handling remotes, origin, submodules

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:44:10

Johannes Schindelin [off-list ref] writes:
AFAICT "clone -o" was meant _only_ for this scenario:

You have a slow connection, but someone can provide you with a thumb 
drive, having the current repository.

You clone it from the thumb drive, but of course you want to use your 
(slow) connection for subsequent updates (i.e. you want to have a 
different default remote).

What you do is

	$ git clone -o thumbdrive /media/usbdisk/that-repository.git/

Then, to be able to update from your preferred remote quickly, you add the 
proper remote:

	$ git remote add --fetch origin git://git.kernel.org/shlub.git/

In my understanding, this scenario is the only reason to live for clone's 
-o option, and it would be actively wrong for it to change the _name_ of 
the default remote to "thumbdrive".
Then we should fix "git-clone".

If you do the first command, I am reasonably sure that you would
get:

	[branch "master"]
        	remote = thumbdrive

in your .git/config.  You may want to occasionally go back to
thumbdrive for sneakernetting, so I do not think we should
remove [remote "thumbdrive"] section the clone would leave, but
the above "master branch would interact with thumbdrive
repository" should not be there.

And that corrected behaviour and the intended use of -o should
be documented.

Re: [PATCH 0 of 7] [resend] - Improve handling remotes, origin, submodules

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:44:10

Hi,

On Mon, 4 Feb 2008, Junio C Hamano wrote:
Johannes Schindelin [off-list ref] writes:
quoted
AFAICT "clone -o" was meant _only_ for this scenario:

You have a slow connection, but someone can provide you with a thumb 
drive, having the current repository.

You clone it from the thumb drive, but of course you want to use your 
(slow) connection for subsequent updates (i.e. you want to have a 
different default remote).

What you do is

	$ git clone -o thumbdrive /media/usbdisk/that-repository.git/

Then, to be able to update from your preferred remote quickly, you add 
the proper remote:

	$ git remote add --fetch origin git://git.kernel.org/shlub.git/

In my understanding, this scenario is the only reason to live for 
clone's -o option, and it would be actively wrong for it to change the 
_name_ of the default remote to "thumbdrive".
Then we should fix "git-clone".

If you do the first command, I am reasonably sure that you would get:

	[branch "master"]
        	remote = thumbdrive

in your .git/config.  You may want to occasionally go back to thumbdrive 
for sneakernetting, so I do not think we should remove [remote 
"thumbdrive"] section the clone would leave, but the above "master 
branch would interact with thumbdrive repository" should not be there.

And that corrected behaviour and the intended use of -o should be 
documented.
Fully agree.  It is now point 38 on my ever-growing TODO list.

Ciao,
Dscho
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help