git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Turning a complete repository to a shallow one

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 11, 2013, 04:53 UTC
Message-ID
<7vk3rkcocy.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CACsJy8Bv+AfDbttFdJ5a0PaoMrMtv1seda7VqLpfdevR4BMj4A@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
Show 7 quoted lines
> 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).

Previous: Duy Nguyen
Message 2 of 2 in “Turning a complete repository to a shallow one”
  1. Duy NguyenJan 11, 2013
  2. Junio C HamanoJan 11, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.