* Turning a complete repository to a shallow one
@ 2013-01-11 4:40 Duy Nguyen
2013-01-11 4:53 ` Junio C Hamano
0 siblings, 1 reply; 2+ messages in thread
From: Duy Nguyen @ 2013-01-11 4:40 UTC (permalink / raw)
To: Git Mailing List
Apparently we could do it:
git clone --single-branch git.git
cd git
git tag -l|xargs git tag -d
git fetch --depth=1 origin master
git repack -ad
Now the repository becomes shallow and all of history is _lost_. It is
a feature for those who wants to reduce disk usage, but it's also a
gun to shoot at your feet. I'm tempted to ban this case. If I want to
reduce disk usage, I should be forced to shallow clone it first, then
remove the original repository. I still have a complete repository if
I change my mind. And "rm -rf git" is alarming enough for me to think
it twice before executing.
Comments?
--
Duy
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Turning a complete repository to a shallow one
2013-01-11 4:40 Turning a complete repository to a shallow one Duy Nguyen
@ 2013-01-11 4:53 ` Junio C Hamano
0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2013-01-11 4:53 UTC (permalink / raw)
To: Duy Nguyen; +Cc: Git Mailing List
Duy Nguyen <pclouds@gmail.com> writes:
> Apparently we could do it:
>
> git clone --single-branch git.git
> cd git
> git tag -l|xargs git tag -d
> git fetch --depth=1 origin master
> git repack -ad
I may have been unclear in the earlier message, but this is one of
the reasons why I think "fetch --depth" is misadvertised (it says
"deepen the history", when the real thing it does is to truncate to
the new depth counting from the updated tip), and misdesigned (it
forces the user to guess what the new depth should be). It should
be advertised correctly, as a way to reset its depth starting from
the current history (and of course --depth=1 is truncates).
We should introduce a separate "fetch --deepen" that does what
normal people would want (see my earlier message with ASCII art).
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-01-11 4:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-11 4:40 Turning a complete repository to a shallow one Duy Nguyen
2013-01-11 4:53 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).